Shop OBEX P1 Docs P2 Docs Learn Events
data storage — Parallax Forums

data storage

Jon MJon M Posts: 22
edited 2007-09-18 17:18 in Propeller 1
Hi Guys,

another day....another problem!!

I have a life_count variable that after every completed operation 1 is added to.· What I need to do is periodically store this value on the eeprom so the value isn't lost when we switch the machine off.· Is this possible on the Prop? If so how do I access the eeprom from my program.

Ta

Jon

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-18 15:20
    Have a look at the I2C routines in the Object Exchange (like: obex.parallax.com/objects/26/). They allow you to read/write the EEPROM used for the program. The lower (or only) 32K of the EEPROM is rewritten whenever you download a program using the Propeller Tool, but the upper end is otherwise unused. The Propeller Tool will tell you how big your program is. On those Prop devices with larger EEPROMs like the Protoboard and the Hydra, you have additional EEPROM above the 1st 32K that is completely unused normally. You can also add your own additional EEPROM externally if you're using the Propeller Education Kit or PropStick.

    Keep in mind that EEPROMs have limited rewrite capability. You can only change a location perhaps 100,000 times before it "wears out". If you write the life_count value to the EEPROM only when it changes, you should be fine.
  • Jon MJon M Posts: 22
    edited 2007-09-18 15:49
    Hi Mike,

    Thanks for the info, does this mean that when I download a new program to the eeprom it will overwrite any data I have stored in the upper end?· If so, if I upgrade the boot eeprom to a 64K version and put the data into the 2nd 32K will the data be protected?·Will·I need to change anything else on my board or in the prop tool to send my program to it?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-18 16:17
    No, the LOWER 32K is always overwritten
    Yes.
    No.
  • Jon MJon M Posts: 22
    edited 2007-09-18 16:25
    short & sweet thanks desilva.
    Can you recommend a suitable part type for a 64K eeprom that is known to work with the prop?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-18 16:37
    All 3.3 V types work. Note that the name is generally not
    24LC512 (the "L" indicating the low voltage type) as expected, but rather
    24C512-27

    where 27 means 2.7 to 5.5 V

    Fairchild has:
    FM 24 C 256 L or 24 C 256 LZ
    Z indicates a super low stand-by current.

    Types just announced as "24C256" CAN also be different types, though most should also run at 3V3 though out of spec....
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-18 16:38
    The Atmel 24C512 or the Microchip 24LC512 will both work. You can also use an Atmel 24C1024 to get 128K. This is what's used in the Hydra.
  • Jon MJon M Posts: 22
    edited 2007-09-18 16:44
    thanks again for all your help, one last question, if I use a bigger eeprom am i correct in assuming the next memory address is $8000?

    ·
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-18 16:46
    ... there is also a package postfix; a ATMEL's DIP is - very exactly:

    AT24C512 8P3-2.7
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-09-18 17:18
    Jon M said...
    thanks again for all your help, one last question, if I use a bigger eeprom am i correct in assuming the next memory address is $8000?


    Correct

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.