Ttelmah Guest
|
Re: ccs compiler |
Posted: Sun Nov 21, 2004 4:54 am |
|
|
vineesh wrote: | i have problem with using #rom directve for writing eeprom locations. any body know about it. |
I think you need to say what the problem is.
General comments:
The location required is defined in the 'prgramming' spec for the chip (from MicroChip). For most of the 16 family chips it is 0x2100, while for the 18 chips it is 0xF00000. You should check this for the particular chip though.
Remember that on a '16' chip, the EEPROM is 'mapped' as 8bit values, while on the '18' chips, it is mapped as 16bit values. Hence to store '1, 2, 3, 4' in the first four locations on a 16 chip, you use:
#ROM 0x2100 = { 0,1,2,3 }
while on a '18' chip, you use:
#ROM 0xF00000 = { 0x100,0x302 }
Note the order reversal, since the values are stored 'LSB first'.
You can override the default, by adding 'int8' to the ROM definition, so that values are treated as 8bit. This allows the format to remain more like the older 16 layout.
So:
#ROM int8 0xF00000 = { 1,2,3,4 }
Stores the bytes exactly like the '16' version.
If you still can't get it to work, then come back with details of what is wrong.
Best Wishes |
|