English
Language : 

HT66F317 Datasheet, PDF (129/198 Pages) Holtek Semiconductor Inc – Enhanced A/D MCU with LCD Driver
HT66F317/HT66F318
Enhanced A/D MCU with LCD Driver
Comparator (only for HT66F318)
An analog comparator is contained within this 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.
CPO L
COUT
C+
CX
C-
COS
Comparator
Comparator Operation
The device contains a comparator function which is used to compare two analog voltages and
provide an output based on their difference. Full control over the internal comparator is provided
via the control register CPC assigned to the comparator. The comparator output is recorded via a bit
in the control register, but can also be transferred out onto a shared I/O pin. Additional comparator
functions include, output polarity, hysteresis functions and power down control.
Any pull-high resistors connected to the shared comparator input pins will be automatically
disconnected when the comparator is enabled. 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 selecting the hysteresis
function will apply a small amount of positive feedback to the comparator. 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 hysteresis function,
if enabled, also increases the switching offset value.
CPC Register
Bit
Name
R/W
POR
7
CSEL
R/W
1
6
CEN
R/W
0
5
CPOL
R/W
0
4
COUT
R
0
3
COS
R/W
0
2
1
CMPEG1 CMPEG0
R/W
R/W
0
0
0
CHYEN
R/W
1
Bit 7
Bit 6
CSEL: Select Comparator pins or other pin functions
0: Other pin functions
1: Comparator input pin C+ and C- selected
This is the Comparator input pin or other pin functions select bit. If the bit is high
the comparator input pins will be enabled. As a result, these two pins will lose their
original pin functions. Any pull-high options associated with the comparator shared
pins will also be automatically disconnected.
CEN: Comparator On/Off control
0: Off
1: On
This is the Comparator on/off control bit. If the bit is zero the comparator will be
switched off and no power consumed even if analog voltages are applied to its inputs.
For power sensitive applications this bit should be cleared to zero if the comparator is
not used or before the device enters the SLEEP or IDLE mode.
Rev. 1.20
129
December 13, 2016