Shop OBEX P1 Docs P2 Docs Learn Events
stored variables — Parallax Forums

stored variables

Earl FosterEarl Foster Posts: 185
edited 2009-03-28 14:04 in Propeller 1
I am trying to read/write a variable from/to a specific memory location that will be retained when there is a power cycle or reset.· The variables will change throughout the life of the program so I figure I can assign a seed value the first time and then read and write the changing·variable there after.· What is the best approach to accomplish this task?



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET

"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman

Comments

  • ericballericball Posts: 774
    edited 2009-03-27 16:31
    If you want the variable to survive a Propeller power down or reset, you're going to have to store it in an off-chip EEPROM or equivalent.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-03-27 16:52
    Earl Foster,

    Andy Lindsay wrote an excellent description on how to do this very thing. The only caveat is that if you re-program from the Propeller IDE, then the EEPROM locations value will be lost. But even then if you substitute a larger EEPROM and write to the upper 32K then even a Propeller IDE download can't touch this area of EEPROM ... only the EEPROM object within the Propeller can see it.


    Check out this link Andy Lindsay wrote:
    http://forums.parallax.com/forums/default.aspx?f=25&m=219237

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 3/28/2009 5:49:56 AM GMT
  • Earl FosterEarl Foster Posts: 185
    edited 2009-03-27 18:25
    Thanks, I figured there was a way. I will look into that thread.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
  • mparkmpark Posts: 1,305
    edited 2009-03-28 00:44
    Beau, which part of the text you quoted isn't exactly true?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-03-28 05:53
    mpark,

    I apologize... I misread your post. For some reason the "...off-chip EEPROM or equivalent" didn't register with "...surviving a Propeller power down or reset".

    I edited my earlier post

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • mparkmpark Posts: 1,305
    edited 2009-03-28 07:32
    You weren't quoting me so you needn't apologize to me. I was just wondering if I was missing something. Thanks for clearing that up.
  • ericballericball Posts: 774
    edited 2009-03-28 13:32
    Actually, you make a good point. Since the IDE can overwrite the low 32K of the boot EEPROM, using that space for temporary storage is not ideal.
  • Earl FosterEarl Foster Posts: 185
    edited 2009-03-28 14:04
    Well it worked like a champ. Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
Sign In or Register to comment.