
Rev. 1.00
11� of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
Interrupts
Comparator Interrupt
The comparator interrupts are controlled by the two internal comparators. A comparator interrupt
request will take place when the comparator interrupt request flag, CPnIF, is set, a situation
that will occur when one of the comparator output bits changes state. This will in turn cause the
comparator overall request flag, CMPF, to go high. To allow the program to branch to its respective
interrupt vector address, the global interrupt enable bit, EAL, individual comparator enable bit,
CPnIEN, and overall comparator interrupt enable bit, ECMP, must first be set. When the interrupt
is enabled, the stack is not full and the comparator inputs generate a comparator output transition,
a subroutine call to the comparator interrupt vector, will take place. When the interrupt is serviced,
the CP0IF and CP1IF bits can be examined to determine whether the interrupt was generated by
Comparator 0 or Comparator 1. In addition, the comparator output transition interrupt can be set
up by the CPICR control register. Note that the comparator overall request flag, CMPF, will be
automatically cleared, however the individual comparator interrupt request flags, CPnIF, must be
cleared by the application program. The EAL bit must be cleared by the application program to
disable other interrupts when in the interrupt routine.
CPICR Register
SFR Address: BEh
Bit
7
6
5
4
3
2
1
0
Name
CP1IF
CP1IEN
CP1P1
CP1P0
CP0IF
CP0IEN
CP0P1
CP0P0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
0
0
0
0
0
0
0
0
Bit 7
CP1IF:
Comparator 1 Output Transition Interrupt Request Flag
0: No request
1: Interrupt request
This bit must be cleared using the application program.
Bit 6
CP1IEN:
Comparator 1 Output Transition Interrupt Enable
0: Disable
1: Enable
Bit 5~4
CP1P1,
CP1P0:
Comparator 1 Output Transition Setting for interrupt request
00: Interrupt disabled
01: High to low
10: Low to high
11: High to low or low to high
Bit 3
CP0IF:
Comparator 0 Output Transition Interrupt Request Flag
0: No request
1: Interrupt request
This bit must be cleared using the application program.
Bit 2
CP0IEN:
Comparator 0 Output Transition Interrupt Enable
0: Disable
1: Enable
Bit 1~0
CP0P1,
CP0P0:
Comparator 0 Output Transition Setting for interrupt request
00: Interrupt disabled
01: High to low
10: Low to high
11: High to low or low to high