English
Language : 

PIC18F97J60_11 Datasheet, PDF (350/492 Pages) Microchip Technology – 64/80/100-Pin, High-Performance, 1-Mbit Flash Microcontrollers with Ethernet
PIC18F97J60 FAMILY
23.1 Comparator Configuration
There are eight modes of operation for the compara-
tors, shown in Figure 23-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 23-1:
COMPARATOR I/O OPERATING MODES
Comparator Outputs Disabled
CM<2:0> = 000
RF6/AN11 A
VIN-
RF5/AN10/ A
CVREF
VIN+ C1
Off (Read as ‘0’)
Comparators Off (POR Default Value)
CM<2:0> = 111
RF6/AN11 D
RF5/AN10/ D
CVREF
VIN-
VIN+ C1
Off (Read as ‘0’)
RF4/AN9 A
RF3/AN8 A
VIN-
VIN+ C2
Off (Read as ‘0’)
RF4/AN9 D
RF3/AN8 D
VIN-
VIN+ C2
Off (Read as ‘0’)
Two Independent Comparators
CM<2:0> = 010
RF6/AN11 A
RF5/AN10/ A
CVREF
VIN-
VIN+ C1
RF4/AN9 A
RF3/AN8 A
VIN-
VIN+ C2
C1OUT
C2OUT
Two Independent Comparators with Outputs
CM<2:0> = 011
RF6/AN11 A
RF5/AN10/ A
CVREF
VIN-
VIN+ C1
C1OUT
RF2/AN7/C1OUT*
RF4/AN9 A
RF3/AN8 A
VIN-
VIN+ C2
RF1/AN6/C2OUT*
C2OUT
Two Common Reference Comparators
CM<2:0> = 100
RF6/AN11 A
RF5/AN10/ A
CVREF
VIN-
VIN+ C1
C1OUT
RF4/AN9 A
RF3/AN8 D
VIN-
VIN+ C2
C2OUT
Two Common Reference Comparators with Outputs
CM<2:0> = 101
RF6/AN11 A
VIN-
RF5/AN10/ A
CVREF
VIN+ C1
RF2/AN7/C1OUT*
C1OUT
RF4/AN9 A
VIN-
RF3/AN8
D
VIN+ C2
RF1/AN6/C2OUT*
C2OUT
One Independent Comparator with Output
CM<2:0> = 001
RF6/AN11 A
RF5/AN10/ A
CVREF
VIN-
VIN+ C1
RF2/AN7/C1OUT*
C1OUT
RF4/AN9 D
RF3/AN8 D
VIN-
VIN+ C2
Off (Read as ‘0’)
Four Inputs Multiplexed to Two Comparators
CM<2:0> = 110
RF6/AN11 A
RF5/AN10/ A
CVREF
CIS = 0
CIS = 1
VIN-
VIN+ C1
RF4/AN9 A
RF3/AN8 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.
DS39762F-page 350
 2011 Microchip Technology Inc.