Shop OBEX P1 Docs P2 Docs Learn Events
Storing a value in memory — Parallax Forums

Storing a value in memory

TE44TE44 Posts: 42
edited 2007-01-20 07:02 in Propeller 1
Hello all -

············ Is there a nice object out there to store a value in the eeprom and recall it -
·similar to the Write/Read option in a basic stamp. Value has·to be stored·and recalled after
·power cycle·...·

Comments

  • TE44TE44 Posts: 42
    edited 2007-01-20 02:12
    should have titled it storing a value in eeprom rather than memory .... oops !
  • Luis DigitalLuis Digital Posts: 371
    edited 2007-01-20 02:41
    Yes, view: "i2c Object and examples"
    http://ww1.parallax.com/Default.aspx?tabid=65
  • TE44TE44 Posts: 42
    edited 2007-01-20 05:39
    Luis,

    ····· Thanks for that .... I was hoping there was a one/two liner for the onboard (propeller demo board)·eeprom pretty much like a read/write on a Basic Stamp - rather than·scan the i2c to discover it -·demo uses LCD object for output - would have to change that to·vga text to view·it ... so will have to free time to mod that.·That said was also wondering if the eeprom was·programmed IDE - F11·is the value overwritten·?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-20 06:06
    1) Anything you store in the boot EEPROM is overwritten when you write a new program to EEPROM. The Prop transfers the whole 32K to the EEPROM

    2) The routines in the I2C object are almost one liners. Using the WriteLocation routine, you can write a byte in one statement.
    You just have to follow that with a pause of 5ms to allow the EEPROM to finish writing. There are ways to speed this up a little,
    but that's almost as simple as using the equivalent Stamp statement.

    3) With the Prop Protoboard or the Hydra, the basic board comes with more EEPROM and you can easily add more if you're using a PropStick.
    With other boards, you may need to use other pins (than the ones used with the boot EEPROM - 28/29).
  • TE44TE44 Posts: 42
    edited 2007-01-20 06:12
    Mike,

    ····· Nice one was having difficulty - no delay ......

    cheers
  • TE44TE44 Posts: 42
    edited 2007-01-20 07:02
    Mike,

    ···· I noticed you have a nice minimal i2c routine - what would you suggest the best method is to store a dec value say '3605' (I assume divided into 2 bytes) in the boot eeprom - using your·example ?



    I am new to i2c and thought I had it in the bag - I don't !!

    Appreciate your input..

    TE
Sign In or Register to comment.