Architecture
1423
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Serial Peripheral Interface (SPI)
29.2.9 SPI Operation: 4-Pin with Enable Mode
The 4-pin with enable option is a superset of the 3-pin option and uses the enable (SPIx_ENA) pin in
addition to the clock (SPIx_CLK) and data (SPIx_SOMI and SPIx_SIMO) pins.
shows the SPI
4-pin enable option.
To select the 4-pin with enable option, the SPIx_CLK, SPIx_SOMI, SPIx_SIMO, and SPIx_ENA pins
should be configured as functional pins by configuring the SPI pin control register 0 (SPIPC0). The
SPIx_SCS[n] pins can be used as general-purpose I/O pins by configuring the SPIPC1 through SPIPC5
registers.
In SPI master mode, the SPIx_SOMI and SPIx_ENA pin output buffer is in a high-impedance state and
the SPIx_CLK and SPIx_SIMO pin output buffer is enabled. In SPI slave mode, the SPIx_CLK and
SPIx_SIMO pin output buffer is in a high-impedance state, and the SPIx_SOMI pin output buffer is
enabled. In SPI slave mode, the SPIx_ENA pin output buffer enable depends upon the status of the
transmit buffer and the configuration of the ENABLEHIGHZ bit in the SPI interrupt register (SPIINT0).
The handshake operation works this way:
•
After a transfer completes, both the master and slave SPI modules need to be serviced.
•
The slave SPI deasserts SPIx_ENA after the transfer, indicating it requires servicing and is not ready.
•
The slave should begin servicing its SPI by first reading receive data from the SPI receive buffer
register (SPIBUF).
•
Next, the slave device should write transmit data to the SPI transmit data registers (SPIDAT0 or
SPIDAT1). This causes the slave SPI to assert SPIx_ENA indicating it is ready for the next
transmission.
•
In parallel, the master device can service its SPI at any time. It does not need to insert a delay before
writing to its SPIDAT0 or SPIDAT1 in order to avoid overrunning the slave device. Instead, the master
SPI module will automatically delay the next transfer until the slave has asserted SPIx_ENA again to
indicate it is ready for the transmission.
This handshake allows the two SPIs to communicate at the maximum rate possible. Without the
handshake pin, the master must insert a delay between each transfer long enough to support the worst
case response time of the slave servicing its SPI or risk an overrun condition. With the handshake, the
throughput is determined by the average response time of the two devices servicing their SPI ports.
The SPIx_ENA pin can be driven in a push-pull or open-drain mode, depending upon the setting of the
ENABLEHIGHZ bit.
NOTE:
Either SPIDAT0 or SPIDAT1 can be used on both master and slaves sides.