Shop OBEX P1 Docs P2 Docs Learn Events
Writing to EEPROM — Parallax Forums

Writing to EEPROM

NewzedNewzed Posts: 2,503
edited 2005-02-17 15:36 in BASIC Stamp
I am prototyping a new EEPROM.· When I enter the number of packets to receive and store, I would like to automatically write the number of packets to the Stamp EEPROM so when I want to read the stored data the Read routine will read the Stamp EEPROM and get the number of packets to read out.

I wrote:

WRITE 0, word a········ 'a was previously entered as 25

After loading and running the program, I looked at the memory Map.· There was nothing there.· Am I misunderstanding the use of WRITE?· If it does not appear in Stamp EEPROM and is not there when I reboot, this effort will avail nothing.· I do not want to write a DATA statement and reload the program everytime I change the number of packets to read.

Thanks

Sid

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-02-16 23:17
    When you 'Load' your program, it erases any earlier value in the EEPROM.

    You COULD use a 'DATA' statement, that would only be written by the BS2 IDE when you Program the chip -- you are free to change that value via WRITE on-the-fly, and it will retain what you WRITE.

    Rebooting the chip does not erase the EEPROM, nor does it 'refill' the DATA statements, so that would work for you.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-16 23:35
    No, you're misunderstanding the Memory Map function -- it will only show you information from DATA statements and compiled program tokens; it will not show changes that you make during the program run with WRITE.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • NewzedNewzed Posts: 2,503
    edited 2005-02-17 14:43
    Allan, I was still trying to find a solution to my little probelm, and I made a pleasant discovery.

    If I tell the program I want to store 300 packets, and start it running, I can then go back into the program and write:

    DATA word 300

    This shows up immediately in the Stamp EEPROM - no necessity to reload.

    So I guess I have found the best possible answer.

    Sid
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-02-17 15:36
    Newzed, I think you still may be mis-understaning the "Memory Map" feature -- it's a prediction by the IDE of what it WOULD load into the BS2 on the next 'Program' cycle. It's not actually reading the EEPROM of the BS2.

    So when you say "DATA word 300", the Prediction is updated -- but your BS2 is not.
Sign In or Register to comment.