Rev. 1.2
77
C8051T620/1/6/7 & C8051T320/1/2/3
14. Comparator0 and Comparator1
C8051T620/1/6/7 & C8051T320/1/2/3 devices include two on-chip programmable voltage comparators:
Comparator0 is shown in Figure 14.1, Comparator1 is shown in Figure 14.2. The two comparators operate
identically with the following exceptions: (1) Their input selections differ as described in Section
“14.1. Comparator Multiplexers” on page 84; (2) Comparator0 can be used as a reset source.
The Comparators offer programmable response time and hysteresis, an analog input multiplexer, and two
outputs that are optionally available at the Port pins: a synchronous “latched” output (CP0 or CP1), or an
asynchronous “raw” output (CP0A or CP1A). The asynchronous signals are available even when the sys-
tem clock is not active. This allows the Comparators to operate and generate an output with the device in
STOP mode. When assigned to a Port pin, the Comparator outputs may be configured as open drain or
push-pull (see Section “22.4. Port I/O Initialization” on page 146). Comparator0 may also be used as a
reset source (see Section “20.5. Comparator0 Reset” on page 124).
The Comparator inputs are selected by the comparator input multiplexers, as detailed in Section
“14.1. Comparator Multiplexers” on page 84.
Figure 14.1. Comparator0 Functional Block Diagram
VDD
Reset
Decision
Tree
+
-
Crossbar
Q
Q
SET
CLR
D
Q
Q
SET
CLR
D
(SYNCHRONIZER)
GND
CP0 +
CP0 -
CPT0MD
CP
0RI
E
CP
0FIE
CP
0M
D1
CP
0M
D0
CP0
CP0A
CP0
Interrupt
0
1
0
1
CP0RIF
CP0FIF
0
1
CP0EN
0
1
EA
Comparator
Input Mux
CPT0CN
CP
0
E
N
CP0OU
T
CP
0
RI
F
CP
0F
IF
CP
0H
Y
P
1
CP
0H
Y
P
0
CP
0HY
N
1
CP
0HY
N
0