Rev. 1.10
62
November 04, 2019
Rev. 1.10
63
November 04, 2019
HT45F5Q-3
Battery Charger Flash MCU
HT45F5Q-3
Battery Charger Flash MCU
Compact Type TM – CTM
The Compact Type TM contains three operating modes, which are Compare Match Output, Timer/Event
Counter and PWM Output modes. The Compact Type TM can also be controlled with an external input
pin and can drive two external output pins.
f
SYS
f
SYS
/4
f
H
/64
f
H
/16
f
SUB
CTCK
000
001
010
011
100
101
110
111
CTCK2~CTCK0
10-bit Count-up Counter
3-bit Comparator P
CCRP
b7~b9
b0~b9
10-bit Comparator A
CTON
CTPAU
Comparator A Match
Comparator P Match
Counter Clear
0
1
Output
Control
Polarity
Control
CTOC
CTM1~CTM0
CTIO1~CTIO0
CTMAF Interrupt
CTMPF Interrupt
CTPOL
CCRA
CTCCLR
f
SUB
CTPB
CTP
Note:
The CTM external pins are pin-shared with other functions, so before using the CTM function, the pin-shared
function registers must be set properly to enable the CTM pin function
.
Compact Type TM Block Diagram
Compact Type TM Operation
The size of Compact Type TM is 10-bit wide and its core is a 10-bit count-up counter which is
driven by a user selectable internal or external clock source. There are also two internal comparators
with the names, Comparator A and Comparator P. These comparators will compare the value in
the counter with CCRP and CCRA registers. The CCRP comparator is 3-bit wide whose value
is compared with the highest 3 bits in the counter while the CCRA is the 10 bits and therefore
compares all counter bits.
The only way of changing the value of the 10-bit counter using the application program, is to
clear the counter by changing the CTON bit from low to high. The counter will also be cleared
automatically by a counter overflow or a compare match with one of its associated comparators.
When these conditions occur, a CTM interrupt signal will also usually be generated. The Compact
Type TM can operate in a number of different operational modes, can be driven by different clock
sources including an input pin and can also control two output pins. All operating setup conditions
are selected using relevant internal registers.
Compact Type TM Register Description
Overall operation of the Compact Type TM is controlled using a series of registers. A read only
register pair exists to store the internal counter 10-bit value, while a read/write register pair exists to
store the internal 10-bit CCRA value. The remaining two registers are control registers which setup
the different operating and control modes as well as three CCRP bits.