
Rev. 1.00
17� of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
Comparators
Comparators
Comparator Interrupt
Each also possesses its own interrupt function. When any one of the changes state, its relevant
interrupt flag will be set, and if the corresponding interrupt enable bit is set, then a jump to its
relevant interrupt vector will be executed. Note that it is the changing state of the CP0OUT or
CP1OUT bit and not the output pin which generates an interrupt. If the microcontroller is in the
Power-Down or IDLE Mode and the Comparator is enabled, then if the external input lines cause
the Comparator output to change state, the resulting generated interrupt flag will also generate a
wake-up. If it is required to disable a wake-up from occurring, then the interrupt function should
be disabled before entering the Power-Down or IDLE Mode. Each of the comparators has the
compare output transition settings to decide the interrupt request conditions. There are three
options, compare output rising, falling or both rising and falling conditions, decided by the CPnP1
and CPnP0 bits in the CPICR register.
Comparator Reset Function
Comparator 0 has the ability to reset the device. The reset function of Comparator 0 can be enabled
or disabled by the CP0RST bit in the CP0CR register after which the comparator polarity which
will reset the device can be selected using the CP0RSTL bit.
Programming Considerations
If the comparator is enabled, it will remain active when the microcontroller enters the Power-
Down or IDLE Mode, however as it will consume a certain amount of power, the user may wish
to consider disabling it before the Power-Down or IDLE Mode is entered. As comparator pins
are shared with normal I/O pins the I/O registers for these pins will be read as zero (port control
register is “1”) or read as port data register value (port control register is “0”) if the comparator
function is enabled.