Maximum SPI Baud Rate
LSPCLK
4
40
10
6
4
10
10
6
bps
=
=
=
×
×
SPI Baud Rate
LSPCLK
4
=
SPI Baud Rate
LSPCLK
(SPIBRR
1)
=
+
Enhanced SPI Module Overview
990
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
C28 Serial Peripheral Interface (SPI)
12.1.5.3 Baud Rate and Clocking Schemes
The SPI module supports 125 different baud rates and four different clock schemes. Depending on
whether the SPI clock is in slave or master mode, the SPICLK pin can receive an external SPI clock signal
or provide the SPI clock signal, respectively.
•
In the slave mode, the SPI clock is received on the SPICLK pin from the external source, and can be
no greater than the LSPCLK frequency divided by 4.
•
In the master mode, the SPI clock is generated by the SPI and is output on the SPICLK pin, and can
be no greater than the LSPCLK frequency divided by 4.
shows how to determine the SPI baud rates.
Example 12-2. Baud Rate Determination
For SPIBRR = 3 to 127:
(5)
For SPIBRR = 0, 1, or 2:
(6)
where:
LSPCLK = Low-speed peripheral clock frequency of the device
SPIBRR = Contents of the SPIBRR in the master SPI device
To determine what value to load into SPIBRR, you must know the device system clock (LSPCLK) frequency
(which is device-specific) and the baud rate at which you will be operating.
Example 1
−
2 shows how to determine the maximum baud rate at which the SPI can communicate. Assume
that LSPCLK = 40 MHz.
Example 12-3. Maximum Baud-Rate Calculation
(7)
12.1.5.3.1 SPI Clocking Schemes
The CLOCK POLARITY bit (SPICCR.6) and the CLOCK PHASE bit (SPICTL.3) control four different
clocking schemes on the SPICLK pin. The CLOCK POLARITY bit selects the active edge, either rising or
falling, of the clock. The CLOCK PHASE bit selects a half-cycle delay of the clock. The four different
clocking schemes are as follows:
•
Falling Edge Without Delay. The SPI transmits data on the falling edge of the SPICLK and receives
data on the rising edge of the SPICLK.
•
Falling Edge With Delay. The SPI transmits data one half-cycle ahead of the falling edge of the
SPICLK signal and receives data on the falling edge of the SPICLK signal.
•
Rising Edge Without Delay. The SPI transmits data on the rising edge of the SPICLK signal and
receives data on the falling edge of the SPICLK signal.
•
Rising Edge With Delay. The SPI transmits data one half-cycle ahead of the rising edge of the SPICLK
signal and receives data on the rising edge of the SPICLK signal.