eeprom variables Crossworks AVR
I am interested in storing a set of variables in eeprom. It is important in what order these are stored since I will have both a bootloader and an application using these. In CodeVision I have seen something like this to make sure the variables are stored at memory location 0x001 :
#asm
.ESEG
.ORG 0x001
#endasm
eeprom unsigned char A=0x01;
eeprom unsigned char B=0x02;
#asm
.ESEG
.ORG 0x003
#endasm
This however assumes that the compiler always store the variables in the same order, which is not necessary the case. Can someone please help me out here with suggestions on how to solve this problem in crossworks.
/Lars
-
I had always assumed the user had to specify what was stored where, it had never occurred to me it would be possible to do it like you do with variables in RAM. The datasheets for all the AVRs I've ued have had C routines to show you exactly how to store and read EE values, BTW.
Rob
Please sign in to leave a comment.
Comments
2 comments