EEPROM allocation quirk
Bryan
Posts: 2
Hi, I'm kind of a newbie.
Here's a question:
I'm running this code because I'm trying to get used to EEPROM allocatoin
test DATA 0·<-- Initializes the value zero in the index 0 of the EEPROM
%% First line deleted and rest of program run a few times %%
temp VAR Byte·<-- Creates a byte variable temp
READ 0,temp·<-- Reads the index zero of the EEPROM and assigns it's value to temp
DEBUG ? temp·<-- Outputs the value of temp to the debug terminal
temp=temp+1·<-- Increments the value of temp
WRITE 0,temp·<-- Writes the value of temp to index zero of the EEPROM
When I run the program a few times temp is incremented and output to the debug terminal.
When power is disconnected for a few minutes and the program is run again, temp is incremented by two.
Why is this?· I can't really figure it out.
Thanks
Here's a question:
I'm running this code because I'm trying to get used to EEPROM allocatoin
test DATA 0·<-- Initializes the value zero in the index 0 of the EEPROM
%% First line deleted and rest of program run a few times %%
temp VAR Byte·<-- Creates a byte variable temp
READ 0,temp·<-- Reads the index zero of the EEPROM and assigns it's value to temp
DEBUG ? temp·<-- Outputs the value of temp to the debug terminal
temp=temp+1·<-- Increments the value of temp
WRITE 0,temp·<-- Writes the value of temp to index zero of the EEPROM
When I run the program a few times temp is incremented and output to the debug terminal.
When power is disconnected for a few minutes and the program is run again, temp is incremented by two.
Why is this?· I can't really figure it out.
Thanks
Comments
·· I have duplicated your code and procedure,·yet I am unable to duplicate your results...Mine increments by one with each application of power, or pressing th reset button, as it should.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·