PIC18F6390/6490/8390/8490
mode is changed, the comparator output level may not
be valid for the specified mode change delay shown in
19.1 Comparator Configuration
There are eight modes of operation for the compara-
tors, shown in Figure 19-1. Bits, CM2:CM0 of the
CMCON register, are used to select these modes. The
TRISF register controls the data direction of the
comparator pins for each mode. If the Comparator
Section 26.0 “Electrical Characteristics”.
Note: Comparator interrupts should be disabled
during
a
Comparator mode change;
otherwise, a false interrupt may occur.
FIGURE 19-1:
COMPARATOR I/O OPERATING MODES
Comparators Reset (POR Default Value)
CM2:CM0 = 000
Comparators Off
CM2:CM0 = 111
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
A
D
VIN-
VIN-
Off (Read as ‘0’)
Off (Read as ‘0’)
Off (Read as ‘0’)
Off (Read as ‘0’)
C1
C2
C1
C2
VIN+
VIN+
A
D
RF4/AN9/
SEG22
RF3/AN8/
SEG21
RF4/AN9/
SEG22
RF3/AN8/
SEG21
A
A
D
D
VIN-
VIN-
VIN+
VIN+
Two Independent Comparators
Two Independent Comparators with Outputs
CM2:CM0 = 010
CM2:CM0 = 011
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
A
A
VIN-
VIN-
C1OUT
C2OUT
C1OUT
C2OUT
C1
C2
C1
C2
VIN+
VIN+
A
A
RF2/AN7/C1OUT*/SEG20
RF4/AN9/
SEG22
RF3/AN8/
SEG21
RF4/AN9/
SEG22
RF3/AN8/
SEG21
A
A
VIN-
A
A
VIN-
VIN+
VIN+
RF1/AN6/C2OUT*/SEG19
Two Common Reference Comparators
Two Common Reference Comparators with Outputs
CM2:CM0 = 100
CM2:CM0 = 101
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
A
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
A
A
VIN-
VIN-
C1OUT
C2OUT
C1OUT
C1
C2
C1
C2
VIN+
VIN+
A
RF2/AN7/C1OUT*/SEG20
RF4/AN9/
SEG22
RF3/AN8/
SEG21
A
D
VIN-
RF4/AN9/
SEG22
RF3/AN8/
SEG21
A
D
VIN-
VIN+
C2OUT
VIN+
RF1/AN6/C2OUT*/SEG19
Four Inputs Multiplexed to Two Comparators
One Independent Comparator with Output
CM2:CM0 = 110
CM2:CM0 = 001
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
A
RF6/AN11/
SEG24
RF5/AN10/
CVREF/SEG23
A
VIN-
CIS = 0
CIS = 1
VIN-
A
C1OUT
C1
VIN+
A
C1OUT
C1
C2
VIN+
RF4/AN9/
SEG22
RF3/AN8/
SEG21
A
A
RF2/AN7/C1OUT*/SEG20
VIN-
CIS = 0
CIS = 1
C2OUT
RF4/AN9/
VIN+
D
D
VIN-
SEG22
Off (Read as ‘0’)
C2
RF3/AN8/
SEG21
VIN+
CVREF
From VREF Module
A = Analog Input, port reads zeros always
D = Digital Input
CIS (CMCON<3>) is the Comparator Input Switch
* Setting the TRISF<2:1> bits will disable the comparator outputs by configuring the pins as inputs.
DS39629C-page 242
© 2007 Microchip Technology Inc.