SPI implementations have a wide variety of protocol variations. Some devices are transmit-only; others are receive-only. Slave selects are sometimes active-high rather than active-low. Some devices send the least-significant bit first. Signal levels depend entirely on the chips involved. And while the baseline SPI protocol has no command codes, every device may define its own protocol of command codes. Some variations are minor or informal, while others have an official defining document and may be considered to be separate but related protocols.
Original definition Motorola in 1983 listed three
6805 8-bit
microcomputers that have an integrated "Serial Peripheral Interface", whose functionality is described in a 1984 manual.
AN991 Motorola's 1987 Application Node AN991 "Using the Serial Peripheral Interface to Communicate Between Multiple Microcomputers" (now under
NXP, last revised 2002) informally serves as the "official" defining document for SPI.
Timing variations Some devices have timing variations from Motorola's CPOL/CPHA modes. Sending data from slave to master may use the opposite clock edge as master to slave. Devices often require extra clock idle time before the first clock or after the last one, or between a command and its response. Some devices have two clocks, one to read data, and another to transmit it into the device. Many of the read clocks run from the slave select line.
Transmission size Different transmission word sizes are common. Many SPI chips only support messages that are multiples of 8 bits. Such chips can not interoperate with the
JTAG or
SGPIO protocols, or any other protocol that requires messages that are not multiples of 8 bits.
No slave select Some devices do not use slave select, and instead manage protocol state machine entry/exit using other methods.
Connectors Anyone needing an external connector for SPI defines their own or uses another standard connection such as:
UEXT,
Pmod, various
JTAG connectors,
Secure Digital card socket, etc.
Flow control Some devices require an additional
flow control signal from slave to master, indicating when data is ready. This leads to a 5-wire protocol instead of the usual 4. Such a
ready or
enable signal is often active-low, and needs to be enabled at key points such as after commands or between words. Without such a signal, data transfer rates may need to be slowed down significantly, or protocols may need to have dummy bytes inserted, to accommodate the worst case for the slave response time. Examples include initiating an ADC conversion, addressing the right page of flash memory, and processing enough of a command that device firmware can load the first word of the response. (Many SPI masters do not support that signal directly, and instead rely on fixed delays.)
SafeSPI SafeSPI is an industry standard for SPI in automotive applications. Its main focus is the transmission of sensor data between different devices.
High reliability modifications In electrically noisy environments, since SPI has few signals, it can be economical to reduce the effects of
common mode noise by adapting SPI to use
low-voltage differential signaling. Another advantage is that the controlled devices can be designed to loop-back to test signal integrity.
Intelligent SPI controllers A
Queued Serial Peripheral Interface (
QSPI; different to but has same abbreviation as
Quad SPI described in ) is a type of SPI controller that uses a
data queue to transfer data across an SPI bus. It has a
wrap-around mode allowing continuous transfers to and from the queue with only intermittent attention from the CPU. Consequently, the peripherals appear to the CPU as
memory-mapped parallel devices. This feature is useful in applications such as control of an
A/D converter. Other programmable features in Queued SPI are chip selects and transfer length/delay. SPI controllers from different vendors support different feature sets; such
direct memory access (DMA) queues are not uncommon, although they may be associated with separate DMA engines rather than the SPI controller itself, such as used by
Multichannel Buffered Serial Port (
MCBSP). Most SPI master controllers integrate support for up to four slave selects, although some require slave selects to be managed separately through GPIO lines. Note that
Queued SPI is different from
Quad SPI, and some processors even confusingly allow a single "QSPI" interface to operate in either quad or queued mode!
Three-wire Three-wire variants of SPI restricted to a
half-duplex mode use a single bidirectional data line called SISO (slave out/slave in) or MOMI (master out/master in) instead of SPI's two unidirectional lines (MOSI and MISO). Three-wire tends to be used for lower-performance parts, such as small EEPROMs used only during system startup, certain sensors, and
Microwire. Few SPI controllers support this mode, although it can be easily
bit-banged in software.
Bit-width extensions Dual SPI For instances where the full-duplex nature of SPI is not used, an extension uses both data pins in a half-duplex configuration to send two bits per clock cycle. Typically a command byte is sent requesting a response in dual mode, after which the MOSI line becomes SIO0 (serial I/O 0) and carries even bits, while the MISO line becomes SIO1 and carries odd bits. Data is still transmitted most-significant bit first, but SIO1 carries bits 7, 5, 3 and 1 of each byte, while SIO0 carries bits 6, 4, 2 and 0. This is particularly popular among SPI ROMs, which have to send a large amount of data, and comes in two variants: • Dual read sends the command and address from the master in single mode, and returns the data in dual mode. • Dual I/O sends the command in single mode, then sends the address and return data in dual mode.
Quad SPI Quad SPI (
QSPI; different to but has same abbreviation as
Queued-SPI described in ) goes beyond dual SPI, adding two more I/O lines (SIO2 and SIO3) and sends 4 data bits per clock cycle. Again, it is requested by special commands, which enable quad mode after the command itself is sent in single mode. ; SQI Type 1: Commands sent on single line but addresses and data sent on four lines ; SQI Type 2: Commands and addresses sent on a single line but data sent/received on four lines
QPI/SQI Further extending quad SPI, some devices support a "quad everything" mode where
all communication takes place over 4 data lines, including commands. This is variously called "QPI" (not to be confused with
Intel QuickPath Interconnect) or "serial quad I/O" (SQI) This requires programming a configuration bit in the device and requires care after reset to establish communication.
Double data rate In addition to using multiple lines for I/O, some devices increase the transfer rate by using
double data rate transmission.
SGPIO SGPIO is essentially another (incompatible) application stack for SPI designed for particular backplane management activities. SGPIO uses 3-bit messages.
Intel's Enhanced Serial Peripheral Interface Intel has developed a successor to its
Low Pin Count (LPC) bus that it calls the
Enhanced Serial Peripheral Interface (
eSPI) bus. Intel aims to reduce the number of pins required on motherboards and increase throughput compared to LPC, reduce the working voltage to 1.8 volts to facilitate smaller chip manufacturing processes, allow eSPI peripherals to share SPI flash devices with the host (the LPC bus did not allow firmware hubs to be used by LPC peripherals), tunnel previous
out-of-band pins through eSPI, and allow system designers to trade off cost and performance. An eSPI bus can either be shared with SPI devices to save pins or be separate from an SPI bus to allow more performance, especially when eSPI devices need to use SPI flash devices. The eSPI bus is also adopted by
AMD Ryzen chipsets. == Interoperability with other standards ==