Shop OBEX P1 Docs P2 Docs Learn Events
eeprom data storage — Parallax Forums

eeprom data storage

ArchiverArchiver Posts: 46,084
edited 2000-11-04 13:39 in General Discussion
I'm experimenting with a bs2 program that will write to and read
back data stored in an eeprom.The problem is that as soon as the bs2
is powered up,the stamp starts executing the program and writes over
the old stored data.Is it possible to write a sub-routine that will
wait for a keyboard command before overwriting the stored eeprom data?
Any and all help will be greatly appreciated,THANKS. Dave

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-11-04 13:39
    Good morning, Dave

    You want to tell the Stamp when to start executing. There are several ways
    but here is the most positive.

    Assuming you have a spare input pin, say P15. Take the pin high using a 10K
    pullup resistor to 5VDC. Run a wire from the junction of the resistor and
    the input pin to ground THROUGH a pushbotton so when the button is pressed
    you take in input pin low. Then write the following routine at the beginning
    of your program.

    Begin
    Count 15, 2000, y
    debug ? y
    if y >=1 then Start
    goto begin

    The Stamp will wait forever until you push the button. Be sure you insert
    "y var byte" in the program introduction. Put Start wherever you want your
    program to begin execution.

    Hope this helps.

    Sid Weaver
    Newzed@a...
Sign In or Register to comment.