PDA

View Full Version : BS2 - can I save variables, even after reset?



evergreen
12-01-2009, 03:06 AM
Does the BS2 have the capabilities to save variables to non-volatile (I think that's the word.. like memory that does not depend if there's power or not)? Or would I need an external EEPROM?

Thanks,
Matt

Mike2545
12-01-2009, 03:39 AM
Use the Write and Read commands to store/retrieve variables in the internal eeprom

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike2545

This message sent to you on 100% recycled electrons.

evergreen
12-01-2009, 05:43 AM
Okay, and I've read that downloading a new program only erases the necessary memory locations to fit the new program. Is there a way to tell the system to wipe everything before downloading the new program?

Thanks,
Matt

Mike Green
12-01-2009, 06:55 AM
No

If you include a DATA statement in your program (read the chapter in the BASIC Stamp Syntax and Reference Manual), the DATA statement will initialize the portion of the EEPROM that it occupies when the program is downloaded. The first DATA statement in a program starts at location zero in the EEPROM.