Writing data to a sector of MMC card

Hi, I'm collecting and saving small amount of data (about 64 bytes) once per

5 minutes on MMC sector. I put my data into increment pointer in SRAM memory, but I can't wait to fill 512B buffer. I have to save my data (512B buffer) on each collected data due to power lost. If I fill 512B SRAM buffer - I use next MMC sector. I use SPI mode and sector data is set to 512 bytes. I need to investigate - how the MMC card internal controler writes my data to MMC NAND memory. Does it erase 512B NAND sector on each my write ? or just in case ?... hmmm. Every information will be priceless :)
--
Best regards
Pelos
Reply to
pelos
Loading thread data ...

An alternative solution may be to use an electrolytic cap with enough charge to quickly write the data to the card. Use an interrupt pin to detect power failure, and then flush the sector.

Reply to
Arlet

Actually your situation is even worse than this. Internally the NAND flash write block size is 528 bytes (usually), but the *erase* block size is larger than that by at least 4x, more likely 16x or even more on a large card.

If the data you are writing is truly critical, you need to have a strategy for protecting against power loss during write. And DO NOT issue multiple writes to a single sector every time you have one more byte to store.

Reply to
larwe

Or a super-cap or a rechargable battery, or even a simple lithium primary cell. If the circuit design is done right, the lithium cell could last for a decade.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

In agreement with that. We have used this method on our 7-Seg display boards. We have an interrupt pin monitoring the main supply +5v line. When it goes, we shut the display down and have LOADS of time to write data, in safe mS terms anyway.

Reply to
techie_alison

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.