
Rev. 1.40
116
March 29, 2019
Rev. 1.40
117
March 29, 2019
HT45F23A/HT45F24A
TinyPower
TM
Flash MCU with OPA & Comparators
HT45F23A/HT45F24A
TinyPower
TM
Flash MCU with OPA & Comparators
Comparators
Two analog comparators are contained within the devices. These functions offer flexibility via their
register controlled features such as power-down, interrupt etc. Sharing their pins with normal I/O
pins, the comparators do not waste precious I/O pins if there functions are otherwise unused. In
addition, the devices provide the calibration function to adjust the comparator offset.
Comparator Operation
The devices contain two comparator functions which are used to compare two analog voltages
and provide an output based on their difference. Full control over the two internal comparators
is provided via control registers, CMP1C0, CMP1C1, CMP2C0 and CMP2C1. The comparator
output is recorded via a bit in their respective control register, but can also be transferred out onto a
shared I/O pin or to generate an interrupt trigger with edge control function. Additional comparator
functions include the power down control.
Comparator Registers
The internal dual comparators are fully under the control of internal registers, CMP1C0, CMP1C1,
CMP2C0 and CMP2C1. These registers control enable/disable function, input path selection,
interrupt edge control and input offset voltage calibration function.
CMP1C0 Register
Bit
7
6
5
4
3
2
1
0
Name
CMP1X
C1OFM
C1RS
C1OF4
C1OF3
C1OF2
C1OF1
C1OF0
R/W
R
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
0
0
0
1
0
0
0
0
Bit 7
CMP1X
: comparator output; positive logic. This bit is read only.
Bit 6
C1OFM
: Comparator mode or input offset voltage cancellation mode
0: comparator mode
1: input offset voltage cancellation mode
When the C1OFM=1, comparator inputs are always from I/O pins. i.e. the CNPSEL
and C1NSEL will be forced to “1”. That means disconnect the input from OPAs
output.
Bit 5
C1RS
: Comparator input offset voltage cancellation reference selection bit
0: select C1N as the reference input
1: select CNP as the reference input
Bit 4~0
C1OF4~C1OF0
: Comparator input offset voltage cancellation control bits