Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/11/14 12:50
Read: times


 
#190396 - Using SDCC...
Responding to: ???'s previous message
Placing a variable at a fixed location is best done with the relevant toolchain C language extension. In SDCC you can use the following:

__code __at (0x0ff0) unsigned char ID = MY_CODE_IDENT;
 

As others have posted, you cannot write to code ROM in your application, you can only set the ROM at compile time. If you really want to write a value that persists through a power cycle, you will need to store it in EEPROM, not code ROM (the clue is in the name).

List of 8 messages in thread
TopicAuthorDate
How to init a variable in ROM            01/01/70 00:00      
   You can NOT write to ROM            01/01/70 00:00      
   Hex file            01/01/70 00:00      
   Initialize code            01/01/70 00:00      
   toolchain?            01/01/70 00:00      
   Using SDCC...            01/01/70 00:00      
   that chip does not have any ROM            01/01/70 00:00      
   Here is the solution I was looking for            01/01/70 00:00      

Back to Subject List