W25Qxx
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:
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.
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:
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:
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.