Microchip Technology MCP1631RD-MCC2 Data Sheet

Page of 338
 2006-2012 Microchip Technology Inc.
DS41291G-page 93
PIC16F882/883/884/886/887
8.5
Operation During Sleep
The comparator, if enabled before entering Sleep mode,
remains active during Sleep. The additional current
consumed by the comparator is shown separately in the
. If the
comparator is not used to wake the device, power
consumption can be minimized while in Sleep mode by
turning off the comparator. Each comparator is turned off
by clearing the CxON bit of the CMxCON0 register.
A change to the comparator output can wake-up the
device from Sleep. To enable the comparator to wake
the device from Sleep, the CxIE bit of the PIE2 register
and the PEIE bit of the INTCON register must be set.
The instruction following the Sleep instruction always
executes following a wake from Sleep. If the GIE bit of
the INTCON register is also set, the device will then
execute the Interrupt Service Routine.
8.6
Effects of a Reset
A device Reset forces the CMxCON0 and CM2CON1
registers to their Reset states. This forces both
comparators and the voltage references to their Off
states.
REGISTER DEFINITIONS: COMPARATOR C1
REGISTER 8-1:
CM1CON0: COMPARATOR C1 CONTROL REGISTER 0
R/W-0
R-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
R/W-0
C1ON
C1OUT
C1OE
C1POL
C1R
C1CH1
C1CH0
bit 7
bit 0
Legend:
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
C1ON: Comparator C1 Enable bit
1 = Comparator C1 is enabled
0 = Comparator C1 is disabled
bit 6
C1OUT: Comparator C1 Output bit
If C1POL = 1 (inverted polarity):
C1OUT = 0 when C1V
IN
+ > C1V
IN
-
C1OUT = 1 when C1V
IN
+ < C1V
IN
-
If C1POL = 0 (non-inverted polarity):
C1OUT = 1 when C1V
IN
+ > C1V
IN
-
C1OUT = 0 when C1V
IN
+ < C1V
IN
-
bit 5
C1OE: Comparator C1 Output Enable bit
1 = C1OUT is present on the C1OUT pin
(1)
 
0 = C1OUT is internal only
bit 4
C1POL: Comparator C1 Output Polarity Select bit
1 = C1OUT logic is inverted
0 = C1OUT logic is not inverted
bit 3
Unimplemented: Read as ‘0’
bit 2
C1R: Comparator C1 Reference Select bit (non-inverting input)
1 = C1V
IN
+ connects to C1V
REF
 output
0 = C1V
IN
+ connects to C1IN+ pin
bit 1-0
C1CH<1:0>: Comparator C1 Channel Select bit
00 = C12IN0- pin of C1 connects to C1V
IN
-
01 = C12IN1- pin of C1 connects to C1V
IN
-
10 = C12IN2- pin of C1 connects to C1V
IN
-
11 = C12IN3- pin of C1 connects to C1V
IN
-
Note 1:
Comparator output requires the following three conditions: C1OE = 1, C1ON = 1 and corresponding port 
TRIS bit = 0.