PIC16F7X7
be valid for the specified mode change delay shown in
the electrical specifications (Section 18.0 “Electrical
Characteristics”).
13.1 Comparator Configuration
There are eight modes of operation for the compara-
tors. The CMCON register is used to select these
modes. Figure 13-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
Note:
Comparator interrupts should be disabled
during Comparator mode change.
Otherwise, a false interrupt may occur.
a
FIGURE 13-1:
COMPARATOR I/O OPERATING MODES
Comparators Reset
Comparators Off (POR Default Mode)
CM2:CM0 = 000
CM2:CM0 = 111
A
D
VIN-
VIN-
RA0/AN0
RA0/AN0
Off (Read as ‘0’)
Off (Read as ‘0’)
Off (Read as ‘0’)
Off (Read as ‘0’)
C1
C2
C1
C2
VIN+
VIN+
RA3/AN3/
VREF+
A
D
RA3/AN3/
VREF+
A
A
D
D
VIN-
VIN-
RA1/AN1
RA2/AN2/
RA1/AN1
RA2/AN2/
VIN+
VIN+
VREF-/CVREF
VREF-/CVREF
Two Independent Comparators with Outputs
CM2:CM0 = 011
Two Independent Comparators
CM2:CM0 = 010
A
VIN-
RA0/AN0
A
VIN-
RA0/AN0
C1OUT
C2OUT
C1
C2
VIN+
RA3/AN3/
VREF+
A
C1OUT
C2OUT
C1
C2
VIN+
RA3/AN3/
VREF+
A
RA4/T0CKI/C1OUT
A
A
VIN-
RA1/AN1
RA2/AN2/
A
A
VIN-
RA1/AN1
RA2/AN2/
VIN+
VIN+
VREF-/CVREF
VREF-/CVREF
RA5/AN4/LVDIN/SS/C2OUT
Two Common Reference Comparators
Two Common Reference Comparators with Outputs
CM2:CM0 = 100
CM2:CM0 = 101
A
A
VIN-
VIN-
RA0/AN0
RA0/AN0
C1OUT
C2OUT
C1OUT
C1
C2
C1
C2
VIN+
VIN+
RA3/AN3/
VREF+
A
A
RA3/AN3/
VREF+
RA4/T0CKI/C1OUT
A
D
VIN-
RA1/AN1
RA2/AN2/
A
VIN-
RA1/AN1
VIN+
VREF-/CVREF
C2OUT
VIN+
D
RA2/AN2/
VREF-/CVREF
RA5/AN4/LVDIN/SS/C2OUT
Four Inputs Multiplexed to Two Comparators
One Independent Comparator with Output
CM2:CM0 = 110
CM2:CM0 = 001
A
A
A
VIN-
RA0/AN0
RA0/AN0
CIS = 0
CIS = 1
VIN-
RA3/AN3/
VREF+
A
C1OUT
C1
VIN+
RA3/AN3/
VREF+
C1OUT
C2OUT
C1
C2
VIN+
RA4/T0CKI/C1OUT
A
A
RA1/AN1
RA2/AN2/
VIN-
CIS = 0
CIS = 1
VIN+
D
D
VIN-
VREF-/CVREF
RA1/AN1
RA2/AN2/
Off (Read as ‘0’)
C2
VIN+
CVREF
From Comparator
VREF Module
VREF-/CVREF
A = Analog Input, port reads zeros always D = Digital Input CIS (CMCON<3>) is the Comparator Input Switch
DS30498C-page 162
2004 Microchip Technology Inc.