English
Language : 

PIC18F87J11_12 Datasheet, PDF (319/466 Pages) Microchip Technology – 64/80-Pin, High-Performance, 1-Mbit Flash Microcontrollers
PIC18F87J11 FAMILY
23.0 COMPARATOR MODULE
The analog comparator module contains two compara-
tors that can be independently configured in a variety of
ways. The inputs can be selected from the analog
inputs and two internal voltage references. The digital
outputs are available at the pin level and can also be
read through the control register. Multiple output and
interrupt event generation are also available. A generic
single comparator from the module is shown in
Figure 23-1.
Key features of the module includes:
• Independent comparator control
• Programmable input configuration
• Output to both pin and register levels
• Programmable output polarity
• Independent interrupt generation for each
comparator with configurable interrupt-on-change
23.1 Registers
The CMxCON registers (Register 23-1) select the input
and output configuration for each comparator, as well
as the settings for interrupt generation.
The CMSTAT register (Register 23-2) provides the out-
put results of the comparators. The bits in this register
are read-only.
FIGURE 23-1:
COMPARATOR SIMPLIFIED BLOCK DIAGRAM
CCH<1:0>
CxINB
CxINC
CxIND
VIRV
CREF
CxINA
CVREF
0
1(1)
2(1,2)
3
0
1
VIN-
VIN+
–
Cx
CON
Interrupt
Logic
EVPOL<1:0>
Polarity
Logic
CPOL
COE
CxOUT
(CMSTAT<1:0>)
CMxIF
CxOUT
Note 1: Available in 80-pin devices only.
2: Implemented in Comparator 2 only.
 2007-2012 Microchip Technology Inc.
DS39778E-page 319