PIC16F62X
mode is changed, the comparator output level may not
be valid for the specified mode change delay shown
in Table 12-2.
9.1
Comparator Configuration
There are eight modes of operation for the
comparators. The CMCON register is used to select
the mode. Figure 9-1 shows the eight possible modes.
The TRISA register controls the data direction of the
comparator pins for each mode. If the comparator
Note: Comparator interrupts should be disabled
during a comparator mode change other-
wise a false interrupt may occur.
FIGURE 9-1: COMPARATOR I/O OPERATING MODES
Comparators Reset (POR Default Value)
CM2:CM0 = 000
Comparators Off
CM2:CM0 = 111
D
D
Vin-
A
A
Vin-
RA0/AN0
RA0/AN0
Off (Read as ’0’)
Off (Read as ’0’)
C1
C2
Off (Read as ’0’)
Off (Read as ’0’)
C1
C2
Vin+
Vin+
RA3/AN3/C10
RA3/AN3/C10
A
A
Vin-
D
D
Vin-
RA1/AN1
RA2/AN2
RA1/AN1
RA2/AN2
Vin+
Vin+
Four Inputs Multiplexed to Two Comparators
CM2:CM0 = 010
Two Independent Comparators
CM2:CM0 = 100
A
RA0/AN0
A
A
Vin-
CIS = 0
CIS = 1
Vin-
RA0/AN0
A
RA3/AN3/C10
C1OUT
C2OUT
C1
Vin+
C1OUT
C1
C2
Vin+
RA3/AN3/C10
A
A
RA1/AN1
RA2/AN2
Vin-
CIS = 0
CIS = 1
A
A
Vin-
RA1/AN1
RA2/AN2
C2OUT
Vin+
C2
Vin+
From Vref Module
Two Common Reference Comparators
CM2:CM0 = 011
Two Common Reference Comparators with Outputs
CM2:CM0 = 110
A
Vin-
RA0/AN0
A
D
Vin-
RA0/AN0
C1OUT
C1
Vin+
D
C1OUT
C2OUT
C1
C2
RA3/AN3/C10
Vin+
RA3/AN3/C10
A
A
Vin-
RA1/AN1
RA2/AN2
A
A
Vin-
RA1/AN1
RA2/AN2
C2OUT
C2
Vin+
Vin+
Open Drain
RA4/T0CKI/C20
One Independent Comparator
CM2:CM0 = 101
Three Inputs Multiplexed to Two Comparators
CM2:CM0 = 001
D
D
Vin-
RA0/AN0
A
RA0/AN0
CIS = 0
CIS = 1
Vin-
Off (Read as ’0’)
C2OUT
C1
Vin+
RA3/AN3/C10
A
RA3/AN3/C10
C1OUT
C2OUT
C1
C2
Vin+
A
A
Vin-
RA1/AN1
RA2/AN2
A
A
Vin-
RA1/AN1
RA2/AN2
C2
Vin+
Vin+
A = Analog Input, port reads zeros always.
D = Digital Input.
CIS (CMCON<3>) is the Comparator Input Switch.
DS40300B-page 58
Preliminary
1999 Microchip Technology Inc.