32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F52342/HT32F52352
21
Serial Peripheral Interface (SPI)
Introduction
The Serial Peripheral Interface, SPI, provides an SPI protocol data transmit and receive functions
in both master or slave mode. The SPI interface uses 4 pins, among which are serial data input and
output lines MISO and MOSI, the clock line SCK, and the slave select line SEL. One SPI device
acts as a master who controls the data flow using the SEL and SCK signals to indicate the start of
the data communication and the data sampling rate. To receive the data bits, the streamlined data
bits which range from 1 bit to 16 bits specified by the DFL field in the SPICR1 register are latched
in a specific clock edge and stored in the data register or in the RX FIFO. Data transmission
is carried in a similar way but with the reverse sequence. The mode fault detection provides a
capability for multi-master applications.
MOSI
MISO
SEL
SCK
Figure 150. SPI Block Diagram
Rev. 1.30
SPIDR
SPI_TXFIFO
Transmit/Receive
Logic
TX Buffer
Shift
Register
RX Buffer
SPI_RXFIFO
477 of 656
Status
SPISR
APB
Bus
SPIFSR
Control
SPICR0
SPICR1
SPIFCR
SPIIER
SPICPR
SPIFTOCR
September 28, 2018
Need help?
Do you have a question about the HT32F52342 and is the answer not in the manual?