Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

store data in a dataflash

Not open for further replies.


Advanced Member level 4
Jan 20, 2002
Reaction score
Trophy points
Activity points
i would like to store some working structure in flash. The main reason is to recover it in case of power failure. having a dataflash in the system, i don´t now if this is reliable due to undurance of dataflash. i mean, can i store data in flash like the system RAM or not?, maybe i must wait to the power failure and then with the aid of an external batterie, store all the information in flash?


Read/Write speed of flash memory is much slower than RAM. If your application doesn't require such a high data speed than you can use the flash memory as a system RAM but if it does then you can think of different approaches.

1) the way you suggested (after power failure, store the data by aid of external battery.
2) periodically store the data into flash memory (you may lose the latest data you didn't back up)
3) store the data into a flash memory and use RAM as a cash/buffer (still you need to store the latest data after power failure like method 1))
depnds on your application....

hi all,

My problem is not speed, the main problem i have is that i have to store a data structure of about 100 bytes. When an external event occurs i have to update the structure in RAM and then store a backup in flash due to have the chance to recover the original state of the event in case of power failure. This is the problem because the event's change is impredictible and can occur as many times as it wants. So if i store in flash each time event occur, i'll always be writen in the same position, same page of the flash, so i think the the life due to endurance of the flash could be very low. i know pen drives uses this kind of memories, but they can store many information since they store in free spaces of memory or voice recorders function the same way, store information consecutive until full memory is reached, but my problem is that i will always store the information in the same position of the flash. i don't know is this is reliable.


algilsan said:
but my problem is that i will always store the information in the same position of the flash. i don't know is this is reliable.

If flash write endurance is a serious concern then using a circular buffer in flash memory is a nice approach.
Even for systems that due to unexpected power failures are not able to identify the correct position in the circular buffer, it's a medicine for it.
Read more :
It's for writing of AVR EEPROM but ideeas are easily expanded to other flash as well.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to