Clear EEPROM
philipad23
Posts: 44
Hi
I am using the EEPROM to store data at the run-time of the program. What is the most effective way to clear the EEPROM the next time I turn on the BAsic stamp, so it will contain no data from previous operations?
I am using the EEPROM to store data at the run-time of the program. What is the most effective way to clear the EEPROM the next time I turn on the BAsic stamp, so it will contain no data from previous operations?
Comments
' {$STAMP BS2}
DATA 0(2040)
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
·
Clear_EE:
· FOR idx = 0 TO LastEeAddr
··· WRITE idx, $00
· NEXT
Set the constant LastEeAddr such that the loop will only overwrite your data, and not any program tokens.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax