PDA

View Full Version : Storing data to the eeprom



John_B
07-22-2009, 07:58 PM
Hi,
I have about 10 longs of configuration data that can be changed by the user. These need to be stored somewhere for the next power up. My first thought was the eeprom - is this possible? If so, how do you access the eeprom and what locations are available? Is there anywhere on the prop chip to·store the data? Any other suggestions?
Regards
John

Mike Green
07-22-2009, 08:13 PM
There are several I2C drivers available in the Object Exchange. The simplest one to use is the "Basic I2C Driver". It allows you to write anywhere in the attached EEPROM. Your program is stored in the EEPROM starting at location zero and the Propeller Tool will tell you how much memory is used. The rest of the EEPROM (up to 32K), although cleared to zeros by the download process, is available for storing data afterwards. Anything past 32K is completely untouched by the download process.

Usually programs start storing data at the end of the EEPROM. In your case, you could use the last 40 bytes of the EEPROM (locations $7FD8-$7FFF).

Look at the comments at the beginning of "Basic I2C Driver" for an example of writing data to the boot EEPROM.

mctrivia
07-22-2009, 08:44 PM
my id object stores 32 bytes to the end of the boot eeprom. very good example of how to do what Mike Mentioned.

http://obex.parallax.com/objects/410/

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
propmod_us and propmod_1x1 are in stock. Only $30 (http://propmodule.com/?x=products). PCB available for $5

Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd (http://www.gadgetgangster.com/160) and propmod-1x1 (http://www.gadgetgangster.com/161) are now available for use in your Gadget Gangster Projects.

Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com (http://uploader.propmodule.com) for free.

John_B
07-23-2009, 12:05 AM
I will give that a go.
Thanks for your help,
John