Shop OBEX P1 Docs P2 Docs Learn Events
EEPROM allocation quirk — Parallax Forums

EEPROM allocation quirk

BryanBryan Posts: 2
edited 2004-11-04 16:45 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-11-04 15:51
    Bryan,

    ·· 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 WilliamsJon Williams Posts: 6,491
    edited 2004-11-04 15:53
    I was wondering the same thing, Chris. Perhaps he's cycling power and getting a dual reset that his code doesn't see as there are no delays built in.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-11-04 16:45
    I dunno...The BS2s are so stable that it's hard to think anything else...About the only other thing I can think of is noise from the power supply, or low batteries...



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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
    ·
Sign In or Register to comment.