Shop OBEX P1 Docs P2 Docs Learn Events
Storage — Parallax Forums

Storage

Greg LaPollaGreg LaPolla Posts: 323
edited 2009-02-11 23:03 in Propeller 1
Is it possible to store a value in the eeprom from the running spin program ?

Here the senario:

If I have a sensor that requires calibration, and the power will be turned on and off frequently. Is there a way to store the calibration offset in the eeprom ? Or do I need to use a storage medium like an sd card ?


Greg

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2009-02-11 22:52
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-11 22:55
    Yes, you can store values in the unused portion of the EEPROM. If you look at the memory map in the Propeller Tool, you'll see how much memory your program occupies. Everything from there to the end of the EEPROM is available. When you download a new program to the EEPROM using the Propeller Tool, the entire first (or only) 32K of the EEPROM is replaced by the new program including any calibration data, but otherwise, it's not touched. If you're using an EEPROM larger than 32K, everything beyond 32K is untouched on new downloads.

    There are several objects in the Object Exchange that allow you to read and write EEPROM locations. "Basic_I2C_Driver" is one. The BS2 Compatibility Library is another, "I2C Object V2" is a third.
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-02-11 23:03
    Thanks, Mike.

    I needed these three threads as reminders. Serendipitous synchronicity, indeed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
Sign In or Register to comment.