327
13.5 Comparator Interrupts
13.5 Comparator Interrupts
There are 14 different causes for comparator interrupts:
Comparator 1, voltage comparators 2 to 8 interrupts
Batteries 1 to 3 VALID interrupts. Comparators 2 to 4 interrupts
I
Comparator 1, Voltage Comparators 2 to 7 Interrupts
Voltage input to the P70/DCIN, P71/DCIN2, P72/VOL1, P73/VSI1, P74/VOL2, P75/VS12, P76/
VOL3, and P77/VSI3 pins is compared by comparator 1 and voltage comparators 2 to 8 (which
have reference voltage input from the CVRH1 and CVRL pins, as hysteresis width). If a change
is detected in the output of these comparators (edge detection), the interrupt request bits for
comparator 1 and voltage comparators 2 to 8 (COSR1:COR1 to COR8) are set to "1". At this
time, if the interrupt enable bit for the comparator 1 and voltage comparators 2 to 8 has been set
to "enabled" (CICR1:"CEN to CEN8"=1), an interrupt request (IRQ4) to the CPU is generated.
In the interrupt processing routine, write "0" in the interrupt enable bits for comparator 1 and
voltage comparators 2 to 8 to clear the interrupt requests.
I
Batteries 1 to 3 VALID Interrupts
The battery VALID interrupt request bits (COSR2:VAR1 to VAR3) are set to "1" under the
following conditions:
In comparison of voltage input to the P72/VOL1, P73/VSI1, and P84/AN0/SW1 pins by the
battery monitoring circuit 1, a change has been detected in the VALID output result (edge
detection).
In comparison of voltage input to the P74/VOL2, P75/VSI2, and P85/AN1/SW2 pins by the
battery monitoring circuit 2, a change has been detected in the VALID output result (edge
detection).
In comparison of voltage input to the P76/VOL3, P77/VSI3, and P86/AN2/SW3 pins by the
battery monitoring circuit 3, a change has been detected in the VALID output result (edge
detection).
When any of the above conditions is true, an interrupt request (IRQ5) to the CPU is
generated if the battery VALID interrupt enable bit has been set to enabled.(CICR2:VEN1 to
VEN3)
Write "0" in the battery interrupt request bits (COSR2:VAR1 to VAR3) in the interrupt
processing routine to clear the interrupt requests.
I
Comparators 2 to 4 Interrupts
Voltage input to the P85/AN0/SW1, P86/AN1/SW2, and P87/AN2/SW3 pins is compared by
comparators 2 to 4. If a change is detected in the output of these comparators (edge
detection), an interrupt request (IRQ5) to the CPU is generated if the interrupt enable bits for
comparators 2 to 4 have been set to "enabled" (CICR2: SEN1 to SEN3=1).
In the interrupt processing routine, write "0" in the interrupt enable bits for comparator 1 and
voltage comparators 2 to 8 to clear the interrupt requests.