
2004 Microchip Technology Inc.
Preliminary
DS41249A-page 65
PIC16F785
REGISTER 9-2:
COMPARATOR C2 CONTROL REGISTER 0 (CM2CON0: 11AH)
R/W-0
C2ON
bit 7
R-0
R/W-0
C2OE
R/W-0
C2POL
R/W-0
C2SP
R/W-0
C2R
R/W-0
C2CH1
R/W-0
C2CH0
C2OUT
bit 0
bit 7
C2ON:
Comparator C2 Enable bit
1
= C2 Comparator is enabled
0
= C2 Comparator is disabled
C2OUT:
Comparator C2 Output bit
If C2POL =
1
(inverted polarity):
C2OUT =
1
, C2VP < C2VN
C2OUT =
0
, C2VP > C2VN
If C2POL =
0
(non-inverted polarity):
C2OUT =
1
, C2VP > C2VN
C2OUT =
0
, C2VP < C2VN
C2OE:
Comparator C2 Output Enable bit
1
= C2OUT is present on RC4/C2OUT/PH2
(1)
0
= C2OUT is internal only
C2POL:
Comparator C2 Output Polarity Select bit
1
= C2OUT logic is inverted
0
= C2OUT logic is not inverted
C2SP:
Comparator C2 Speed Select bit
1
= C2 operates in normal speed mode
0
= C2 operates in low power, slow speed mode.
C2R:
Comparator C2 Reference Select bits (non-inverting input)
1
= C2VP connects to C2V
REF
0
= C2VP connects to RC0/AN4/C2IN+
C2CH<1:0>:
Comparator C2 Channel Select bits
00
= C2VN of C2 connects to RA1/AN1/C12IN0-/V
REF
/ICSPCLK
01
= C2VN of C2 connects to RC1/AN5/C12IN1-/PH1
10
= C2VN of C2 connects to RC2/AN6/C12IN2-/OP2
11
= C2VN of C2 connects to RC3/AN7/C12IN3-/OP1
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1-0
Note 1:
C2OUT will only drive RC4/C2OUT/PH2 if:
(C2OE = 1) & (C2ON = 1) & (TRISC<4> = 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