
Rev. 1.40
118
March 29, 2019
Rev. 1.40
119
March 29, 2019
HT45F23A/HT45F24A
TinyPower
TM
Flash MCU with OPA & Comparators
HT45F23A/HT45F24A
TinyPower
TM
Flash MCU with OPA & Comparators
CMP2C1 Register
Bit
7
6
5
4
3
2
1
0
Name
CMPES1 CMPES0
—
—
C2INTEN C2OUTEN C2PSEL CMP2EN
R/W
R/W
R/W
—
—
R/W
R/W
R/W
R/W
POR
0
0
—
—
0
0
1
0
Bit 7~6
CMPES1, CMPES0
: Interrupt edge control bits
00: disable
01: rising edge trigger
10: falling edge trigger
11: dual edge trigger
Bit 5~4
unimplemented, read as “0”
Bit 3
C2INTEN
: Comparator 2 interrupt control bit
0: disable
1: enable
Bit 2
C2OUTEN
: Comparator 2 output pin control bit
0: disable
1: enable
Bit 1
C2PSEL
: Comparator 2 non-inverting input control bit
0: from VL0
1: from C2P pin
Bit 0
CMP2EN
: Comparator 2 enable or disable control bit
0: disable
1: enable
Comparator Functions
These two comparators can operate together with the OPAs or standalone as shown in the main
functional blocks of the OPAs and Comparators.
Each of the internal comparators in the devices allows for a common mode adjustment method of its
input offset voltage.
The calibration steps are as following:
1. Set C1OFM=1 to setup the offset cancellation mode, here S3A is closed.
2. Set C1RS to select which input pin is to be used as the reference voltage – S1A or S2A is closed.
3. Adjust C1OF0~C1OF4 until the output status changes.
4. Set C1OFM = 0 to restore the normal comparator mode.
5. Repeat the same procedure from steps 1 to 4 for comparator 2.
C1N
CNP
S2A
S1A
S3A
CMP1
C1OUTEN
CMP1X
C1OUT
C1OFM
C1RS
S1A
S2A
S3A
0
1
1
1
0
x
ON
OFF
OFF
OFF
ON
ON
ON
ON
ON
"x" : don´t care