View Full Version : Writing to EEPROM

02-17-2005, 06:14 AM
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.



02-17-2005, 06:17 AM
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 Williams
02-17-2005, 06:35 AM
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

02-17-2005, 09:43 PM
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.


02-17-2005, 10:36 PM
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.