Rev. 1.00
130
September 11, 2018
Rev. 1.00
131
September 11, 2018
HT45F4050
A/D NFC Flash MCU
HT45F4050
A/D NFC Flash MCU
Comparator
An analog comparator is contained within the device. The comparator function offers flexibility
via their register controlled features such as power-down, polarity select, hysteresis etc. In sharing
their pins with normal I/O pins the comparators do not waste precious I/O pins if there functions are
otherwise unused.
+
−
CMPEN
CPOL
CMPO
One Shot
CPINT
CX
Pin-shared
selection
Pin-shared
selection
C-
C+
Comparator
Comparator Operation
The device contains a comparator function which is used to compare two analog voltages and
provide an output based on their input difference.
Full control over the internal comparator is
provided via the control register, C
M
PC. The comparator output is recorded via a bit in the control
register, but can also be transferred output onto a shared I/O pin. Additional comparator functions
include polarity, response time and power down control.
Any pull-high resistors connected to the shared comparator input pins will be automatically
disconnected when the corresponding comparator functional pins are selected. As the comparator
inputs approach their switching level, some spurious output signals may be generated on the
comparator output due to the slow rising or falling nature of the input signals. This can be minimised
by the hysteresis function which will apply a small amount of positive feedback to the comparator
.
When the comparator operates in the normal mode, the hysteresis function will automatically be
enabled. However, the hasteresis function will be disabled when the comparator operates in the input
offset calibration mode.
Ideally the comparator should switch at the point where the positive and negative inputs signals are
at the same voltage level. However, unavoidable input offsets introduce some uncertainties here. The
offset calibration function, if executed, will minimize the switching offset value. The comparator
also provides the output response time select function using the CNVT1~CNVT0 bits in the CMPC
register.
Comparator Registers
There are two registers for overall comparator operation, CMPC and CMPVOS. These registers
control the functions including output polarity control, response time selection, enable/disable
control, operating mode selection, calibration control, etc.
Register
Name
Bit
7
6
5
4
3
2
1
0
CMPC
—
CMPEN
CPOL
CMPO
CNVT1
CNVT0
—
—
CMPVOS
—
COFM
CRSP
COF4
COF3
COF2
COF1
COF0
Comparator Registers List