10
\$\begingroup\$

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?

\$\endgroup\$
16
  • 5
    \$\begingroup\$ @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. \$\endgroup\$
    – GodJihyo
    Jan 9 at 5:48
  • 4
    \$\begingroup\$ @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. \$\endgroup\$
    – Hearth
    Jan 9 at 5:52
  • 2
    \$\begingroup\$ @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.. \$\endgroup\$
    – Kyle B
    Jan 9 at 6:22
  • 6
    \$\begingroup\$ 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. \$\endgroup\$
    – jonk
    Jan 9 at 7:01
  • 3
    \$\begingroup\$ @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 \$\endgroup\$
    – Kyle B
    Jan 9 at 7:36
30
\$\begingroup\$

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.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ 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. \$\endgroup\$ Jan 10 at 15:36
  • 1
    \$\begingroup\$ +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. \$\endgroup\$
    – K_Trenholm
    Jan 11 at 19:36
28
\$\begingroup\$

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)

\$\endgroup\$
2
  • 5
    \$\begingroup\$ 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. \$\endgroup\$
    – NStorm
    Jan 10 at 11:48
  • 1
    \$\begingroup\$ @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. \$\endgroup\$
    – mbrig
    Jan 12 at 16:53
25
\$\begingroup\$

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.

\$\endgroup\$
3
  • 7
    \$\begingroup\$ 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. \$\endgroup\$
    – Eric
    Jan 10 at 12:01
  • 6
    \$\begingroup\$ @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. \$\endgroup\$ Jan 10 at 12:19
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Eric
    Jan 10 at 22:09
15
\$\begingroup\$

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.

\$\endgroup\$
3
  • 7
    \$\begingroup\$ 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. \$\endgroup\$ Jan 10 at 15:47
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – AndreKR
    Jan 11 at 18:29
  • \$\begingroup\$ @AndreKR Most specialty memories aren't available as modules. Digikey and Mouser carry multiple chips but semiconductor shortage. \$\endgroup\$
    – DKNguyen
    Jan 11 at 19:17
4
\$\begingroup\$

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.

\$\endgroup\$
5
  • \$\begingroup\$ 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. \$\endgroup\$
    – tobalt
    Jan 9 at 7:55
  • \$\begingroup\$ Tony, where do you store the pointer value? I've often tried to think of s scheme that would be reliable. \$\endgroup\$
    – Transistor
    Jan 9 at 9:03
  • 1
    \$\begingroup\$ 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 \$\endgroup\$
    – Jasen
    Jan 9 at 11:05
  • \$\begingroup\$ 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. \$\endgroup\$
    – Michael
    Jan 10 at 8:20
  • \$\begingroup\$ 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 \$\endgroup\$ Jan 10 at 9:24
4
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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).

\$\endgroup\$
1
  • \$\begingroup\$ Didn't know about these. Very interesting devices! Could replace MRAM at places with strong magnetic fields. \$\endgroup\$
    – Ariser
    Jan 11 at 15:11
1
\$\begingroup\$

How about SD / micro-SD?

I don't claim it's super reliable—unless you've got one with wear leveling, which not all SD cards have—but it is fairly cheap, and SD cards and SD card modules are readily available. (Here I'm assuming this is a dupont-cables project, not a custom-PCB project.)

To get around the probable lack of wear leveling, I'd probably just fill up the card with newer and newer 10kB files, then wipe it and start again.

Possible caveat: I've heard writes are slow.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Speed usually isn't a concern when you only have to write 10 kB. I believe the main problem with SD cards is the complexity of the protocol, which means you either keep things simple and accept that sometimes your writes just fail, or you handle all the possible response codes from the card and suddenly your code is not that simple and you have no idea how much time a write might take in the worst case. \$\endgroup\$ Jan 10 at 12:34
1
\$\begingroup\$

You don't say anything about what you plan to use as the heart of your platform. Considering you are talking about storing/retrieving data in the kB range, I assume you would be using a microcontroller. Nowadays microcontrollers come with hundreds of kB or even MB of on-chip flash, which could be exactly what you need. Some advantages of on-chip flash are: low latency, low power requirements (useful when you detect power going down and only have a few hundred joules left in a capacitor), easy interfacing.

The downside is that it will require a bit of effort setting up a software scheme to account for large-ish (often 1kB) page size, which can only be erased at block level. If you are comfortable writing embedded software, this would not be too hard though.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.