
Rev. 1.00
455 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
21 Serial Peripheral Interface (SPI)
21 Serial Peripheral Interface (SPI)
Table 51. SPI Mode Fault Trigger Conditions
Mode Fault
Descriptions
Trigger Condition
1.
SPI Master mode.
2. SELOEN = 0 in the SPICR0 register – SPI_SEL pin is configured to be the
input mode.
3. SEL signal changes to an active level when driven by the external SPI master.
SPI Behavior
1. Mode fault flag is set.
2. The SPIEN bit in the SPICR0 register is reset. This disables the SPI interface
and blocks all output signals from the device.
3. The MODE bit in the SPICR1 register is reset. This forces the device into
slave mode.
Table 52. SPI Master Mode SPI_SEL Pin Status
SEL as Input – SELOEN = 0
SEL as Output – SELOEN = 1
Multi-Master
Supported
Not supported
SPI SEL Control Signal Use Another GPIO to replace the
SPI_SEL pin function
SPI_SEL pin in hardware or software
control mode – using SELM setting
Continuous Transfer
Case 1
Case 2
Case 1
Case 2
Not supported
Supported
Hardware control Hardware or
software control
Case 1:
SEL signal must be inactive between each data transfer.
Case 2:
SEL signal will not to be inactive until the last data frame has finished.
Note:
When the SPI is in the slave mode, the SEL signal is always an input and not affected by the
SELOEN bit in the SPICR0 register.
Write Collision – WC
The following conditions will assert the Write Collision Flag.
▆
The FIFOEN bit in the SPIFCR register is cleared
The write collision flag is asserted when new data is written into the SPIDR register while both
the TX buffer and the shift register are already full. Any new data written into the TX buffer will
be lost.
▆
The FIFOEN bit in the SPIFCR register is set
The write collision flag is asserted to indicate that new data is written into the SPIDR register
while both the TX FIFO and the TX shift register are already full. Any new data written into the
TX FIFO will be lost.
Read Overrun – RO
▆
The FIFOEN bit in the SPIFCR register is cleared
The read overrun flag is asserted to indicate that both the RX shift register and the RX buffer are
already full, if one more data is received. This will result in the newly received data not being
shifted into the SPI shift register. As a result the latest received data will be lost.
▆
The FIFOEN bit in the SPIFCR register is set
The read overrun flag is set to indicate that the RX shift register and the RX FIFO are both full,
if one more data is received. This means that the latest received data cannot be shifted into the
SPI shift register. As a result the latest received data will be lost.
Slave Abort – SA
In the SPI slave mode, the slave abort flag is set to indicate that the SPI_SEL pin suddenly changed
to an inactive state during the reception of a data frame transfer. The data frame length is set by the
DFL field in the SPICR1 register.