English
Language : 

PIC18F6390 Datasheet, PDF (244/412 Pages) Microchip Technology – 64/80-Pin Flash Microcontrollers with LCD Driver and nanoWatt Technology
PIC18F6390/6490/8390/8490
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 com-
parator 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
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/ A
SEG24
RF5/AN10/ A
CVREF/SEG23
VIN-
VIN+ C1
Off (Read as ‘0’)
RF6/AN11/ D
SEG24
RF5/AN10/ D
CVREF/SEG23
VIN-
VIN+ C1
Off (Read as ‘0’)
RF4/AN9/ A
SEG22
RF3/AN8/ A
SEG21
VIN-
VIN+ C2
Off (Read as ‘0’)
RF4/AN9/ D
SEG22
RF3/AN8/ D
SEG21
VIN-
VIN+ C2
Off (Read as ‘0’)
Two Independent Comparators
CM2:CM0 = 010
RF6/AN11/ A
SEG24
RF5/AN10/ A
CVREF/SEG23
VIN-
VIN+ C1
RF4/AN9/ A
SEG22
RF3/AN8/ A
SEG21
VIN-
VIN+ C2
C1OUT
C2OUT
Two Independent Comparators with Outputs
CM2:CM0 = 011
RF6/AN11/ A
SEG24
RF5/AN10/ A
CVREF/SEG23
VIN-
VIN+ C1
C1OUT
RF2/AN7/C1OUT*/SEG20
RF4/AN9/
SEG22
A
RF3/AN8/
SEG21
A
VIN-
VIN+ C2
C2OUT
RF1/AN6/C2OUT*/SEG19
Two Common Reference Comparators
CM2:CM0 = 100
RF6/AN11/ A
SEG24
RF5/AN10/ A
CVREF/SEG23
VIN-
VIN+ C1
C1OUT
RF4/AN9/
SEG22
A
RF3/AN8/
SEG21
D
VIN-
VIN+ C2
C2OUT
Two Common Reference Comparators with Outputs
CM2:CM0 = 101
RF6/AN11/
A
SEG24
RF5/AN10/
A
CVREF/SEG23
VIN-
VIN+ C1
C1OUT
RF2/AN7/C1OUT*/SEG20
RF4/AN9/
SEG22
RF3/AN8/
SEG21
A
VIN-
D
VIN+ C2
RF1/AN6/C2OUT*/SEG19
C2OUT
One Independent Comparator with Output
CM2:CM0 = 001
RF6/AN11/ A
SEG24
RF5/AN10/ A
CVREF/SEG23
VIN-
VIN+ C1
C1OUT
RF2/AN7/C1OUT*/SEG20
RF4/AN9/ D
SEG22
RF3/AN8/ D
SEG21
VIN-
VIN+ C2
Off (Read as ‘0’)
Four Inputs Multiplexed to Two Comparators
CM2:CM0 = 110
RF6/AN11/ A
SEG24
RF5/AN10/ A
CVREF/SEG23
CIS = 0
CIS = 1
VIN-
VIN+ C1
RF4/AN9/ A
SEG22
RF3/AN8/ A
SEG21
CIS = 0
CIS = 1
VIN-
VIN+ C2
C1OUT
C2OUT
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.
DS39629B-page 242
Preliminary
 2004 Microchip Technology Inc.