Main Content

Simple DataFlash Board

This is a small board that plugs into one of the headers on an Arduino Uno or other board to provide 4Mbytes of non-volatile storage

It works with either 5V or 3.3V boards, and is based on the low-cost 4Mbyte Winbond W25Q32FVSIG DataFlash chip. It is ideal for applications such as data logging, playing audio samples, and storing text.

I also describe a simple DataFlash library to interface to the board.

Introduction
A DataFlash chip is a simple and low cost way to add non-volatile storage to a microcontroller; chips offering 4Mbytes of storage are available for under 20 pence/cents each from AliExpress or eBay.

The downside of using DataFlash chips for non-volatile storage is that the smallest area you can erase is a 4Kbyte sector. If you want to provide the ability to change a single byte at an arbitrary address you have to copy the previous contents of the sector to RAM, or elsewhere on the DataFlash, erase the 4Kbyte sector containing the byte, update the sector copy, and then restore the sector to the DataFlash.

This Simple DataFlash Library avoids the need for temporary storage by having the following restrictions:

When writing, you have to erase the entire DataFlash, and then write successive bytes from the start of the memory.
When reading you can read successive bytes from any starting position.
This treats the DataFlash much like a sequential file, which is ideal for applications such as datalogging, creating a text database, or saving audio samples. For example, with a 4Mbyte DataFlash chip you could:

Log the temperature every second for 46 days.
Store and read back 2000 pages of text or four novels.
Store and play back 12 minutes of digitised speech.
The Winbond DataFlash chips have a life of over 100,000 erase/program cycles.”

Link to article