Spi 3-Wire Slave Mode; 3-Wire Spi Pin Configuration - Texas Instruments Concerto F28M35 Series Technical Reference Manual

Table of Contents

Advertisement

www.ti.com
SPI Module
Table 12-6
indicates how data is received or transmitted in the various SPI modes while the TALK bit is
set or cleared.
Pin Mode
4-wire
3-pin mode
4-wire
3-pin mode
SPI 3-Wire Mode Code Examples
In addition to the normal SPI initialization, to configure the SPI module for 3-wire mode, the TRIWIRE bit
(SPIPRI.0) must be set to 1. After initialization, there are several considerations to take into account when
transmitting and receiving data in 3-wire master and slave mode. The following examples demonstrate
these considerations.
In 3-wire master mode, SPICLKx, SPISTEx, and SPISIMOx pins must be configured as SPI pins
(SPISOMIx pin can be configured as non-SPI pin). When the master transmits, it receives the data it
transmits (because SPISIMOx and SPISOMIx are connected internally in 3-wire mode). Therefore, the
junk data received must be cleared from the receive buffer every time data is transmitted.
Example 12-4. 3-Wire Master Mode Transmit
Uint16 data;
Uint16 dummy;
SpiaRegs.SPICTL.bit.TALK = 1;
SpiaRegs.SPITXBUF = data; // Master transmits data
while(SpiaRegs.SPISTS.bit.INT_FLAG !=1) {} // Waits until data rx'd
dummy = SpiaRegs.SPIRXBUF;
SPRUH22I – April 2012 – Revised November 2019
Submit Documentation Feedback
Figure 12-9. SPI 3-wire Slave Mode
Data RX
SPIDAT
Data TX
Talk
SPICTL.1
Table 12-6. 3-Wire SPI Pin Configuration
SPIPRI[TRIWIRE]
0
1
0
1
Copyright © 2012–2019, Texas Instruments Incorporated
GPIO MUX
SPISISOx
Free pin
SPICTL[TALK]
SPISIMO
Master Mode
X
0
1
Slave Mode
X
0
Disconnect from SPI
1
// Enable Transmit path
// Clears junk data from itself
// bc it rx'd same data tx'd
C28 Serial Peripheral Interface (SPI)
Enhanced SPI Module Overview
SPISOMI
TX
RX
RX
Disconnect from SPI
TX/RX
RX
TX
RX
TX/RX
959

Advertisement

Table of Contents
loading

Table of Contents