Shop OBEX P1 Docs P2 Docs Learn Events
Saving a Variable in EEprom — Parallax Forums

Saving a Variable in EEprom

James LongJames Long Posts: 1,181
edited 2007-04-05 02:11 in Propeller 1
I know....I have read this somewhere.

I've looked for the post....but just can't find it.

Could someone refresh my memory about this.

If I remember correctly, a variable can be stored back into the eeprom, and the propeller will know this variables value(upon boot)·until it is saved(changed) again.

Also since the propeller knows the variable location .....it is quite simple.

I think Chip said something about this.

I hate to ask something I know is here.....just it eludes me.

James L

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-04 22:17
    If you have a byte declared as xxxx and you want to do this, you just have to use one of the two sets of I2C EEPROM write routines to write the value you want to EEPROM location @xxxx. If you have a word value, the LSB goes into @xxxx and the MSB goes into @xxxx+1. The value will be loaded into RAM from the corresponding location(s) in EEPROM on the next boot.
  • James LongJames Long Posts: 1,181
    edited 2007-04-04 22:31
    Mike,

    Thanks for the response....I knew it was pretty easy.....and is real cool that it will work that way.

    I knew I had read that somewhere.

    I'll copy and save this information for my use. I'm starting to do that with anything I think I might need. It is easier than trying to find it later.

    James L
  • TransistorToasterTransistorToaster Posts: 149
    edited 2007-04-05 02:07
    Let me know by PM if you got that working. I was thinking about doing a post with that exact same question. I haven't played with I2C in a while, but there could be ready made spin objects for that.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-05 02:11
    TransistorToaster
    There are two different I2C objects in the Propeller Object Exchange that will do EEPROM access for you. Have a look.
Sign In or Register to comment.