GD32F10x User Manual
490
In master mode, software should write the next data into SPI_DATA register before the
transmission of current data frame is completed if it desires to generate continuous
transmission.
Reception sequence
After the last valid sample clock, the incoming data will be moved from shift register to the
receive buffer and RBNE will be set. The application should read SPI_DATA register to get
the received data and this will clear the RBNE flag automatically when receive buffer is empty.
In MRU and MRB modes, hardware continuously sends clock signal to receive the next data
frame, while in full-duplex master mode (MFD), hardware only receives the next data frame
when the transmit buffer is not empty.
Note:
In SPI slave mode, if the number of input clock circle is not integral multiple of 8 or 16,
which depends on bit width by configuration, and NSS is closed, SPI does not clear the count,
if NSS is enabled, it transmits or receives new data after waiting for the corresponding number
of clock circle. It can be solved by SPI disabled then SPI enabled.
SPI operation sequence in different modes
In full-duplex mode, either MFD or SFD, the RBNE and TBE flags should be monitored and
then follow the sequences described above.
The transmission mode (MTU, MTB, STU or STB) is similar to the transmission sequence of
full-duplex mode regardless of the RBNE and RXORERR bits.
The master reception mode (MRU or MRB) is different from the reception sequence of full-
duplex mode. In MRU or MRB mode, after SPI is enabled, the SPI continuously generates
SCK until the SPI is disabled. So the application should ignore the TBE flag and read out
reception buffer in time after the RBNE flag is set, otherwise a data overrun fault will occur.
The slave reception mode (SRU or SRB) is similar to the reception sequence of full-duplex
mode
except that the TBE bit need to be ignored.
SPI disabling sequence
Different sequences are used to disable the SPI in different operation modes:
MFD SFD
Wait for the last RBNE flag and then receive the last data. Confirm that TBE = 1 and TRANS
= 0. At last, disable the SPI by clearing SPIEN bit.
MTU MTB STU STB
Write the last data into SPI_DATA and wait until the TBE flag is set and then wait until the
TRANS flag is cleared. Disable the SPI by clearing SPIEN bit.
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...