PIC16C62X
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.
Note:
Comparator interrupts should be disabled
during a Comparator mode change other-
wise a false interrupt may occur.
FIGURE 7-1:
COMPARATOR I/O OPERATING MODES
A
RA0/AN0
A
RA3/AN3
A
RA1/AN1
A
RA2/AN2
VIN- -
VIN+ + C1
VIN- -
VIN+ + C2
Comparators Reset
A
RA0/AN0
A
RA3/AN3
A
RA1/AN1
A
RA2/AN2
VIN- -
VIN+ + C1
VIN- -
VIN+ + C2
Two Independent Comparators
Off
(Read as '0')
Off
(Read as '0')
CM<2:0> = 000
C1OUT
C2OUT
CM<2:0> = 100
A
RA0/AN0
D
RA3/AN3
VIN- -
VIN+ + C1
C1OUT
A
RA1/AN1
A
RA2/AN2
VIN- -
VIN+ + C2
C2OUT
CM<2:0> = 011
Two Common Reference Comparators
D
RA0/AN0
D
RA3/AN3
A
RA1/AN1
A
RA2/AN2
VIN- -
VIN+ + C1
VIN- -
VIN+ + C2
One Independent Comparator
Off
(Read as '0')
C2OUT
CM<2:0> = 101
A = Analog Input, Port Reads Zeros Always
D = Digital Input
CIS = CMCON<3>, Comparator Input Switch
D
RA0/AN0
D
RA3/AN3
D
RA1/AN1
D
RA2/AN2
VIN- -
VIN+ + C1
VIN- -
VIN+ + C2
Comparators Off
Off
(Read as '0')
Off
(Read as '0')
CM<2:0> = 111
RA0/AN0 A
RA3/AN3 A
RA1/AN1 A
RA2/AN2 A
CIS=0 VIN- -
CIS=1 VIN+ + C1
CIS=0 VIN- -
CIS=1 VIN+ + C2
C1OUT
C2OUT
Four Inputs Multiplexed to
Two Comparators
From VREF Module
CM<2:0> = 010
A
RA0/AN0
D
RA3/AN3
VIN- -
VIN+ + C1
C1OUT
A
RA1/AN1
A
RA2/AN2
VIN- -
VIN+ + C2
RA4 Open Drain
C2OUT
CM<2:0> = 110
Two Common Reference Comparators with Outputs
A
RA0/AN0
A
RA3/AN3
CIS=0
VIN- -
CIS=1
VIN+ +
C1
C1OUT
A
RA1/AN1
A
RA2/AN2
VIN- -
VIN+ + C2
Three Inputs Multiplexed to
Two Comparators
C2OUT
CM<2:0> = 001
DS30235J-page 38
2003 Microchip Technology Inc.