eeprom storage problem
Steve2381
Posts: 94
Ok, I am being thick here I am sure.
One of my programs fills nearly all the memory up, and just leaves a small amount left.
During my program, a routine needs to store three values in the eeprom for retrieval even after a power down.
I cannot get it to store these values, as the program is over-writing the memory addresses.
How do you work out the memory address of the spare remaining space, so that I can 'write' to a free memory area.
IC0, 1B0 and 1D0 are the rows showing free on the memory map.·
thanks (again!)
·
One of my programs fills nearly all the memory up, and just leaves a small amount left.
During my program, a routine needs to store three values in the eeprom for retrieval even after a power down.
I cannot get it to store these values, as the program is over-writing the memory addresses.
How do you work out the memory address of the spare remaining space, so that I can 'write' to a free memory area.
IC0, 1B0 and 1D0 are the rows showing free on the memory map.·
thanks (again!)
·
Comments
write 0, var1
write 10, var2
write 20, var3
Then you can read what you have stored and put the values in any variable you choose:
read 0, x
read 10, y
read 20, z
Clear enough?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Need a bezel for your LCD?
Newzed@aol.com
·
If you do this, you as a programmer need to insure your eeprom DATA space, and your code space, do not collide. PBasic does not insure this by itself. You can easily use the Memory Map to determine what space is available. Look up the DATA statement for how to set and use these addresses.
WRITE 0, Word myValue
-- and it works for READ too:
READ 0, Word myValue
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax