The Stamp stores its program in an EEPROM (electrically erasable programmable read only memory) and, with the READ and WRITE statements, can also store data in the EEPROM in an area not usually used by the program. This is retained when the power is off. The variables are erased when the device is reset (like when power is restored). Read the section of the manual on the READ and WRITE statements and ask for help if that doesn't give you enough information.
·· How often is the variable being updated?· If only once in awhile like a set point you could store it in EEPROM each time it was changed then load it from that location upon startup.· However if it's changing rapidly in the code you wouldn't want to write it to EEPROM since it would slow the program down and wear out the EEPROM location.· One other possibility was if your hardware included an RTC such as the DS1302 or DS1307 you could store the value in the battery-backed RAM.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
Thanks guys, good information. My application is a vehicle odometer. Currently the resolution is 1 mile. You bring up a good point that brings to mind that the collected portion of a mile that has not incremented the mile digit will be lost when the power is turned off. Mmmm... If I incremented the EEPROM every 0.1 mile, then the tenths nibble would change at most 1 million times. But probably lots less in the life of a motorscooter. Is this too much?
I wanted to add a RTC in but I only have 1 unused I/O pin. Is there a way to multiplex the use of them (hardware wise)?
Comments
·· How often is the variable being updated?· If only once in awhile like a set point you could store it in EEPROM each time it was changed then load it from that location upon startup.· However if it's changing rapidly in the code you wouldn't want to write it to EEPROM since it would slow the program down and wear out the EEPROM location.· One other possibility was if your hardware included an RTC such as the DS1302 or DS1307 you could store the value in the battery-backed RAM.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I wanted to add a RTC in but I only have 1 unused I/O pin. Is there a way to multiplex the use of them (hardware wise)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com