Flash Memory

Anti-goldfish memory.

πŸ›† Brief description

Flash memory is used in many of today's electronic devices: phones, computers and USB sticks all have it. It allows information to be stored for later use.

The memory used in this project is said to be non-volatile, which means that it retains stored data even if the power supply is cut. There is therefore no possibility of memory loss.


πŸ›† MX25R8035F

The MX25R8035F chip from Macronix is a low-power 8Mb NOR Flash memory. In practice, it can store up to 8,388,600 bits in memory. The memory has a lifetime of over 100,000 write cycles.

Every flash memory has its own identity. This identity is stored in all flash chips and can be retrieved by the user (via a special command) to verify the correct operation and integrity of the memory. The identity consists of the manufacturer ID (0xC2), the memory type (0x28) and its density (0x14).

MX25R8035F Chip ID - 0xC2 0x28 0x14

Memory organization

When it comes to programming, it's important to understand how flash memory works so that you can store information in it. To do this, let's analyse the structure of the memory.

Flash memory has a size of 8,388,600 bits or 1,048,575 bytes. The conversion is important because data is stored in bytes, which are packets of 8 bits.

One byte corresponds to 8 bits.

Memory can be viewed as 64KB or 32KB blocks, or as 4KB sectors, or as 256B pages. It is therefore possible to write and read memory by block, sector or page.

Memory is usually written and read in 256B pages. This is the method implemented in the project. But how many pages do we have? It's simple: if a page is 256B long and we have 1,048,575B available, then we have just under 4,096 pages available for data logging.

In an 8Mb (or 1MB) flash memory, there are 4,095.99 pages of 2,048b (or 256B).


πŸ›† Hardware Integration

Pin Configuration & Description

The MX25R8035F Flash memory is available in various package types: SOP, WSON, USON or WLCSP. For reasons of availability and ease of manufacture, I decided to use the 2x3mm USON version. This solution offers a miniature flash while leaving the pins more or less accessible for future debugging.

The available pins are listed in the table below:

Pin Number
Name
Description
1

CS#

Chip Select

5

SI / SIO0

Serial Data Input

2

SO / SIO1

Serial Data Output

6

SCLK

Clock Input

3

WP# / SIO2

Write protection Active Low

7

HOLD# / SIO3

RESET# / SIO3

To pause the device without deselecting the device.

Hardware Reset Pin. Active in LOW state.

Serial Data Input & Output

8

VCC

Power Supply

4

GND

Ground

Kicad - Rooting

The memory chip is wired according to the datasheet. Pins 3 and 7 are not connected as they are not used in the project. A decoupling capacitor and a pull-up resistor are added to ensure correct flash operation.


πŸ›† Documentation

Last updated