Enhanced SPI Module Overview
992
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
C28 Serial Peripheral Interface (SPI)
12.1.5.4 Initialization Upon Reset
A system reset forces the SPI peripheral module into the following default configuration:
•
Unit is configured as a slave module (MASTER/SLAVE = 0)
•
Transmit capability is disabled (TALK = 0)
•
Data is latched at the input on the falling edge of the SPICLK signal
•
Character length is assumed to be one bit
•
SPI interrupts are disabled
•
Data in SPIDAT is reset to 0000h
•
SPI module pin functions are selected as general-purpose inputs (this is done in I/O MUX control
register B [MCRB])
To change this SPI configuration:
Step 1.
Clear the SPI SW RESET bit (SPICCR.7) to 0 to force the SPI to the reset state.
Step 2.
Initialize the SPI configuration, format, baud rate, and pin functions as desired.
Step 3.
Set the SPI SW RESET bit to 1 to release the SPI from the reset state.
Step 4.
Write to SPIDAT or SPITXBUF (this initiates the communication process in the master).
Step 5.
Read SPIRXBUF after the data transmission has completed (SPISTS.6 = 1) to determine
what data was received.
To prevent unwanted and unforeseen events from occurring during or as a result of initialization changes,
clear the SPI SW RESET bit (SPICCR.7) before making initialization changes, and then set this bit after
initialization is complete.
NOTE:
Do not change the SPI configuration when communication is in progress.
12.1.5.5 Data Transfer Example
The timing diagram shown in
illustrates an SPI data transfer between two devices using a
character length of five bits with the SPICLK being symmetrical.
The timing diagram with SPICLK unsymmetrical (
) shares similar characterizations with
except that the data transfer is one CLKOUT cycle longer per bit during the low pulse
(CLOCK POLARITY = 0) or during the high pulse (CLOCK POLARITY = 1) of the SPICLK.
is applicable for 8-bit word length transmissions. The figure is shown for illustrative purposes
only.