SIMPLE DATAFLASH BOARD PLUGS INTO AN ARDUINO TO PROVIDE 4MBYTES OF EEPROM

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.

The circuit

Here’s the circuit of the Simple DataFlash board:

I based it on the low-cost 4Mbyte Winbond W25Q32FVSIG DataFlash chip [1], but it should also be compatible with any 25-Series DataFlash chip, such as the 8Mbyte W25Q64 or the 16Mbyte W25Q128.

The DataFlash board includes a regulator, to provide the 3.3V that the DataFlash chip needs, and logic level converters on the CS, MOSI, and SCK inputs, to make it suitable for use with both 3.3V and 5V microcontroller boards.

Construction

The circuit fits on a board 16.5 mm square which I designed in Eagle and sent to PCBWay for fabrication [2]. I chose a green PCB to match the Arduino Uno. There’s a link to the Eagle files at the end of the article if you want to make yourself a board.

The edge connector is designed to plug straight into the standard header on a microcontroller board, such as the Arduino Uno, with the GND pin plugged into the GND pin on the top row of edge connectors:

Read more: SIMPLE DATAFLASH BOARD PLUGS INTO AN ARDUINO TO PROVIDE 4MBYTES OF EEPROM


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top