English
Language : 

PIC18LF2X_13 Datasheet, PDF (317/560 Pages) Microchip Technology – PIC18(L)F2X/45K50 USB Flash MCU Product Brief
PIC18(L)F2X/4XK22
18.9 Register Definitions: Comparator Control
REGISTER 18-1: CMxCON0: COMPARATOR x CONTROL REGISTER
R/W-0
R-0
R/W-0
R/W-0
R/W-1
R/W-0
CxON
CxOUT
CxOE
CxPOL
CxSP
CxR
bit 7
R/W-0
R/W-0
CxCH<1:0>
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1-0
CxON: Comparator Cx Enable bit
1 = Comparator Cx is enabled
0 = Comparator Cx is disabled
CxOUT: Comparator Cx Output bit
If CxPOL = 1 (inverted polarity):
CxOUT = 0 when CxVIN+ > CxVIN-
CxOUT = 1 when CxVIN+ < CxVIN-
If CxPOL = 0 (non-inverted polarity):
CxOUT = 1 when CxVIN+ > CxVIN-
CxOUT = 0 when CxVIN+ < CxVIN-
CxOE: Comparator Cx Output Enable bit
1 = CxOUT is present on the CxOUT pin(1)
0 = CxOUT is internal only
CxPOL: Comparator Cx Output Polarity Select bit
1 = CxOUT logic is inverted
0 = CxOUT logic is not inverted
CxSP: Comparator Cx Speed/Power Select bit
1 = Cx operates in Normal-Power, Higher Speed mode
0 = Cx operates in Low-Power, Low-Speed mode
CxR: Comparator Cx Reference Select bit (non-inverting input)
1 = CxVIN+ connects to CXVREF output
0 = CxVIN+ connects to C12IN+ pin
CxCH<1:0>: Comparator Cx Channel Select bit
00 = C12IN0- pin of Cx connects to CxVIN-
01 = C12IN1- pin of Cx connects to CXVIN-
10 = C12IN2- pin of Cx connects to CxVIN-
11 = C12IN3- pin of Cx connects to CxVIN-
Note 1: Comparator output requires the following three conditions: CxOE = 1, CxON = 1 and corresponding port
TRIS bit = 0.
 2010-2012 Microchip Technology Inc.
DS41412F-page 317