# Best way to store very small amount of data?

I'm building a side project at the moment and I want to be able to store and retrieve a very small amount of data (10 kB tops). If the power is disconnected I want to be able to retain the data. I know about EEPROM, however, I noticed there are limits to how much you can update EEPROM's data. I would love to have HDD/SSD that just stores 10 kB of data but I can't find that on the market. What would you recommend I do if I want to be able to just store 10kB of data? I would hate to spend extra money buying a ton of storage space I won't use. I need to be able to update data multiple times a hour so I expect EEPROM to become useless (I'm new to this stuff, so not a 100% sure).

Do you know of any places where I can get a HDD/SDD with only 10 kB of data?

• @KyleB Microchip makes 16 byte EEPROMS. A quick search of one of the major parts vendors turns up over 2000 results for memory chips 16K and under in active production, so there must be a market for them. Jan 9 at 5:48
• @KyleB Actually, they're quite readily available. In fact, Digikey lists parts as small as 16 bytes, if you really needed that for some reason. Jan 9 at 5:52
• @Hearth He asked specifically where to get HDD/SDD in 10kB size. That's what I was referencing. You're not wrong, and I could have been specific.. Jan 9 at 6:22
• Well, back in the day we had core. Great stuff. All this discussion brings me back to that. Unfortunately (for those like me who reminisce at times), I don't believe anyone is sintering cores with the right B-H curve anymore.
– jonk
Jan 9 at 7:01
• @jonk Not sure I'd admit being old enough to remember working with core. Heck I hate saying to say I'm old enough to know what it is LOL Jan 9 at 7:36

Personally I use FRAM, it is easy to use and you can get 32K by 8 for a few dollars. It works like the EEPROM modules but there is no delay or limits on reads and writes. These can be purchased on Arduino modules about 3/4" by 1.25" in 3.3 and 5V.

Per the Cypres data sheet: "The CY15X102QN is capable of supporting 10^15 read/write cycles, or 1000 million times more write cycles than EEPROM." Check the data sheet, There is a lot more information that does not agree with Wikipedia.

• You mean en.wikipedia.org/wiki/Ferroelectric_RAM ? Interesting, wikipedia cites a write endurance of 10^10 to 10^14 cycles. (That has to include reads, because apparently reads are destructive.) So yeah, sounds good for this use-case. Jan 10 at 15:36
• +1 for using an FRAM. I've been using a few of the Cypress FRAM parts and they've been lovely to use. Beats using a traditional EEPROM in many use cases. Jan 11 at 19:36

I need to be able to update data multiple times a hour so I expect EEPROM to become useless

Actually... this is not 100% true.

Check your EEPROM datasheet. For a very basic and common EEPROM (for instance I checked the Microchip 24LC256) you have at least 1 million write/erase cycles.

If you write ten times an hour 24/7 you will have 10 * 24 * 365 writes a year, reaching 1 million writes in about 11 years and a half.

What if you want to extend it? Well, you cycle through different areas of the memory. For instance you take a 1Mbit (125kB) memory, and cycle through 12 different zones. You use the first byte of the zone as a write counter (so you know where you stored the last value and where to store the next one), and then obtain at least 132 year of writings.

So basically if you write at most once per minute EEPROMs will last a lifetime. If you want longer storage you can switch technology (e.g. FRAM, as others suggested, or FLASH, which have lower write count but a huge amount of memory, so you can cycle through multiple zones), or you can switch algorithm (for instance save everything in RAM and then dump to permanent memory once every hour or at turn off, if you have a reliable way to quickly dump everything before shutdown)

• I second this. 1Mbit EEPROM currently costs < $1 even in small quantities and have great availability. FRAM still have limited writes. MRAM costs >=$2 for cheapest part atm and availability are under questions depending on area. Jan 10 at 11:48
• @NStorm FRAM has high enough endurance as to be effectively unlimited. If you were writing a single byte continuously on the CY15X102QN (that Gil mentioned in his answer) as fast at the protocol + 50MHz SPI will let you, it would take 25 years to reach the limit. Jan 12 at 16:53

Just pick a bigger EEPROM, and write it sequentially.

Suppose you have a EEPROM family which withstands 10000 write/erase cycles, and you need 100 times more. Then pick a 1 MB EEPROM form the same family, and every time you need to write, use the next unused 10 KB instead of erasing the whole chip. Only erase once the whole 1 MB is full. You'll end up with one erase cycle every 100 writes.

This approach comes with the added benefit of recovery from an older data copy, shall your latest data become corrupt.

Also note that the small number of write/erase cycles is typically specified together with a long data retention time (e.g. 10 years). If you overwrite the data at least monthly, that 10000-cycles EEPROM may actually support 100000 writes.

• This is the standard approach for doing wear leveling on write-limited devices, but comes at the cost of additional software complexity and/or having to scan the memory device to find the latest block. The erase is often the cause of the wear, so you can also get clever by writing to the same byte multiple times if you are only changing single bits from 1 to 0. Just note that some devices erase by first draining cells to 0, so be careful about using all 0's as something you did since it could have been an erase interrupted by a power failure.
– Eric
Jan 10 at 12:01
• @Eric Sure. I would add that most of such complexity comes from clever features, such as writing multiple times without erasing, recovery from a power failure, or supporting blocks of different sizes. Simple wear-leveling with a fixed-size block is pretty easy. Jan 10 at 12:19
• agreed -- only add the complexity if it is required. The OP's use case is for power-off, so it may be that power failure handling is required.
– Eric
Jan 10 at 22:09

Use MRAM which is basically an EEPROM of a different technology. Unlimited writes.

There is also FRAM which has nearly unlimited writes. Something on the order of a trillion writes I think. Not infinite, but you could write 1000 times per second for 32 years. EDIT: It has been brought to my attention that FRAM also has destructive reads so reads and writes has to be counted into the endurance. Still, on the order of a trillion is a lot. It's actually more I just don't know how many trillions off the top of my head.

A mechanical HDD is about the only other thing with unlimited writes but big and heavy and mechanical.

SSDs violate your criteria for unlimited endurance. SSDs are just flash memory and have even less endurance than an EEPROM.

And both mechanical HDDs and SSDs are serious design effort to implement since most are made to interface with a PC motherboard through an operating system.

• According to en.wikipedia.org/wiki/Ferroelectric_RAM, FRAM has destructive reads, so its write endurance is actually total accesses, including reads. One could imagine use-cases where that'd be a problem if you weren't aware of it. Jan 10 at 15:47
• This piqued my interest, but I can only find this one IC by Everspin which is pretty expensive and not commonly available as a module. It kind of outweighs the advantages for me. Jan 11 at 18:29
• @AndreKR Most specialty memories aren't available as modules. Digikey and Mouser carry multiple chips but semiconductor shortage. Jan 11 at 19:17

For this you would want low power flash with low voltage so that you have time to detect a failure and store RAM data before DC OK you create, goes low.

.e.g. used on IOT solutions https://www.macronix.com/en-us/products/NOR-Flash/Pages/Ultra-Low-Power-Flash.aspx

0.5 MB flash is going obsolete is only \$0.65 so consider 1MB

You would never need to worry about write cycles with an incremental pointer to use all the memory on write cycles.

• This way you will also have access to previous power down state, should a write fail.. Endurance is probably higher than you would ever need. Jan 9 at 7:55
• Tony, where do you store the pointer value? I've often tried to think of s scheme that would be reliable. Jan 9 at 9:03
• store the pointer as an inverted thermometer code (ie unary) in the first sector and only perform single bit writes to that sector (with no interveining erases), or store an expiry mark on expired data Jan 9 at 11:05
• Wouldn’t you need some big capacitors (supercapacitors?) to provide enough energy for writing data to flash? Sure, writing a few bytes won’t take long, but draws quite some current. Jan 10 at 8:20
• You could always use an AAA cell with a Sh. diode ... with a 10yr shelf life that has far more kF. LDO may be high Z Jan 10 at 9:24

I highly recommend Microchip's EERAM, specifically for your application the 47L64 . It has SRAM and non-volatile memory and is designed for data retention on power loss. You just write to the memory and if the power is removed it writes all the data to the non-volatile memory. All it needs is a bulk capacitor. I use them extensively across all my designs where non-volatile memory is needed.

Use non-volatile SRAM ([and also see this] (https://www.infineon.com/cms/en/product/memories/nvsram-non-volatile-sram/)) if you really need infinite endurance and write cycles.

If you want a more established technology and your product doesn't need to last decades, you can use BBSRAM (Battery-Backed SRAM).

• Didn't know about these. Very interesting devices! Could replace MRAM at places with strong magnetic fields. Jan 11 at 15:11