Hi everyone,
I am having a bit of an issue finding a good toturial to deal with wriiting to I2C EPROMs. Some are for the older IDE versions that only allow saving of 1 bit at a time, most dont work...
So here's the idea.
I have 32 bits of data I want to save that represent a number of counts on the atmega counters, going into further details this is how it works:
I have a 16 bit timer.
Each time the timer overflows it increments another 16bit variable by one. This doesnt happen very often, so on overfloaw an ISR is called and I want it to save the 16 bits right into the EEPROM.
The actual 16 bits from the timer should only be saved at power off as they change very often.
Upon power up, the system should read both 16 bit variables, as to continue what it was doing previosuly.
My EEPROM is a 24C32, using an I2C interface. I am aware that the arduino has a built in EEPROM but I do not wish to use it.
Any advice or good toturials are welcome.
I am having a bit of an issue finding a good toturial to deal with wriiting to I2C EPROMs. Some are for the older IDE versions that only allow saving of 1 bit at a time, most dont work...
Don't look for an I2C example. You want a SPI example, don't you?
My EEPROM is a 24C32, using an SPI interface.
24C32 all seem to be I2C interface:
Are you sure about the SPI part?
How are you detecting power loss, and how are you holding power up long enough to complete the EEPROM writing?
I'd recommend an FRAM part - same data retention as EEPROM but without the write cycle limitations, and with SRAM write speeds, much faster than waiting out the EEPROM write cycle.
SurferTim:
I am having a bit of an issue finding a good toturial to deal with wriiting to I2C EPROMs. Some are for the older IDE versions that only allow saving of 1 bit at a time, most dont work...
Don't look for an I2C example. You want a SPI example, don't you?
My EEPROM is a 24C32, using an SPI interface.
Thanks for pointing that out. The EEPROM is I2C, not SPI
CrossRoads:
24C32 all seem to be I2C interface:
http://www.digikey.com/product-search/en?pv16=6547&FV=fff40027%2Cfff80434&k=24c32&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25
Are you sure about the SPI part?
How are you detecting power loss, and how are you holding power up long enough to complete the EEPROM writing?
I'd recommend an FRAM part - same data retention as EEPROM but without the write cycle limitations, and with SRAM write speeds, much faster than waiting out the EEPROM write cycle.
Electronic Components and Parts Search | DigiKey Electronics
Good tip, i need to look into that!
The EEPROM is I2C, I do appologize for the confusion.
Currently I am thinking in saving the data to a RTC backed up RAM memory every minute, and, at system start-up update the eeprom.
I've looked into these memories, aparently if I can get hold of a SPI variant, the read/write oprations are just like an EEPROM, without the write delay
Anyway, back to the original question: I see that most EEPROMs acept some large chunks of DATA and write it continuously rather tha sendind the address for each byte. However all the arduino examples i seen send 8bits at a time, hnce I have to separate my int variable. Can someone clarify on this?
Regards
FRAM - yes, they do not have the EEPROM Write Cycle times in the mS.
EEPROM - you can write code for your specific part to send a starting address and then a burst of databytes, say from an array. Is not hard.
Cool. I ordered a 4K I2C variant to try and replace the eeprom on the RTC.
Ill come back in a few days to report