PIC16F7X7
13.7
Comparator Operation
During Sleep
13.9
Analog Input Connection
Considerations
When a comparator is active and the device is placed
in Sleep mode, the comparator remains active and the
interrupt is functional if enabled. This interrupt will
wake-up the device from Sleep mode when enabled.
While the comparator is powered up, higher Sleep
currents than shown in the power-down current
specification will occur. Each operational comparator
will consume additional current as shown in the com-
parator specifications. To minimize power consumption
while in Sleep mode, turn off the comparators
(CM<2:0> =
111)
before entering Sleep. If the device
wakes up from Sleep, the contents of the CMCON
register are not affected.
A simplified circuit for an analog input is shown in
digital output, they have reverse biased 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 condition may
occur. A maximum source impedance of 10 kΩ is
recommended for the analog sources. Any external
component connected to an analog input pin, such as
a capacitor or a Zener diode, should have very little
leakage current.
13.8
Effects of a Reset
A device Reset forces the CMCON register to its Reset
state, causing the comparator module to be in the
Comparator Off mode, CM<2:0> =
111.
This ensures
compatibility to the PIC16F87X devices.
FIGURE 13-4:
ANALOG INPUT MODEL
V
DD
R
S
< 10K
A
IN
V
T
= 0.6V
R
IC
VA
C
PIN
5 pF
V
T
= 0.6V
I
LEAKAGE
±500 nA
V
SS
Legend:
C
PIN
V
T
I
LEAKAGE
R
IC
R
S
VA
=
=
=
=
=
=
Input Capacitance
Threshold Voltage
Leakage Current at the pin due to various junctions
Interconnect Resistance
Source Impedance
Analog Voltage
TABLE 13-1:
Address
9Ch
9Dh
REGISTERS ASSOCIATED WITH COMPARATOR MODULE
Bit 7
C2OUT
GIE
OSFIF
OSFIE
RA7
Bit 6
C1OUT
CVROE
PEIE
CMIF
CMIE
RA6
Bit 5
C2INV
CVRR
Bit 4
C1INV
—
Bit 3
CIS
CVR3
RBIE
BCLIF
BCLIE
RA3
Bit 2
CM2
CVR2
TMR0IF
—
—
RA2
Bit 1
CM1
CVR1
INT0IF
CCP3IF
RA1
Bit 0
CM0
CVR0
RBIF
CCP2IF
RA0
Value on
POR
Value on
all other
Resets
Name
CMCON
0000 0111 0000 0111
000- 0000 000- 0000
0000 000x 0000 000u
000- 0-00 000- 0-00
000- 0-00 000- 0-00
xx0x 0000 uu0u 0000
1111 1111 1111 1111
CVRCON CVREN
0Bh, 8Bh, INTCON
10Bh,18Bh
0Dh
8Dh
05h
85h
Legend:
PIR2
PIE2
PORTA
TRISA
TMR0IE INT0IE
LVDIF
LVDIE
RA5
—
—
RA4
CCP3IE CCP2IE
PORTA Data Direction Register
x
= unknown,
u
= unchanged, — = unimplemented, read as ‘0’. Shaded cells are unused by the comparator module.
2004 Microchip Technology Inc.
DS30498C-page 165