W25Qxx

From Stm32World Wiki
Jump to navigation Jump to search

The W25Qxx is a common series of serial EEPROM chips.

Naming

These EEPROM chips are typically named "x25qxxx" where the first x indicates the manufacturer ("W" indicates Winbond) and the xxx after the Q indicates the size (in Mbits). A "W25Q128" is therefore 128 Mbits = 16 mB EEPROM manufactured by Winbond.

NOR Flash

The W25Qxx devices are so-called NOR Flash devices. Without going into details on how this works electrically from a usage point of view it means that in a fully erased device, all bits are set to 1. Programming simply flips certain bits from 1 to 0.

Connections

W25Qxx devices are available in a number of different packages, but the most common is a SOIC-8 package. These will typically have the following pinout:

W25Q128 SOIC-8 Pinout.png

It is worth noticing that many (if not all) of these devices can operate in two different "modes". Regular SPI with a MOSI/MISO pair of signals, and Quad-SPI where 4 data lines are being used.

Memory Layout

The memory in these devices are divided into blocks, sectors and pages.

In the case of the W25Q128, each device is organized into 65536 pages of 256 byte each. Pages are grouped into sectors with each sector containing 16 pages giving a total of 4 kB.

Blocks

At the highest level is the "block". Blocks will typically be chunks of 64kB. In the case of the W25Q128 it will look like this:

W25Q128 Blocks.png

A block can be "erased" by a single command.

Sectors

Each block is divided into a number of sectors. In the W25Q128 each sector contains 4kB:

W25Q128 Block Segmentation.png

A sector can be erased by a single command and it is the smallest "unit" which can be erased. In other words, before writing any byte, the entire sector in which that byte resides will have to be erased.

Pages

A page is the largest area which can be programmed using one command. On the W25Q128 each page is 256 bytes meaning each sector contains 16 pages.

Miscellaneous Links