View Full Version : data storage

Jon M
09-18-2007, 09:20 PM
Hi Guys,

another day....another problem!!

I have a life_count variable that after every completed operation 1 is added to.· What I need to do is periodically store this value on the eeprom so the value isn't lost when we switch the machine off.· Is this possible on the Prop? If so how do I access the eeprom from my program.



Mike Green
09-18-2007, 10:20 PM
Have a look at the I2C routines in the Object Exchange (like: obex.parallax.com/objects/26/ (http://obex.parallax.com/objects/26/)). They allow you to read/write the EEPROM used for the program. The lower (or only) 32K of the EEPROM is rewritten whenever you download a program using the Propeller Tool, but the upper end is otherwise unused. The Propeller Tool will tell you how big your program is. On those Prop devices with larger EEPROMs like the Protoboard and the Hydra, you have additional EEPROM above the 1st 32K that is completely unused normally. You can also add your own additional EEPROM externally if you're using the Propeller Education Kit or PropStick.

Keep in mind that EEPROMs have limited rewrite capability. You can only change a location perhaps 100,000 times before it "wears out". If you write the life_count value to the EEPROM only when it changes, you should be fine.

Jon M
09-18-2007, 10:49 PM
Hi Mike,

Thanks for the info, does this mean that when I download a new program to the eeprom it will overwrite any data I have stored in the upper end?· If so, if I upgrade the boot eeprom to a 64K version and put the data into the 2nd 32K will the data be protected?·Will·I need to change anything else on my board or in the prop tool to send my program to it?

09-18-2007, 11:17 PM
No, the LOWER 32K is always overwritten

Jon M
09-18-2007, 11:25 PM
short & sweet thanks desilva.
Can you recommend a suitable part type for a 64K eeprom that is known to work with the prop?

09-18-2007, 11:37 PM
All 3.3 V types work. Note that the name is generally not
24LC512 (the "L" indicating the low voltage type) as expected, but rather

where 27 means 2.7 to 5.5 V

Fairchild has:
FM 24 C 256 L or 24 C 256 LZ
Z indicates a super low stand-by current.

Types just announced as "24C256" CAN also be different types, though most should also run at 3V3 though out of spec....

Mike Green
09-18-2007, 11:38 PM
The Atmel 24C512 or the Microchip 24LC512 will both work. You can also use an Atmel 24C1024 to get 128K. This is what's used in the Hydra.

Jon M
09-18-2007, 11:44 PM
thanks again for all your help, one last question, if I use a bigger eeprom am i correct in assuming the next memory address is $8000?


09-18-2007, 11:46 PM
... there is also a package postfix; a ATMEL's DIP is - very exactly:

AT24C512 8P3-2.7

Paul Baker
09-19-2007, 12:18 AM
Jon M said...
thanks again for all your help, one last question, if I use a bigger eeprom am i correct in assuming the next memory address is $8000?


Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)