Architecture
1415
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Serial Peripheral Interface (SPI)
29.2 Architecture
This section describes the SPI operation modes. It gives an overview of SPI operation and then provides
details on the 3-pin, 4-pin, and 5-pin options, as well as more specific details on the supported data
formats.
29.2.1 Clock
The SPI clock (SPIx_CLK) is derived from the SPI module clock. The maximum clock bit rate supported is
SPI module clock/3, as determined by the PRESCALE field in the SPI data format register
n
(SPIFMT
n
).
The SPIx_CLK frequency is calculated as:
SPIx_CLK frequency = [SPI module clock] / [SPIFMT
n
.PR 1]
29.2.2 Signal Descriptions
shows the SPI pins used to interface to external devices.
(1)
The value
x
indicates the applicable SPI; that is, SPI0, SPI1, etc. See your device-specific data manual
to determine how many SPIs are available on your device.
(2)
The value
n
indicates the SPI pins available; that is, SPIx_SCS[0], SPIx_SCS[1], etc. See your device-
specific data manual to determine how many SPI pins are available on your device.
Table 29-1. SPI Pins
Pin
(1)
Type
Function
SPIx_SIMO
Input/Output
Serial data input in slave mode, serial data output in master mode
SPIx_SOMI
Input/Output
Serial data output in slave mode, serial data input in master mode
SPIx_CLK
Input/Output
Serial clock input in slave mode, serial clock output in master mode
SPIx_SCS[n]
(2)
Input/Output
Slave chip select output in master mode, input in slave mode
SPIx_ENA
Input/Output
Input in master mode, output in slave mode indicates slave is ready
29.2.3 Operation Modes
The SPI operates in master or slave mode. The SPI bus master is the device that drives the SPIx_CLK,
SPIx_SIMO, and optionally the SPIx_SCS[n] signals, and therefore initiates SPI bus transfers. The
CLKMOD and MASTER bits in the SPI global control register 1 (SPIGCR1) select between master and
slave mode. In both master and slave mode, the SPI supports four options:
•
3-pin option
•
4-pin with chip select option
•
4-pin with enable option
•
5-pin with enable and chip select option
The 3-pin option is the basic clock, data in, and data out SPI interface and uses the SPIx_CLK,
SPIx_SIMO, and SPIx_SOMI pins. The 4-pin with chip select option adds the SPIx_SCS[n] pin that is
used to support multiple SPI slave devices on a single SPI bus. The 4-pin with enable option adds the
SPIx_ENA pin that is used to increase the overall throughput by adding hardware handshaking. The 5-pin
option uses all the SPI pins and is a superset of the different options.