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

Problem using #rom with EEprom data

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



Joined: 18 Jul 2005
Posts: 9
Location: Hertfordshire. UK

View user's profile Send private message

Problem using #rom with EEprom data
PostPosted: Tue Sep 12, 2006 4:56 am     Reply with quote

I have converted 16F877 code to 18F452 code but I am finding the section to initialise data for the internal EEprom is going awry.

The code below generates 8bit numbers for the EEprom when 16F877 is defined but generates 16bit numbers when 18F452 is defined.

Code:
#ifdef proc_18F452
   #rom   0xF00000 =
#else
   #rom    0x2100 =
#endif
{
   #if ICE2000==1
      1, 0, 10, 10,
      21,
   #else
      0x7F, 0x00, 0x10, 0x10,
      0x93,
   #endif
}


Do I need to add/change something or is there a bug in #rom when used in this way, please?
Ttelmah
Guest







PostPosted: Tue Sep 12, 2006 6:49 am     Reply with quote

#rom int8 .....

The default data size for the 18 chips, is 16bits, while for the older chip it is 8bits. You can force the latter chips to use 8bit size for this operation as shown.

Best Wishes
unitrant



Joined: 18 Jul 2005
Posts: 9
Location: Hertfordshire. UK

View user's profile Send private message

PostPosted: Tue Sep 12, 2006 7:06 am     Reply with quote

Brilliant!
Many thanks.
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