Rev. 1.10
76
November 26, 2019
Rev. 1.10
77
November 26, 2019
HT68FB240
USB Low Speed Flash MCU
SPI Block Diagram
The SPI function in this device offers the following features:
•
Full duplex synchronous data transfer
•
Both Master and Slave modes
•
LSB first or MSB first data transmission modes
•
Transmission complete flag
•
Rising or falling active clock edge
•
WCOL and CSEN bit enabled or disable select
The status of the SPI interface pins is determined by a number of factors such as whether the device
is in the master or slave mode and upon the condition of certain control bits such as CSEN and
SIMEN.
SPI Registers
There are four internal registers which control the overall operation of the SPI interface. These are
the SIMD data register and three registers SIMC0,
SIMC2 and SBSC.
Note that the SIMC1 register
is only used by the I
2
C interface.
Register
Name
Bit
7
6
5
4
3
2
1
0
SIMC0
SIM2
SIM1
SIM0
PCKEN
PCKP1
PCKP0
SIMEN
—
SIMD
D7
D6
D5
D4
D3
D2
D1
D0
SIMC2
D7
D6
CKPOLB
CKEG
MLS
CSEN
WCOL
TRF
SBSC
SIM_WCOL
—
I2CDB1
I2CDB0
—
—
—
—
SIM Registers List
The SIMD register is used to store the data being transmitted and received. The same register is used
by both the SPI and I
2
C functions. Before the device writes data to the SPI bus, the actual data to
be transmitted must be placed in the SIMD register. After the data is received from the SPI bus, the
device can read it from the SIMD register. Any transmission or reception of data from the SPI bus
must be made via the SIMD register.
The SIM_WCOL bit in the SBSC register is used to control the SPI WCOL function.