Datasheet
PIC16C62X
DS30235J-page 38 2003 Microchip Technology Inc.
7.1 Comparator Configuration
There are eight modes of operation for the
comparators. The CMCON register is used to select
the mode. Figure 7-1 shows the eight possible modes.
The TRISA register controls the data direction of the
comparator pins for each mode. If the Comparator
mode is changed, the comparator output level may not
be valid for the specified mode change delay shown
in Table 12-2.
FIGURE 7-1: COMPARATOR I/O OPERATING MODES
Note: Comparator interrupts should be disabled
during a Comparator mode change other-
wise a false interrupt may occur.
-
+
C1
VIN-
V
IN+
Off
(Read as '0')
RA0/AN0
RA3/AN3
A
A
CM<2:0> = 000
-
+
C2
VIN-
V
IN+
Off
(Read as '0')
RA1/AN1
RA2/AN2
A
A
-
+
C1
VIN-
V
IN+
Off
(Read as '0')
RA0/AN0
RA3/AN3
D
D
CM<2:0> = 111
-
+
C2
VIN-
V
IN+
Off
(Read as '0')
RA1/AN1
RA2/AN2
D
D
-
+
C1
VIN-
V
IN+
C1OUT
RA0/AN0
RA3/AN3
A
A
-
+
C2
VIN-
V
IN+
C2OUT
RA1/AN1
RA2/AN2
A
A
CM<2:0> = 100
-
+
C1
VIN-
V
IN+
C1OUT
RA0/AN0
RA3/AN3
A
A
-
+
C2
VIN-
V
IN+
C2OUT
RA1/AN1
RA2/AN2
A
A
From VREF Module
-
+
C1
VIN-
V
IN+
C1OUT
RA0/AN0
RA3/AN3
A
D
-
+
C2
VIN-
V
IN+
C2OUT
RA1/AN1
RA2/AN2
A
A
CM<2:0> = 011
RA4 Open Drain
-
+
C1
VIN-
V
IN+
C1OUT
RA0/AN0
RA3/AN3
A
D
-
+
C2
VIN-
V
IN+
C2OUT
RA1/AN1
RA2/AN2
A
A
CM<2:0> = 110
-
+
C1
VIN-
V
IN+
Off
(Read as '0')
RA0/AN0
RA3/AN3
D
D
CM<2:0> = 101
-
+
C2
VIN-
V
IN+
C2OUT
RA1/AN1
RA2/AN2
A
A
-
+
C1
VIN-
V
IN+
C1OUT
RA0/AN0
RA3/AN3
A
A
-
+
C2
VIN-
V
IN+
C2OUT
RA1/AN1
RA2/AN2
A
A
CM<2:0> = 001
CIS=0
CIS=1
Comparators Reset
Two Independent Comparators
Two Common Reference Comparators
One Independent Comparator
Three Inputs Multiplexed to
Two Common Reference Comparators with Outputs
Four Inputs Multiplexed to
Comparators Off
Two Comparators
Two Comparators
CM<2:0> = 010
CIS=0
CIS=1
CIS=0
CIS=1
A = Analog Input, Port Reads Zeros Always
D = Digital Input
CIS = CMCON<3>, Comparator Input Switch