www.geehy.com Page 302
TI frame format error
23.4.11.1
State flag bit
There are three flag bits for fully monitoring the state of SPI bus
Transmit buffer empty flag TXBEFLG
TXBEFLG=1 means that TXFIFO has space to store the transmitted data;
TXBEFLG flag bit is connected to TXFIFO bit, and in the process of storing data,
if the storage content of TXFIFO is less than or equal to FIFO/2, TXBEFLG flag
bit is kept high. When the storage content of TXFIFO is greater than FIFO/2,
TXBEFLG flag bit will be cleared. If TXBEIEN bit in SPI_CTRL2 register is set,
an interrupt will be generated.
Receive buffer non-empty flag RXBNEFLG
RXBNEFLG flag bit depends on the value of FRTCFG bit in SPI_CTRL2 register:
If FRTCFG=1, when the storage content of RXFIFO is greater than or
equal to 8 bits, RXBNEFLG=1
If FRTCFG=1, when the storage content of RXFIFO is greater than or
equal to 16 bits, RXBNEFLG=1
RXBNEFLG flag bit will be cleared automatically if not in the above situations.
If RXBNEIEN=1 in SPI_CTRL2 register, an interrupt will be generated.
Busy flag BSYFLG
BSYFLG flag is set and cleared by hardware, which can indicate the state of SPI
communication layer. When BSYFLG=1, it indicates SPI is communicating.
BSYFLG flag can be used to detect whether transmission is over to avoid
damaging the last transmitted data.
BSYFLG flag will be cleared in the following situations
End the transmission in master mode
Master mode fault
In slave mode, there is at least one SPI cycle between two data
transmissions
Disable SPI
During continuous communication:
In master mode: BSYFLG=1 in the whole transmission process
In save mode: BSYFLG is kept low within one SCK clock cycle
between transmission of each data
Note: It is best to use TXBEFLG and RXBNEFLG flags to process the
transmitting and receiving of each data item
23.4.11.2
Error flag bit
Master mode error MEFLG
MEFLG is an error flag bit. The master mode error occurs when: in hardware
NSS mode, the NSS pin of the master device is pulled down; in software NSS
mode, ISSEL bit is cleared; MEFLG bit is set automatically.
Effect of master mode failure: MEFLG is set to 1, and if ERRIEN is set, SPI
interrupt will be generated; SPIEN is cleared (output stops, SPI interface is