Yes. You can store them in the EEPROM. If you have a ProtoBoard or other Prop board with a 64K byte EEPROM (24LC512) or bigger, you have the entire 2nd 32K (or more) to do with as you please. If you have a Prop board with only a 32K EEPROM (24LC256), that's used for the program. Whenever you download a new program to the EEPROM, that 1st 32K is cleared. Once a program is downloaded though, you can use everything past the end of your program to save information. You can use an object like Basic_I2C_Driver from the Object Exchange to do the actual reading and writing of the EEPROM. There are simple examples in the code comments there.
I tried to use VarBackup to copy 2 of my varibles but it locks up my whole program. The 2 varibles are example log[500] and psi[500] so they are really 1000 varibles that i try to backup. Im guessing it must take too long to back up all those varibles. What Im trying to do is store live datalogs. So i store them in a vaible array. And then later in the program I have the instruction to varbackup. Is this a bad way to try to do this. Can I just save my varible array directly to the part of the eeprom that does not get erased?
thanks
It's impossible to tell you why your program locks up without more information. At a minimum, you need to post your source program as an attachment to a message. Follow these instructions ...
Each write operation to EEPROM takes 5-10ms. It's possible to write larger blocks of information with a single operations (page writes). Do keep in mind that writing repeatedly to the same area of EEPROM will eventually wear out that section of EEPROM. We're talking about 100,000 times or more, but it's possible to exceed that in a tight loop in a few minutes.
Rather than use a specialized method I much prefer the standard eewrite(@variable,variable) form. This saves the contents of the variable in the same location in EEPROM which is automatically restored when the Prop boots and copies the first 32K of EEPROM into RAM. You don't need a special place in the EEPROM for backup as this space is already reserved for the variable. It really is a much neater way of doing things.
Of course you would not want to be constantly updating the variable in EEPROM itself as they do have a limited write endurance per location/page of around 1 million <minimum> (old tech had less). The update to EEPROM should be made at the time a change to the variable is made such as when a user changes the variable or if this variable is not a configuration variable but a constantly changing reading then you might to elect to have a background function check this every so often and only back it up if there is a change between it and the EEPROM. But of course we don't really know the operating parameters of your application so it's a bit had to advise.
Comments
Try this link http://forums.parallax.com/showthread.php?97625-PE-Kit-Lab-Applications-%E2%80%93-EEPROM-Datalogging-and-I2C
... Tim
-Ron
thanks
Each write operation to EEPROM takes 5-10ms. It's possible to write larger blocks of information with a single operations (page writes). Do keep in mind that writing repeatedly to the same area of EEPROM will eventually wear out that section of EEPROM. We're talking about 100,000 times or more, but it's possible to exceed that in a tight loop in a few minutes.
thanks guys
Of course you would not want to be constantly updating the variable in EEPROM itself as they do have a limited write endurance per location/page of around 1 million <minimum> (old tech had less). The update to EEPROM should be made at the time a change to the variable is made such as when a user changes the variable or if this variable is not a configuration variable but a constantly changing reading then you might to elect to have a background function check this every so often and only back it up if there is a change between it and the EEPROM. But of course we don't really know the operating parameters of your application so it's a bit had to advise.