English
Language : 

PIC18F87J90 Datasheet, PDF (300/450 Pages) Microchip Technology – 64/80-Pin, High-Performance Microcontrollers with LCD Driver and nanoWatt Technology
PIC18F87J90 FAMILY
22.1 Comparator Configuration
There are eight modes of operation for the compara-
tors, shown in Figure 22-1. Bits, CM<2:0>, 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
mode is changed, the comparator output level may not
be valid for the specified mode change delay shown in
Section 28.0 “Electrical Characteristics”.
Note:
Comparator interrupts should be disabled
during a Comparator mode change;
otherwise, a false interrupt may occur.
FIGURE 22-1:
COMPARATOR I/O OPERATING MODES
Comparator Outputs Disabled
CM<2:0> = 000
Comparators Off (POR Default Value)
CM<2:0> = 111
C1INA A
C1INB A
VIN-
VIN+ C1
Off (Read as ‘0’)
C1INA D
C1INB D
VIN-
VIN+ C1
Off (Read as ‘0’)
C2INA A
C2INB A
VIN-
VIN+ C2
Off (Read as ‘0’)
C2INA D
C2INB D
VIN-
VIN+ C2
Off (Read as ‘0’)
Two Independent Comparators
CM<2:0> = 010
C1INA A
VIN-
C1INB A
VIN+ C1
C2INA A
C2INB A
VIN-
VIN+ C2
C1OUT
C2OUT
Two Independent Comparators with Outputs
CM<2:0> = 011
C1INA A
VIN-
C1INB A
VIN+ C1
C1OUT
RF2/AN7/C1OUT*/SEG20
C2INA A
C2INB A
VIN-
VIN+ C2
RF1/AN6/C2OUT*/SEG19
C2OUT
Two Common Reference Comparators
CM<2:0> = 100
C1INA A
VIN-
C1INB A
VIN+ C1
C1OUT
Two Common Reference Comparators with Outputs
CM<2:0> = 101
C1INA A
VIN-
C1INB A
VIN+ C1
C1OUT
C2INA A
C2INB D
VIN-
VIN+ C2
C2OUT
RF2/AN7/C1OUT*/
SEG20
C2INA A
C2INB D
VIN-
VIN+ C2
C2OUT
RF1/AN6/C2OUT*/SEG19
One Independent Comparator with Output
CM<2:0> = 001
C1INA A
C1INB A
VIN-
VIN+ C1
C1OUT
RF2/AN7/C1OUT*/SEG20
C2INA D
C2INB D
VIN-
VIN+ C2
Off (Read as ‘0’)
Four Inputs Multiplexed to Two Comparators
CM<2:0> = 110
C1INA A
C1INB A
CIS = 0
CIS = 1
VIN-
VIN+ C1
C2INA A
C2INB A
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.
DS39933D-page 300
 2010 Microchip Technology Inc.