Rev. 1.10
102
November 04, 2019
Rev. 1.10
103
November 04, 2019
HT45F5Q-3
Battery Charger Flash MCU
HT45F5Q-3
Battery Charger Flash MCU
SPI Data Register
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.
• SIMD Register
Bit
7
6
5
4
3
2
1
0
Name
D7
D6
D5
D4
D3
D2
D1
D0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
x
x
x
x
x
x
x
x
“x”: unknown
Bit 7~0
D7~D0
: USIM SPI/I
2
C data register bit 7 ~ bit 0
SPI Control Registers
There are also two control registers for the SPI interface, SIMC0 and SIMC2. The SIMC0 register
is used to control the enable/disable function and to set the data transmission clock frequency. The
SIMC2 register is used for other control functions such as LSB/MSB selection, write collision flag etc.
• SIMC0 Register
Bit
7
6
5
4
3
2
1
0
Name
SIM2
SIM1
SIM0
UMD
SIMDEB1 SIMDEB0 SIMEN
SIMICF
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
1
1
1
0
0
0
0
0
Bit 7~5
SIM2~SIM0
: USIM SPI/I
2
C Operating Mode Control
000: SPI master mode; SPI clock is f
SYS
/4
001: SPI master mode; SPI clock is f
SYS
/16
010: SPI master mode; SPI clock is f
SYS
/64
011: SPI master mode; SPI clock is f
SUB
100: SPI master mode; SPI clock is CTM CCRP match frequency/2
101: SPI slave mode
110: I
2
C slave mode
111: Unused mode
When the UMD bit is cleared to zero, these bits setup the SPI or I
2
C operating mode
of the USIM function. As well as selecting if the I
2
C or SPI function, they are used
to control the SPI Master/Slave selection and the SPI Master clock frequency. The
SPI clock is a function of the system clock but can also be chosen to be sourced from
CTM and f
SUB
. If the SPI Slave Mode is selected then the clock will be supplied by an
external Master device.
Bit 4
UMD
: UART mode selection bit
0: SPI or I
2
C mode
1: UART mode
This bit is used to select the UART mode. When this bit is cleared to zero, the actual
SPI or I
2
C mode can be selected using the SIM2~SIM0 bits. Note that the UMD bit
must be set low for SPI or I
2
C mode.
Bit 3~2
SIMDEB1~SIMDEB0
: I
2
C Debounce Time Selection
These bits are only available when the USIM is configured to operate in the I
2
C mode.
Refer to the I
2
C register section.