W79E804A/803A/802A
19. ANALOG COMPARATORS
The W79E804 series are provided two Comparators. Input and output options allow use of the
comparators in a number of different Configurations. The Comparator output is a logical one when its
positive input is greater than its negative input. Otherwise, the output is a zero. Each Comparator can
be configured to cause to an interrupt when the output value change. The block diagram is as below.
Each Comparator has a control register (CMP1 and CMP2), Both Inputs are CINnA, CINnB, CMPREF
and internal reference voltage, and outputs are CMP1 and CMP2 by setting OEn bit. After enable
Comparators the Comparator need waited stable time to guarantee Comparator output. If programmer
used internal reference voltage, it will be set OEn bit to “1”. The value of internal reference voltage
(Vref) is 1.19V +/- 10%.
CP1
(P0.4) CIN1A
(P0.3) CIN1B
(P0.5) CMPREF
Enable CMP1
CMP1 Analog Circuit
Comparator1
+
Vref
CO1
OE1
Change Detect
CMF1
-
CN1
CP2
CMP2 Analog Circuit
Comparator2
CMP1(P0.6)
CE1
CE2
En
Vref
Interrupt
Enable CMP2
(P0.2) CIN2A
(P0.1) CIN2B
+
-
CN2
CO2
OE2
Change Detect
CMF2
CMP2(P0.0)
Interrupt
Figure 19-1: Analog Comparators
- 84 -