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 support@ccsinfo.com

Setting ID bytes

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








Setting ID bytes
PostPosted: Fri Jan 14, 2005 3:03 pm     Reply with quote

Question I'm having a problem setting the ID bytes in a program using PCWH 3.178 and a PIC18F6720. As an example I would like to set the ID when viewed from MPLAB as 00009999 but all my attempts so to get pretty close but not quite there. The following are a few things I've tried:

#id 0x09999 (gives 90909090)
#id 0,0,0x99,0x99 (gives 00009090)
#ROM 0x200000 = {0, 0, 0x9999} (gives 00009990)

Any ideas?
Ttelmah
Guest







PostPosted: Fri Jan 14, 2005 3:46 pm     Reply with quote

On paper, your third version should work. It does for me. Are you sure you don't have another bit of code somewhere overwriting address 0x20007?.
The other versions have problems, because some of the operations still retain the 'memory' of the older chips where each ID location could only hold 4 bits. However I'd try:

#rom int8 0x200000 = {0,0,0,0,9,9,9,9}

Which makes it easier to access the individual bytes.

Best Wishes
Guest








PostPosted: Sun Jan 16, 2005 9:44 pm     Reply with quote

Ttelmah wrote:
On paper, your third version should work. It does for me. Are you sure you don't have another bit of code somewhere overwriting address 0x20007?.
The other versions have problems, because some of the operations still retain the 'memory' of the older chips where each ID location could only hold 4 bits. However I'd try:

#rom int8 0x200000 = {0,0,0,0,9,9,9,9}

Which makes it easier to access the individual bytes.

Best Wishes


Hi,

Thanks, the syntax above solved the problem! I checked and didn't have any other code that was overwriting those locations.

Maybe the 3.184 compiler has some problems with #ROM and word values, now I think about it I seem to have recalled in the past once wanting to load a CRC table into FLASH and had problems until I changed to use byte values.

I'd guessed that the other directives were still geared up for the older chips, but thanks for confirming it.

I didn't think to try the later versions of the compiler, although wouldn't have wanted to upgrade just for the sake of this minor annoyance because later versions of the compiler seem to break a few of our projects.


Regards,

Peter.
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