![Texas Instruments TMS470R1 series Reference Manual Download Page 17](http://html.mh-extra.com/html/texas-instruments/tms470r1-series/tms470r1-series_reference-manual_1097090017.webp)
SPI Operation Modes
Serial Peripheral Interface (SPI) Module (SPNU195E)
11
2.5
Data Format
The data formats for the three, four and five pin options are identical.
CHARLEN[4:0] (SPICTRL1.4-0) specifies the number of bits (3 to 16) in the
data word. The CHARLEN[4:0] value directs the state control logic to count
the number of bits received or transmitted to determine when a complete
word is processed.
The following conditions apply for words with fewer than 16 bits:
❏
Data must be left-justified when it is written to the SPI for transmission
❏
Data is right-justified when read back from the receive register
The buffer contains the most recently received word, right-justified, plus any
bits that are left over from previous transmissions that have been shifted to
the left. The diagram below shows how a 14-bit word is stored in the buffer
once it is received.
In transmit mode, the SPIBUF register contains the most recently transmit-
ted word, left-justified. The diagram below shows how a 14-bit word needs to
be written to the buffer in order to be transmitted correctly.
To allow for the efficient transmission of byte-sized words, if a character
length is programmed for 8 bits or less, the SDPDAT[7] bit instead of SDP-
DAT[15] is the source of the serial out data. This prevents the need to further
add 8 justification bits.
Bits D15
D14
D13
D12
D11
D10
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
X
X
1
0
1
0
1
0
1
0
1
0
1
0
1
0
Bits D15
D14
D13
D12
D11
D10
D9
D8
D7
D6
D5
D4
D3
D2
D1
D0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
X
X
Summary of Contents for TMS470R1 series
Page 4: ......