
AT32F413
Series Reference Manual
2022.06.27
Page 161
Rev 2.00
Figure 13-4
Single-wire unidirectional receive only in SPI slave mode
SPI master
SCK
MISO
MOSI
CS
SPI slave
SCK
MISO
MOSI
CS
In master mode, it is necessary to wait until the second-to-last RDBF bit is set and then another SPI_CPK
period before disabling the SPI. The last RDBF must be set before entering power-saving mode (or
disabling SPI system clock).
In slave mode, there is no need to check any flag before disabling the SPI. However, it is required to
wait until the BF becomes 0 before entering power-saving mode.
shows single-wire bidirectional half-duplex mode and SPI IO connection
When the SLBEN is set, the SPI operates in single-wire bidirectional half-duplex mode. In this case,
the SPI supports data reception and transmission alternately. In master mode, the MOSI pin transmits
or receives data in master mode, while the MISO pin is released. In slave mode, the MISO pin transmits
or receives data, but the MOSI pin is released.
The SLBTD bit is used by software to configure transfer direction. When the SLBTD bit is set, the SPI
can be used only for data transmission; when the SLBTD bit is 0, the SPI can be used only for data
reception.
Figure 13-5 Single-wire bidirectional half-duplex mode
SPI master
SCK
MISO
MOSI
CS
SPI slave
SCK
MISO
MOSI
CS
When the SPI is selected for data transmission in single-wire bidirectional half-duplex mode (master or
slave), the TDBE bit must be set, and the BF must be 0 before disabling the SPI. The power-saving
mode (or disabling SPI system clock) cannot be entered unless the SPI is disabled.
In master mode, when the SPI is selected for data reception in single-wire bidirectional half-duplex mode,
it is required to wait until the second-to-last RDBF is set and then another SPI_SCK period before
disabling the SPI. And the last RDBF must be set before entering power-saving mode (or disabling SPI
system clock).
In slave mode, when the SPI is selected for data reception in single-wire bidirectional half-duplex mode,
there is no need to check any flags before disabling the SPI. However, the BT must be 0 before entering
power-saving mode (or disabling SPI system clock).