English
Language : 

PIC18F26K80-I Datasheet, PDF (373/622 Pages) Microchip Technology – 28/40/44/64-Pin, Enhanced Flash Microcontrollers with ECAN™ and nanoWatt XLP Technology
PIC18F66K80 FAMILY
24.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 24-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
24.1 Registers
The CMxCON registers (CM1CON and CM2CON)
select the input and output configuration for each com-
parator, as well as the settings for interrupt generation
(see Register 24-1).
The CMSTAT register (Register 24-2) provides the out-
put results of the comparators. The bits in this register
are read-only.
FIGURE 24-1:
COMPARATOR SIMPLIFIED BLOCK DIAGRAM
CCH<1:0>
CxINB
0
CxINC
1
C2INB/C2IND(1)
2
VBG
3
CREF
CxINA
0
CVREF
1
VIN-
VIN+ Cx
CON
Interrupt
Logic
EVPOL<1:0>
Polarity
Logic
COE
CPOL
CMPxOUT
(CMSTAT<7:6>)
CMPxIF
CxOUT
Note 1: Comparator 1 uses C2INB as an input to the inverted terminal.
Comparator 2 uses C1INB as an input to the inverted terminal.
 2010-2012 Microchip Technology Inc.
DS39977F-page 373