13

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?

  • Could you just use the smallest/cheapest flash you can find and use that ? – tobalt Jan 09 '22 at 05:25
  • Such a thing has not existed for about 30 years. Maybe longer. You have no choice but to buy alot of storage you'll never use. That's all that is on the market. There's no market for 10k devices so no manufacturer is gonna do that. – Kyle B Jan 09 '22 at 05:28
  • 1
    You would also want sufficient Capacitor storage power and be able to detect power failure and DC operating range so that during decay, you have enough time to save the data in the buffer. With Voltage thresholds to detect this event and safe operating levels. – Tony Stewart EE75 Jan 09 '22 at 05:29
  • 5
    @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. – GodJihyo Jan 09 '22 at 05:48
  • 4
    @KyleB Actually, they're [quite readily available](https://www.digikey.com/en/products/filter/memory/774?s=N4IgjCBcpgLATFUBjKAzAhgGwM4FMAaEAeygG0R4BOBeADhAF0iAHAFyhAGU2AnASwB2AcxABfCUA). In fact, Digikey lists parts as small as *16 bytes*, if you really needed that for some reason. – Hearth Jan 09 '22 at 05:52
  • Remember that EEPROM typically has a write endurance of tens of thousands of writes--even at a few writes per hour, you wouldn't encounter problems for five or six months. And if you get a larger EEPROM than you need (this will only cost a few cents extra; EEPROMs are not remotely expensive in such small sizes), you can cycle between multiple locations and avoid writing to the same place too many times (this is called wear levelling, a very common practice in SSDs, which use the same type of memory with its limited writes). – Hearth Jan 09 '22 at 05:59
  • 2
    @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.. – Kyle B Jan 09 '22 at 06:22
  • Some two years ago I went to buy a 1 TB SSD. The shop keeper told me that 1T was no longer available, and 2T was cheaper than 1T a year ago. Same for 1/2/4/8 GB fingers. My approach is ask the shopkeeper for second/third cheapest which I think has the optimum price/performance ratio. – tlfong01 Jan 09 '22 at 06:44
  • 7
    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 09 '22 at 07:01
  • 3
    @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 – Kyle B Jan 09 '22 at 07:36
  • 1
    (1) Ah, you two old guys remind me of my sweet memories working as a young electronics engineer way back in late 70's. :) (2) Reference: Ampex Ferrotec (Magnetic Core Memory Systems) Limited Hongkong: https://www.hkmemory.hk/MHK/collections/postwar_industries/manufacturers/ampex_ferrotec/company_introduction/index.html – tlfong01 Jan 09 '22 at 08:11
  • 1
    core memory boards were a thing of beauty – jsotola Jan 09 '22 at 09:02
  • 1
    @KyleB I guess I'm long since past worrying about admissions like that. Not sure when or why that happened. I worked with dodgy drum memories for a while, too. (Some worked about half the time.) And of course magtapes figure largely in learning techniques to sort data on a single reel, for gosh sake. Stuff you'd find in Knuth's books in the early 70's that no one cares about anymore. I even worked for a short time with mercury circulating memories, though not seriously. Core was pretty much a dream memory then. Still is, in my mind. 1972 through 1975 were formative computing years for me. – jonk Jan 10 '22 at 08:48
  • @jonk: If you can't have ferromagnetic RAM, maybe https://en.wikipedia.org/wiki/Ferroelectric_RAM, as Gil's answer suggests? :P Not the same visual when it's hidden in a standard IC package, though. – Peter Cordes Jan 10 '22 at 15:39
  • If this is in a computer context, just get the smallest SSD you can find and let its wear levelling take care of things. At 10kb a minute it will still last for years. – pjc50 Jan 10 '22 at 15:55
  • @PeterCordes I've plenty of F(e)RAM here. I was an early adopter. I like it. But it doesn't hold the same place in my heart and it's not the same thing (besides being nowhere near as rad-hard.) – jonk Jan 11 '22 at 04:02

9 Answers9

31

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.

Gil
  • 4,951
  • 2
  • 12
  • 14
  • 3
    You mean https://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. – Peter Cordes Jan 10 '22 at 15:36
  • 1
    +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. – K_Trenholm Jan 11 '22 at 19:36
28

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)

frarugi87
  • 1,225
  • 1
  • 11
  • 18
  • 5
    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. – NStorm Jan 10 '22 at 11:48
  • 1
    @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. – mbrig Jan 12 '22 at 16:53
26

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.

Dmitry Grigoryev
  • 25,576
  • 5
  • 45
  • 106
  • 7
    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 '22 at 12:01
  • 6
    @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. – Dmitry Grigoryev Jan 10 '22 at 12:19
  • 1
    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 '22 at 22:09
15

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.

DKNguyen
  • 54,733
  • 4
  • 67
  • 153
  • 7
    According to https://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. – Peter Cordes Jan 10 '22 at 15:47
  • 1
    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. – AndreKR Jan 11 '22 at 18:29
  • @AndreKR Most specialty memories aren't available as modules. Digikey and Mouser carry multiple chips but semiconductor shortage. – DKNguyen Jan 11 '22 at 19:17
4

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.

Tony Stewart EE75
  • 1
  • 3
  • 54
  • 182
  • 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. – tobalt Jan 09 '22 at 07:55
  • Tony, where do you store the pointer value? I've often tried to think of s scheme that would be reliable. – Transistor Jan 09 '22 at 09:03
  • 1
    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 – Jasen Слава Україні Jan 09 '22 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. – Michael Jan 10 '22 at 08: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 – Tony Stewart EE75 Jan 10 '22 at 09:24
4

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.

3

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. – Ariser Jan 11 '22 at 15:11
1

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.

Mathieu K.
  • 287
  • 2
  • 9
  • 3
    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. – Dmitry Grigoryev Jan 10 '22 at 12:34
1

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.

Makotanist
  • 172
  • 7