SPI_SCLK (mode0)
Sampling
t
Lead
SPI_SCLK (mode1)
SPI_SCLK (mode2)
SPI_SCLK (mode3)
Functional Description
www.ti.com
268
SWRU543–January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SPI (Serial Peripheral Interface)
8.2.2.2.4 Bit Rate
In master mode, an internal reference clock CLKSPIREF is used as an input of a programmable divider to
generate the bit rate of the serial clock SPICLK.
8.2.2.2.5 Polarity and Phase
The SPI supports four submodes (mode0 to mode3) of the SPI format transfer that depend on the polarity
(POL) and the phase (PHA) of the SPI serial clock (SPICLK). The details of each submode are described
in the following chapters. Table 8-2 and Figure 8-3 show a summary of the four submodes. Software
selects one of four combinations of serial clock phase and polarity.
Table 8-2. Phase and Polarity Combinations
Polarity
(POL)
Phase
(PHA)
SPI
Mode
Comments
0 0 mode0
SPICLK active-high and sampling occurs on the
rising edge.
0 1 mode1
SPICLK active-high and sampling occurs on the
falling edge.
1 0 mode2
SPICLK active-low and campling occurs on the
falling edge.
1 1 mode3
SPICLK active-low and sampling occurs on the
rising edge.
Figure 8-3. Phase and Polarity Combinations
8.2.2.2.5.1 Transfer Format With PHA = 0
This section describes the concept of a SPI transmission with the SPI mode0 and SPI mode2. In the
transfer format with PHA = 0, SPIEN is activated a half-cycle of SPICLK ahead of the first SPICLK edge.
In both master and slave modes, SPI drives the data lines when SPIEN is asserted. Each data frame is
transmitted starting with the MSB. At the extremity of both SPI data lines, the first bit of the SPI word is
valid a half-cycle of SPICLK after the SPIEN assertion.
Thus, the first edge of the SPICLK line is used by the master to sample the first data bit sent by the slave.
On the same edge, the first data bit sent by the master is sampled by the slave. On the next SPICLK
edge, the received data bit is shifted into the shift register, and a new data bit is transmitted on the serial
data line.
This process continues for a total number of pulses on the SPICLK line defined by the SPI word length
programmed in the master device, with data being latched on odd-numbered edges and shifted on even-
numbered edges.