GD32W51x User Manual
681
5. Write an arbitrary byte (for example, 0xFF) to SPI_DATA to receive the next byte.
Figure 20-12. Timing diagram of quad read operation in Quad-SPI mode
D1[5]
D1[4]
D1[6]
D1[7]
D1[0]
D1[1]
D1[2]
D1[3]
SCK
MOSI
MISO
IO2
IO3
TBE
D2[4]
D2[6]
D2[7]
D2[0]
D2[1]
D2[2]
D2[3]
D2[5]
Software writes
SPI_DATA
Hadware sets TBE
RBNE
Software reads
SPI_DATA
Software writes
SPI_DATA
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.
MRU MRB
After getting the second last RBNE flag, read out this data and delay for a SCK clock time
and then, disable the SPI by clearing SPIEN bit. Wait until the last RBNE flag is set and read
out the last data.
SRU SRB
Application can disable the SPI when it doesn
’t want to receive data, and then wait until the