![GigaDevice Semiconductor GD32A50 Series Скачать руководство пользователя страница 557](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32a50-series/gd32a50-series_user-manual_2225782557.webp)
GD32A50x User Manual
557
Figure 21-9. Timing diagram of TI master mode with continuous transfer
D[7]
D[6]
D[5]
D[4]
D[3]
D[2]
D[1]
D[0]
D[7]
D[6]
D[5]
D[4]
D[3]
D[2]
D[1]
D[0]
D[7]
D[6]
D[5]
D[4]
D[3]
D[2]
D[1]
D[0]
D[7]
D[6]
D[5]
D[4]
D[3]
D[2]
D[1]
D[0]
SCK
NSS
MOSI
MISO
sample
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 21-10. Timing diagram of TI slave mode
D[7]
D[6]
D[5]
D[4]
D[3]
D[2]
D[1]
D[0]
D[7]
D[6]
D[5]
D[4]
D[3]
D[2]
D[1]
D[0]
SCK
NSS
MOSI
MISO
sample
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
(21-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.
NSS pulse mode operation sequence
This function is controlled by NSSP bit in SPI_CTL1 register, for this function to fully take