Microchip Technology MCU PIC PIC18F87K22-I/PTRSL TQFP-80 MCP PIC18F87K22-I/PTRSL Data Sheet
Product codes
PIC18F87K22-I/PTRSL
PIC18F87K22 FAMILY
DS39960D-page 368
2009-2011 Microchip Technology Inc.
REGISTER 24-1:
CMxCON: COMPARATOR CONTROL x REGISTER
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
CON
COE
CPOL
EVPOL1
EVPOL0
CREF
CCH1
CCH0
bit 7
bit 0
Legend:
R = Readable bit
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
CON:
Comparator Enable bit
1
= Comparator is enabled
0
= Comparator is disabled
bit 6
COE:
Comparator Output Enable bit
1
= Comparator output is present on the CxOUT pin
0
= Comparator output is internal only
bit 5
CPOL:
Comparator Output Polarity Select bit
1
= Comparator output is inverted
0
= Comparator output is not inverted
bit 4-3
EVPOL<1:0>:
Interrupt Polarity Select bits
11
= Interrupt generation on any change of the output
(
)
10
= Interrupt generation only on high-to-low transition of the output
01
= Interrupt generation only on low-to-high transition of the output
00
= Interrupt generation is disabled
bit 2
CREF:
Comparator Reference Select bit (non-inverting input)
1
= Non-inverting input connects to internal CV
REF
voltage
0
= Non-inverting input connects to CxINA pin
bit 1-0
CCH<1:0>:
Comparator Channel Select bits
11
= Inverting input of comparator connects to V
BG
10
= Inverting input of comparator connects to C2INB or C2IND pin
,
)
01
= Inverting input of comparator connects to CxINC pin
00
= Inverting input of comparator connects to CxINB pin
Note 1:
The CMPxIF bit is automatically set any time this mode is selected and must be cleared by the application
after the initial configuration.
after the initial configuration.
2:
Comparators, 1 and 3, use C2INB as an input to the inverting terminal. Comparator 2 uses C2IND.
3:
C1INC, C2INC and C2IND are all unavailable for 64-pin devices (PIC18F6XK22).