EEPROM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EEPROM

1,642 Views
ramabh
Contributor I
Hi ...........
 
I am using cosmic compiler and freescale hcs12 controller(MC9s12DT128)
 
I am defining a variable in eeprom at a particular address and i want to initialise it also but i am not able do this......
what i did was..
@eeprom UINT32 u32eepromsum @0x0D00;
the above defnition is working but i want to set the value in eeprom at the time of programming only,so i did like this
@eeprom UINT32 u32eepromsum @0x0D00=0x88;
 
but i am not able to compile with this defnition..i am getting error message "invalid lvalue"
Is this type of of defnition is not supported by Cosmic
 
Even IAR supports this types.....
 
In Hcs12 for writting in eeprom it is taking more time because of its limitation that we have to erase and then write.Erase itself takes 27msec.In my project time is very critical....
 
so i want the value to be loaded in eeprom at the time of programming only
 
 
 
 
Labels (1)
0 Kudos
1 Reply

216 Views
NLFSJ
Contributor III
Hi,
 
CW does not have same support for EEPROM intialization as Cosmic. You can do following:
 
const UNIT32 u32eepromsumINT @0x0D00=0x88; // This will let CW linker to generate correct S19 file to have EEPROM 0x0D00 with value 0x88 in flash programming. But you must use pointer to access 0x0D00 in your code.
 
NOTE:  const is the key to get what you want, but the drawback is you can't simply modify u32eepromsumINT -- but have to use pointer to access it.
 
Regards,
Nina
0 Kudos