QSPI stands for Quad Serial Peripheral Interface. It is a variant of SPI that moves data over four bidirectional data lines (IO0–IO3) instead of one, so it transfers four bits per clock cycle. QSPI is the common interface for NOR flash memory that holds firmware, boot code, configuration data, and application code. "Quad" describes how many lines a transaction phase uses; it is not a single switch that makes every phase four bits wide.
How Quad SPI turns four wires into faster flash reads
On standard SPI, data transfers one bit per clock cycle. During a quad data phase, Quad SPI can transfer four bits per clock cycle. At a 40 MHz clock, that distinction is 40 Mbit/s, or 5 MB/s, for standard SPI versus 160 Mbit/s, or 20 MB/s, for QSPI.
The benefit is easiest to see with one byte. In a standard SPI data phase, eight clock cycles deliver eight bits. In a 1-1-4 read, the flash returns four bits on each clock across four data lines, so the byte takes two cycles. Because command and address overhead still exist, the selected read command matters as much as the bus name.
In single-transfer-rate mode, typical QSPI NOR flash devices operate at 104–133 MHz and can provide sequential reads of about 50–80 MB/s. Those devices do not send and receive at the same time; the four lines make a transfer wider, not full-duplex.
The six signals that make a Quad SPI interface work
In quad mode, a QSPI interface uses six pins: four data lines, IO0 through IO3, plus CLK and CS#. CLK supplies the clock. CS# selects the flash device and must remain low throughout the command sequence; after the final data bit, it returns high to finish the command.
The standard SPI lines MOSI and MISO become bidirectional IO0 and IO1. The additional lines, IO2 and IO3, come from the flash device’s former WP# (write-protect) and HOLD# pins. Once quad operation is enabled, those two pins are data pins, so write-protect and hold are no longer available in their original roles.
Most QSPI NOR parts run from a 2.7–3.6 V supply, although 1.65–1.95 V variants also exist. At board level, match the chosen flash device rather than assuming that every QSPI part has the same I/O supply.
Read modes show exactly where the four data lines apply
In x-y-z notation, the three figures give the number of lines used in the instruction, address, and data phases, in that order. Dummy cycles are not included; they are specified separately as clock cycles. Each supported combination is a distinct opcode in the device command set, not a controller setting that can be applied to any command.
| Mode | Instruction | Address | Data | Example |
|---|---|---|---|---|
| 1-1-1 | 1 line | 1 line | 1 line | Classic SPI |
| 1-1-2 | 1 line | 1 line | 2 lines | Dual SPI, Dual Output read |
| 1-1-4 | 1 line | 1 line | 4 lines | Quad Output, opcode 0x6B |
| 1-4-4 | 1 line | 4 lines | 4 lines | Quad I/O, opcode 0xEB |
| 4-4-4 | 4 lines | 4 lines | 4 lines | QPI mode |
In a 1-1-4 read, the controller sends the command and address on IO0, then reads data on IO0–IO3. In 1-4-4, the command remains on one line but both address and data use four. Before using either, check the flash datasheet: support belongs to the command set, and not every flash chip supports every format.
Dummy cycles give QSPI flash time to return data
A QSPI read sequence can contain an 8-bit instruction, a 24- or 32-bit address, optional alternate bytes, dummy cycles, and a data phase. The dummy cycles follow the address. They give the NOR flash time to read its memory array and give the bidirectional IO lines time to turn around from the sending direction to the receiving direction.
During that phase, neither the controller nor the flash device drives the data lines: they are high impedance. Dummy cycles are real clock cycles, not an idle pause: a controller that stops the clock instead receives no data. At a higher clock frequency, a fixed array access time occupies more cycles, so the required dummy-cycle count can increase.
Quad I/O read example
Instruction: 0xEB, 8 bits
Address: 24 bits on 4 lines
Dummy: 4 clock cycles
Data: 4 lines
CS#: low through the last data bit
For example, a Winbond W25Q128 is typically set up with four dummy cycles for its 0xEB Quad I/O command at 80 MHz and six at 100 MHz, while a Micron MT25QL512 defaults to ten dummy cycles in 1-4-4 mode. Those values are device- and command-specific; take them from the datasheet instead of copying them from another QSPI flash device.
Set Quad Enable before treating WP# and HOLD# as data
Quad Enable, or QE, is a nonvolatile, readable and writable bit in a NOR flash status register. Normally factory-set to 0, it must be 1 before quad operations. Its location depends on the family: on Winbond W25Q devices it is bit 1 of Status Register 2, while Macronix MX25 devices use bit 6 of Status Register 1.
Write the bit with the standard SPI Write Status Register command. A boot ROM that issues only read commands cannot set it, so QE has to be programmed before such a system boots from the flash in quad mode. On some devices, QE ships already set, but that is a device-specific condition, not a safe general assumption.
Before enabling it, check the PCB. If WP# or HOLD# has been tied directly to supply or ground for standard SPI or Dual SPI, setting QE changes that pin into IO2 or IO3 and can create a short circuit.
QSPI and QPI use four lines differently
QSPI is the broad name for quad-capable SPI flash operation, while QPI (Quad Peripheral Interface) is one specific 4-4-4 mode. In QSPI, the command opcode is sent on IO0; the address and data can use four lines. By contrast, QPI uses four lines for instruction, address, and data. In that mode, the 0xEB opcode transfers in two clock cycles rather than eight.
To enter QPI, enable QE first and then send the Enter QPI command, which is 0x38 on many devices; some families use a different opcode or a configuration register bit instead. Once in QPI, the device accepts only 4-4-4 commands; 1-1-1, 1-1-4, and 1-4-4 commands are no longer understood. QPI support is not universal across NOR flash families, and QSPI controllers that support QPI are less common than controllers intended for 1-1-4 and 1-4-4.
After a power loss, corrupted registers can leave a device unexpectedly in QPI, after which it appears unresponsive to SPI or QSPI commands. Before a design relies on QPI, verify recovery behavior in the flash and controller datasheets.
Execute in place maps external flash into the MCU address space
With execute in place (XIP), a CPU runs code directly from external NOR flash instead of copying it to RAM first. In memory-mapped mode, the QSPI controller exposes the flash in the microcontroller’s address space, making it accessible like internal memory. On STM32, that mapping begins at 0x9000 0000.
A prefetch buffer in the controller can fetch upcoming bytes in advance and reduce latency for sequential reads. Continuous-read mode, also called 0-4-4, lowers the overhead of repeated accesses further: after the first command, the controller sends only the address rather than another command opcode.
Simply having QSPI flash does not make XIP automatic. The host controller must support memory-mapped access, and the flash must have enough read speed for the code being executed.
Common QSPI myths lead to configuration and board failures
- "Quad means everything uses four lines." A 1-1-4 command has a four-line data phase only; its command and address each stay on one line.
- "QSPI and QPI are interchangeable names." QPI is specifically 4-4-4 and rejects the common QSPI command formats once enabled.
- "Dummy cycles are optional delay." They are clocked protocol phases required for array access and bus turnaround.
- "A quad-capable flash is enough." The controller, flash command set, QE state, wiring, and dummy-cycle configuration must all agree.
Layout and signal integrity notes for QSPI
At QSPI clock rates, the PCB is part of the interface. Keep the flash chip close to the controller: a total trace length under 25 mm is a reliable target, and 10–15 mm above 100 MHz. Match the IO0–IO3 traces to CLK; vendor guidelines call for less than 50 ps of skew, which is roughly 8.5 mm of length difference on FR4.
- Route CLK as short as possible and without serpentines, which add crosstalk within the trace.
- Place a 22–33 Ω series resistor at the CLK driver from about 50 MHz upward or when the trace is longer than 10 mm.
- Use 4.7–10 kΩ pull-ups on CS#, and on IO2 (WP#) and IO3 (HOLD#) when they are not driven in quad mode, to avoid undefined states.
- Above 80 MHz, plan for a loopback clock or data strobe path in the controller to compensate for round-trip delay.
Octal SPI and xSPI are the faster successors
The JEDEC standard JESD251, called xSPI (eXpanded Serial Peripheral Interface), extends the idea to eight data lines. Octal SPI NOR flash reaches up to 400 MB/s sequential read at 200 MHz with double transfer rate, about five times a typical QSPI NOR device. xSPI devices add a dedicated data strobe pin for timing at these speeds, which QSPI does not have, and most run at 1.8 V I/O. A microcontroller with a plain QSPI controller cannot drive an octal flash in octal mode; it needs an octal or xSPI controller.
Frequently Asked Questions
What is a quad SPI?
Quad SPI is an extension of SPI with four data lines, used primarily with NOR flash. In common usage, QSPI and Quad SPI are equivalent names for the same four-line SPI variant.
What does QSPI stand for?
QSPI stands for Quad Serial Peripheral Interface. It expands SPI data transfers from one line to four data lines, IO0 through IO3, where the selected command supports them.
What are the benefits of using Quad SPI?
Four bits per clock cycle give up to four times the data throughput of standard SPI at the same clock, with only six pins. That is fast enough to read or execute firmware directly from external flash, with far fewer pins than a parallel NOR interface.
What are dummy cycles in QSPI, and why are they used?
Dummy cycles are clock cycles between the address and data phases during which neither side drives the data lines. They give the flash time to access its memory array and give the bidirectional lines time to switch direction.
What are the four SPI modes?
The four SPI modes, 0 through 3, are timing modes defined by clock polarity (CPOL) and clock phase (CPHA): mode 0 is CPOL 0/CPHA 0, mode 1 is CPOL 0/CPHA 1, mode 2 is CPOL 1/CPHA 0, and mode 3 is CPOL 1/CPHA 1. They are separate from the bus-width formats such as 1-1-4 and 1-4-4. Most SPI flash devices accept modes 0 and 3; check the datasheet for the timing mode as well as the read opcode.
Is SPI better than I2C?
Neither interface is better for every application. SPI is faster because it has no address, ACK, or Start/Stop overhead and its clock is not limited by pull-up resistors: SPI readily runs at 10–50 MHz and beyond, while I2C tops out at 3.4 Mbit/s in High-speed mode. I2C needs only two lines, SCL and SDA, for any number of devices, while SPI needs three lines plus one chip-select line per peripheral.
How does Quad SPI communicate with flash memory?
The controller holds CS# low, sends an opcode and address using the lane widths required by that command, supplies any needed dummy cycles, then transfers data. For example, a 1-1-4 read sends the command and address on one line and receives the data on four.
What is execute-in-place mode in QSPI?
In XIP mode, the CPU executes code directly from external NOR flash without first copying it to RAM. This requires a memory-mapped-capable host controller and flash read performance suitable for the code.

