CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ccs compiler

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
vineesh
Guest







ccs compiler
PostPosted: Sun Nov 21, 2004 4:13 am     Reply with quote

i have problem with using #rom directve for writing eeprom locations. any body know about it.
Ttelmah
Guest







Re: ccs compiler
PostPosted: Sun Nov 21, 2004 4:54 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group