Registers
1457
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Serial Peripheral Interface (SPI)
Table 29-21. SPI Data Register 1 (SPIDAT1) Field Descriptions (continued)
Bit
Field
Value
Description
15-0
TXDATA
0-FFFFh
Transfer data. When written, these bits will be copied to the shift register if it is empty. If the shift
register is not empty, the TXBUF will hold the written values.
SPIGCR1.ENABLE must be set to 1 before this register can be written to. Writing a 0 to the
SPIGCR1.ENABLE forces the lower 16 bits of the SPIDAT1 to 0.
Note:
Irrespective of the character length, the transmit data should be right-justified before writing
to SPIDAT1.
29.3.14 SPI Receive Buffer Register (SPIBUF)
The SPI receive buffer register (SPIBUF) is shown in
and described in
Figure 29-31. SPI Buffer Register (SPIBUF)
31
30
29
28
27
26
25
24
RXEMPTY
RXOVR
TXFULL
BITERR
DESYNC
PARERR
TIMEOUT
DLENERR
RS-1
RC-0
R-0
RC-0
RC-0
RC-0
RC-0
RC-0
23
16
Reserved
R-0
15
0
RXDATA
R-0
LEGEND: R/W = Read/Write; R = Read only; C = Clear; S = Set; -
n
= value after reset
Table 29-22. SPI Buffer Register (SPIBUF) Field Descriptions
Bit
Field
Value
Description
31
RXEMPTY
Receive data buffer empty. When host reads the RXDATA field or the entire SPIBUF register this
automatically sets the RXEMPTY flag. When a data transfer is completed, the received data is
copied into SPIBUF, the RXEMPTY flag is cleared. This flag gets set to 1 under following
conditions:
• Reading the RXDATA field of the SPIBUF register.
• Writing 1 to clear the RXINTFLG bit in the SPIFLG register.
0
New data has been received and copied into the SPIBUF register.
1
No data received since last reading of the SPIBUF register.
Write-Clearing the SPIFLG.RXINTFLG bit before reading the SPIBUF register indicates the
received data is being ignored. Conversely, SPIFLG.RXINTFLG can be cleared by reading the
RXDATA field of the SPIBUF register or the entire SPIBUF register.
30
RXOVR
Receive data buffer overrun. When a data transfer is completed and the received data is copied
into the RXBUF while it is already full, RXOVR is set. An overrun always occurs to the RXBUF,
and SPIBUF contents never get overwritten until after it is read by the CPU/DMA.
Reading SPIBUF register does not clear the RXOVR bit. If an overrun interrupt is detected, then
the SPIBUF may need to be read twice to get to the overrun buffer. This is due to the fact that the
overrun will always occur to the internal RXBUF. Each read to the SPIBUF will result in RXBUF
contents (if it is full) getting copied to SPIBUF.
Note:
A special condition under which RXOVR flag gets set. If both SPIBUF and RXBUF are
already full and while another buffer receive is underway, if any errors like TIMEOUT, BITERR and
DLENERR occur, then RXOVR will be set to indicate that the status flags are getting overwritten
by the new transfer. This overrun should be treated like a normal receiver overrun.
0
No receive data overrun condition occurred since last time reading the data field.
1
A receive data overrun condition occurred since last time reading the data field.