Microchip Technology MA160014 Data Sheet

Page of 560
 2010-2012 Microchip Technology Inc.
DS41412F-page 315
PIC18(L)F2X/4XK22
18.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
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/GIEL bit of the INTCON register must be
set. The instruction following the SLEEP instruction
always executes following a wake from Sleep. If the
GIE/GIEH bit of the INTCON register is also set, the
device will then execute the Interrupt Service Routine.
18.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.Comparator Control Registers.
18.7
Analog Input Connection 
Considerations
A simplified circuit for an analog input is shown in
. Since the analog input pins share their
connection with a digital input, they have reverse
biased ESD protection diodes to V
DD
 and V
SS
. The
analog input, therefore, must be between V
SS
 and V
DD
.
If the input voltage deviates from this range by more
than 0.6V in either direction, one of the diodes is
forward biased and a latch-up may occur.
A maximum source impedance of 10 k
 is recommended
for the analog sources. Also, any external component
connected to an analog input pin, such as a capacitor or
a Zener diode, should have very little leakage current to
minimize inaccuracies introduced.
FIGURE 18-5:
ANALOG INPUT MODEL 
Note 1: When reading a PORT register, all pins
configured as analog inputs will read as a
‘0’. Pins configured as digital inputs will
convert as an analog input, according to
the input specification.
2: Analog levels on any pin defined as a
digital input, may cause the input buffer to
consume more current than is specified.
V
A
Rs < 10K
C
PIN
5 pF
V
DD
V
T
 
 0.6V
V
T
 
 0.6V
R
IC
I
LEAKAGE
(1)
Vss
A
IN
Legend: C
PIN
= Input Capacitance
I
LEAKAGE
= Leakage Current at the pin due to various junctions
R
IC
= Interconnect Resistance
R
S
= Source Impedance
V
A
= Analog Voltage
V
T
= Threshold Voltage
Note 1: See 
To Comparator