GD32VF103 User Manual
387
Figure
18
-
8
. Timing diagram of TI master mode with continuous transfer
SCK
MOSI
MISO
NSS
D7
D7
D0 D7
In master TI mode, SPI can perform continuous or non-continuous transfer. If the master
writes SPI_DATA register fast enough, the transfer is continuous, otherwise non-continuous.
In non-continuous transfer, there is an extra header clock cycle before each byte. While in
continuous transfer, the extra header clock cycle only exists before the first byte and the
following bytes’ header clock is overlaid at the last bit of pervious bytes.
Figure
18
-
9
. Timing diagram of TI slave mode
SCK
MOSI
MISO
NSS
D7
D0
D0
D7
Td
In slave TI mode, after the last rising edge of SCK in transfer, the slave begins to transmit the
LSB bit of the last data byte, and after a half-bit time, the master begins to sample the line.
To make sure that the master samples the right value, the slave should continue to drive this
bit after the falling sample edge of SCK for a period of time before releasing the pin. This time
is called
T
d
.
T
d
is decided by PSC[2:0] bits in SPI_CTL0 register.
T
d
=
T
bit
2
+5*T
pclk
(18-1)
For example, if PSC[2:0] = 010,
T
d
is
9*T
pclk
.
In slave mode, the slave also monitors the NSS signal and sets an error flag FERR if it detects
an incorrect NSS behavior, for example, toggles at the middle bit of a byte.