
Rev. 1.00
169 of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
Voltage Reference Generator
Comparators
33
Comparators
Two independent analog comparators are contained within these devices. These functions offer
flexibility via their register controlled features such as power-down, polarity select, hysteresis,
interrupt, wake-up, output path selection etc. In sharing their pins with normal I/O pins the
comparators do not waste precious I/O pins if there functions are unused. One comparator also has
the ability to reset the MCU.
Comparator Operation
Each device contains 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 four control registers, CP0CR, CP1CR, CPHCR and CPICR. 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. 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. The Comparator Hysteresis control function
is selected by the CPHCR register. In addition, the comparator 0 provides the Comparator Output
Reset MCU function which is decided by the CP0RST and CP0RSTL bits in the CP0CR register.
CP0ON
CP0POL CP0OUT
C0OUT
MUX
1
0
CP0OS
CP0RST
Reset MCU
Reset MCU
CP0RSTL
Interrupt
CP0HN[1:0]
CP0HP[1:0]
CP0-
CP0+
-
+
Comparator 0