Byte storage on eeprom?
Forgive my ignorance if this has been covered a million times.
I am trying to store a byte or long of data on the eeprom that has my propeller code (24c512 eeprom) for use as a status when the processor is shut down. Basically, I want to be able to access this data to know the status of the unit I'm controlling when it was last shut off and restore it to that mode on boot. Is there a simple way to designate a specific section of eeprom to store this, then I can load it when it boots up and make things the way they were?
Thanks for any help.
I am trying to store a byte or long of data on the eeprom that has my propeller code (24c512 eeprom) for use as a status when the processor is shut down. Basically, I want to be able to access this data to know the status of the unit I'm controlling when it was last shut off and restore it to that mode on boot. Is there a simple way to designate a specific section of eeprom to store this, then I can load it when it boots up and make things the way they were?
Thanks for any help.
Comments
Thanks.
obj i2c : "Basic_I2C_Driver" dat status byte 123 ' Initial value pub main i2c.Initialize(28) ... pub UpdateStatus i2c.WriteByte(28, $A0, @status, status) repeat while i2c.WriteWait(28, $A0, @status)
http://forums.parallaxinc.com/forums/default.aspx?f=25&m=219237
That would be perfect.
Dave
con StatusAddress = $8000 obj i2c : "Basic_I2C_Driver" var byte status pub main i2c.Initialize(28) status := i2c.ReadByte(28, $A0, StatusAddress) ... pub UpdateStatus i2c.WriteByte(28, $A0, StatusAddress, status) repeat while i2c.WriteWait(28, $A0, StatusAddress)