Shop OBEX P1 Docs P2 Docs Learn Events
Storing info to the EEPROM — Parallax Forums

Storing info to the EEPROM

Phil_PPhil_P Posts: 1
edited 2010-08-28 15:46 in Propeller 1
Hi Everyone,

I'm looking to develop an object that will allow users to store information within the EEPROM.

Essentially I'm looking to take RC decay data off of a pin and store that data into EEPROM for comparison purposes as a later time.

I'm guessing I:
1) Get the resistor into the proper position.
2) Calculate the RC decay for the resistor position.
3) Push a button (on a different pin that's listening) to record the RC data.
4) Then write that data to EEPROM (somehow).

At a later time, I'm going to read the previously stored RC decay data and compare it to the current resistor settings. This way I can ensure the pot (resistor) is back in exactly the same (or relatively close) position.

Does anyone have some sample code or know of an object that allows this type of functionality?

Thanks,
Phil

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-23 09:59
    There's an object called "Basic I2C Driver" in the Propeller Object Exchange. It's designed for reading from and writing to an EEPROM including the one used to store your program. There's a brief example in the comments at the beginning of the object. Be careful about writing too often to the EEPROM. It's easier than you think to write 100,000 times to any one location and wear that location out.
  • RaymanRayman Posts: 14,889
    edited 2010-08-23 10:49
    The easiest way I've found is with:

    File: Propeller Eeprom.spin
    Version: 0.6
    Developed for forthcoming Propeller Education Kit Lab: EEPROM Datalogging and I2C


    It has very simple routines to save data to the eeprom...
  • K2K2 Posts: 693
    edited 2010-08-28 14:03
    Rayman wrote: »
    File: Propeller Eeprom.spin
    Version: 0.6
    Developed for forthcoming Propeller Education Kit Lab: EEPROM Datalogging and I2C

    Where is this file?!
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-28 14:28
    There's a "sticky thread" called "Propeller Education Kit Labs, Tools, and Applications" at the top of the thread list. Look in there in the first message.
  • K2K2 Posts: 693
    edited 2010-08-28 15:46
    Thanks, Mike, for your very timely answer. Note to Self: Stop ignoring sticky threads.

    Great answers (you and jazzed) to Pascal22, too. Amazing how much more interesting the questions and answers are now.
Sign In or Register to comment.