Introduction
1413
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Serial Peripheral Interface (SPI)
29.1 Introduction
29.1.1 Purpose of the Peripheral
The SPI is a high-speed synchronous serial input/output port that allows a serial bit stream of programmed
length (2 to 16 bits) to be shifted into and out of the device at a programmed bit-transfer rate. The SPI is
normally used for communication between the device and external peripherals. Typical applications
include interface to external I/O or peripheral expansion via devices such as shift registers, display drivers,
SPI EPROMS and analog-to-digital converters.
29.1.2 Features
The SPI has the following features:
•
16-bit shift register
•
16-bit Receive buffer register (SPIBUF) and 16-bit Receive buffer emulation 'alias' register (SPIEMU)
•
16-bit Transmit data register (SPIDAT0) and 16-bit Transmit data and format selection register
(SPIDAT1)
•
8-bit baud clock generator
•
Serial clock (SPIx_CLK) I/O pin
•
Slave in, master out (SPIx_SIMO) I/O pin
•
Slave out, master in (SPIx_SOMI) I/O pin
•
SPI enable (SPIx_ENA) I/O pin (4-pin or 5-pin mode only)
•
Multiple slave chip select (SPIx_SCS[n]) I/O pins (4-pin or 5-pin mode only)
•
Programmable SPI clock frequency range
•
Programmable character length (2 to 16 bits)
•
Programmable clock phase (delay or no delay)
•
Programmable clock polarity (high or low)
•
Interrupt capability
•
DMA support (read/write synchronization events)
The SPI allows software to program the following options:
•
SPI pins as functional or digital I/O pins
•
SPI Master or Slave mode
•
SPIx_CLK frequency (SPI module clock/3 through SPI module clock/256)
•
3-pin, 4-pin, and 5-pin options
•
Character length (2 to 16 bits) and shift direction (MSB/LSB first)
•
Clock phase (delay or no delay) and polarity (high or low)
•
Delay between transmissions in master mode.
•
Chip select setup and hold times in master mode
•
Chip select hold in master mode