PDA

View Full Version : stored variables



Earl Foster
03-27-2009, 09:51 PM
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 (http://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

ericball
03-27-2009, 11:31 PM
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 Schwabe (Parallax)
03-27-2009, 11:52 PM
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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Post Edited (Beau Schwabe (Parallax)) : 3/28/2009 5:49:56 AM GMT

Earl Foster
03-28-2009, 01:25 AM
Thanks, I figured there was a way. I will look into that thread.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET (http://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

mpark
03-28-2009, 07:44 AM
Beau, which part of the text you quoted isn't exactly true?

Beau Schwabe (Parallax)
03-28-2009, 12:53 PM
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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

mpark
03-28-2009, 02:32 PM
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.

ericball
03-28-2009, 08:32 PM
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 Foster
03-28-2009, 09:04 PM
Well it worked like a champ. Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET (http://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