|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
Setting ID bytes |
Posted: Fri Jan 14, 2005 3:03 pm |
|
|
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
|
|
Posted: Fri Jan 14, 2005 3:46 pm |
|
|
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
|
|
Posted: Sun Jan 16, 2005 9:44 pm |
|
|
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. |
|
|
|
|
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
|