Experts,
I see very affordable EEPROM expansion modules like the AT24C256 (cheap here), and with limited reads/writes, I'm curious what kind of scenario(s) would warrant one?
TIA!
Experts,
I see very affordable EEPROM expansion modules like the AT24C256 (cheap here), and with limited reads/writes, I'm curious what kind of scenario(s) would warrant one?
TIA!
All EEPROM has limited erase/write cycles.
Such modules just allow you to have extra non-volatile storage
AWOL:
All EEPROM has limited erase/write cycles.
Such modules just allow you to have extra non-volatile storage
Thanks for writing, AWOL...
But with that in mind, what kind of scenario(s) would they be desirable in? Are there any use cases where an extra 32K of EEPROM makes a difference?
The Arduino has limited SRAM UNO ~2K.
You could use it instead of an SD card to store readings etc.
See here for an example:
.
You may want to save something that is large for internal EEPROM but small enough it is not worth getting good 3V3 and level shifting for SD card. May be serious problem for example when you run on 2 AAs. Also physical space of SD card may be issue. I used EEPROM to
EDIT: the module itself is not so good: power hungry LED, included pull-ups are hardly advantage. And for nearly the same price you can get 2 of those chip standalone. Also note SD card survives much less writes (depends on wear leveling but if you need to save only a few bytes but frequently you may wear it out quickly).
@larryd,
Thanks for writing!
I think you are saying that if you are logging infrequently, it minimizes reads/writes. So the use case might be if you wanted to store values for a day/week and then download in bulk? Or should we just treat read/writes the same as with micro/sd cards and not try to conserve them?
I guess I'm still missing the use case in the example that made EEPROM the solution. With MicroSD cards with 32GB storage dirt cheap, I guess I was just trying to discover when the EEPROMs would be the better solution.
Sorry to be daft.
larryd:
The Arduino has limited SRAM UNO ~2K.
You could use it instead of an SD card to store readings etc.See here for an example:
GitHub - JChristensen/aaLogger_SW: Code for the Double-A DataLogger - A low-power Arduino-based data logger..
Advantages of EEPROM over SD cards:
Cost - they are cheaper then SD card (if you have MCU without internal EEPROM you can get small EEPROM for a few cents).
Space - it is just one chip, ready to solder. You need adapter for SD card.
Interface - there are no I2C SD cards.
Energy - EEPROMS are from 1.8 to 5V while SD card wants 3V3. Also peak current for SD card is 100 mA vs <10 mA of EEPROM.
Program memory and RAM requirements - it looks like all common SD libraries use huge amount of memory. You need very little to interface EEPROM.
Reliability - both devices have limited number of writes. For EEPROM it is known amount of write/erase cycles. For SD card the number is much less and unknown (I never managed to find it). On the other side there is logic doing wear leveling and all that stuff inside the SD card. For me it is impossible to say when SD card fail. But AFAIK there is risk of sudden failure and loss of all data without any warning.
I don't want to say SD card is bad. It is much more powerful but there is also increase of cost (both money and resources). Sometimes you may be unwilling/unable to pay the difference.
One more: vibration.
If you are in a high vibration environment, the SD card can shake out of its slot. A soldered EEPROM chip can't fall out.
For most Arduinos that aren't being used within 10ft of a Mythbusters experiment, an SD card is best.
holesflow:
Experts,I see very affordable EEPROM expansion modules like the AT24C256 (cheap here), and with limited reads/writes, I'm curious what kind of scenario(s) would warrant one?
TIA!
physically small. A surface mount 8UDFN package is only 2mm x 3mm in size.
so, 64kB of storage with 1,000,000 write cycles and 200 years of storage costs $1.50.
I wrote a little fat file systems that uses I2C EEPROMs for configuration and management html files for a MEGA2560 webserver. By storing my management HTML files onboard, my device is usable when the sdCard is ejected, or a blank one is inserted.
Chuck.
"I wrote a little fat file systems that uses I2C EEPROMs "
Now you mentioned it, now you have to share it. ![]()
larryd:
"I wrote a little fat file systems that uses I2C EEPROMs "
Now you mentioned it, now you have to share it.
Here is a taste of it, just a .h ![]()
I have not turned it into an object, and am still modifying it to handle SPI FLASH/Ram chips. The SPI FLASH devices have a 4kB erase page size. So, managing a FAT table, directory structure with a 4kB erase whenever a '0' bit needs to become a '1' is a little challenging.
I am leaning towards using 0's as "deleted" markers and having periodic garbage collection cycles to recover erased/deleted entries. currently my FAT routines use the highest bit of each entry as an 'inuse' flag and never truncate a FAT chain. This means that Truncating a file does not free up the data clusters. When a file is deleted, the FAT chain persists. The next created file will reuse prior deleted FAT chain.
Free space exhaustion is a real concern. I have used 24LC32's (4kB) 8bit FAT, 16byte sectors, 64byte clusters. with the FAT table and BootRecord, there is only ~60 available clusters. With a 24LC256 (64kB), 12bit FAT 64byte sectors, 256byte Clusters ~ 252 available clusters.
I have SdFat integrated into tinyFS. There is one file space. each volume is append to the root volume '/'. when a volume is mounted, it is appended to a linked list of volumes. the Volume name is supplied when it is mounted, along with the hardware address, hardware support layer.
bool mountI2CDomain(const uint8_t i2cAddr,const uint32_t bootRecordOffset, const char name[], uint32_t (*unixTime)(void)){
// name[] included the final slash '/eeprom/53/'
bool mountSDDomain(const uint8_t CSPin,const char name[], void(*tD)(uint16_t *date, uint16_t *time)){
// name[] included the final slash '/sdcard/'
So, a file on a EEPROM that was mounted with:
bool success =mountI2CDomain(0x56,0,"/eeprom/56/",&unixTime);
would be opened with
int16_t handle =openFile("/eeprom/56/filename",0);
It is not smooth enough that I want to support it. I would be embarrassed to allow the public to view it. ![]()
And, I do not know if I could condense it enough to run on a UNO.
Chuck.
tinyFS.h (10.5 KB)
A more basic info:
http://www.hobbytronics.co.uk/arduino-external-eeprom
I am now learning how to use external eeprom.
====
After having difficult time with SD. I eventually downgraded to old 2GB SD which does work. I still cant figure out why I could not properly format a 32 GB microSD. But this is a different story. Definitely a bad experience.
I am extremely impressed by the insight you all have about this topic! So much now for me to consider and research...
Thank you to @falexandru, @chucktodd, @larryd, @MorganS, @Smajdalf (very thorough comparison!), and @AWOL for taking the time to add your wisdom to this great forum archive.
pat
![]()