Beginner: Store Values in Propeller Memory
Chad1
Posts: 26
Hi all,
This is probably an easy thing to do, but my mind gets foggy when it comes to dealing with registers and memory...
I'm trying to save the value of a parameter so that when power is shut off and turned back on, the parameter is loaded with the value it had before a power-down. In a separate thread, I got a tip from someone in this community to "...write the value to the same address as your variable has in RAM and on boot-up the last saved value will be auto-loaded." This is perfect, but I don't know how to implement this in spin code. Can someone help me by writing a small piece of sample code which does this, or refer me to the appropriate section of the Propeller manual which explains this?
Thanks!
This is probably an easy thing to do, but my mind gets foggy when it comes to dealing with registers and memory...
I'm trying to save the value of a parameter so that when power is shut off and turned back on, the parameter is loaded with the value it had before a power-down. In a separate thread, I got a tip from someone in this community to "...write the value to the same address as your variable has in RAM and on boot-up the last saved value will be auto-loaded." This is perfect, but I don't know how to implement this in spin code. Can someone help me by writing a small piece of sample code which does this, or refer me to the appropriate section of the Propeller manual which explains this?
Thanks!
This discussion has been closed.
Comments
I should have noted that I originally intended on storing the parameter's value in EEPROM, and I started a thread asking how to use the eeprom object file to do it (http://forums.parallax.com/showthread.php/157833-Beginner-Use-EEPROM-to-Store-Retrieve-Integer-Value). The response I mentioned (about storing the value in RAM) was from that thread, and for some reason after responding to it all activity died.
I'd like to avoid using my EEPROM to store the value, per the response from the above thread. Any help I could get in doing that would be appreciated.
Jonnymac was referring to writing the value to the same location in eeprom, only he added that you don't need to write to upper eeprom. However, I suggest you learn how to write to eeprom above $8000 - $FFFF. This requires a 64k eeprom(512kb)
-Phil