
Rev. 1.00
453 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)
The accompanying figure shows the bit sequence of the SPI Dual mode reading data from an
external serial SPI Flash.
SEL
SCK
MOSI
MISO
Command
Address
Dummy
Data
A23-A0
C7-C0
C7
C6
C5
C4
C3
C2
C1
C0
A23 A22
A1
A0
Byte 1
D6
D4
D7
D5
DUALEN
D2
D0
D3
D1
∙∙∙∙
∙∙∙∙
∙∙∙∙
∙∙∙∙
∙∙∙∙
∙∙∙∙
∙∙∙∙
∙∙∙∙
D6
D4
D7
D5
D2
D0
D3
D1
Byte 2
Figure 167. SPI Dual Mode Data Read Example – CPOL = 1, CPHA = 1
Status Flags
TX Buffer Empty – TXBE
This TXBE flag is set when the TX buffer is empty in the non-FIFO mode or when the TX FIFO
data length is equal to or less than the TX FIFO threshold level as defined by the TXFTLS field in
the SPIFCR register in the FIFO mode. The following data to be transmitted can then be loaded
into the buffer again. After this, the TXBE flag will be reset when the TX buffer already contains
new data in the non-FIFO mode or when the TX FIFO data length is greater than the TX FIFO
threshold level determined by the TXFTLS field in FIFO mode.
Transmission Register Empty – TXE
This TXE flag is set when both the TX buffer and the TX shift registers are empty. It will be reset
when the TX buffer or the TX shift register contains new transmitted data.
RX Buffer Not Empty – RXBNE
This RXBNE flag is set when there is valid received data in the RX buffer in the non-FIFO mode
or the RX FIFO data length is equal to or greater than the RX FIFO threshold level as defined by
the RXFTLS field in the SPIFCR register in the SPI FIFO mode. This flag will be automatically
cleared by hardware when the received data have been read out from the RX buffer totally in the
non-FIFO mode or when the RX FIFO data length is less than the RX FIFO threshold level set in
the RXFTLS field.
Time Out Flag – TO
The time out function is only available in the SPI FIFO mode and is disabled by loading a zero
value into the TOC field in the Time Out Counter register. The time out counter will start counting
if the SPI RX FIFO is not empty, once data is read from the SPIDR register or new data is received,
the time out counter will be reset to 0 and count again. When the time out counter value is equal to
the value specified by the TOC field in the SPIFTOCR register, the TO flag will be set. The flag is
cleared by writing 1 to this bit.