GD32VF103 User Manual
388
NSS pulse mode operation sequence
This function is controlled by NSSP bit in SPI_CTL1 register. In order to implement this
function, several additional conditions must be met: configure the device to master mode,
frame format should follow the normal SPI protocol, select the first clock transition as the data
capture edge.
In summary, MSTMOD = 1, NSSP = 1, CKPH = 0.
When NSS pulse mode is enabled
, a pluse duration of at least 1 SCK clock period is inserted between two successive data
frames depending on the status of internal data transmit buffer. Multiple SCK clock cycle
intervals are possible if the transfer buffer stays empty. This function is designed for single
master-slave configuration for the slave to latch data. The following diagram depicts its timing
diagram.
Figure 18-10. Timing diagram of NSS pulse with continuous transmission
NSS
SCK
MISO
MOSI
MSB
LSB
LSB
MSB
MSB
LSB
MSB
LSB
Don
’
t Care
Don
’
t Care
Don
’
t Care
1 SCK
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
TRANS=0 to ensure the ongoing transfer completes.