English
Language : 

PIC16F526 Datasheet, PDF (56/122 Pages) Microchip Technology – 14-Pin, 8-Bit Flash Microcontroller
PIC16F526
8.9 Power-down Mode (Sleep)
A device may be powered down (Sleep) and later
powered up (wake-up from Sleep).
8.9.1 SLEEP
The Power-Down mode is entered by executing a
SLEEP instruction.
If enabled, the Watchdog Timer will be cleared but
keeps running, the TO bit of the STATUS register is set,
the PD bit of the STATUS register is cleared and the
oscillator driver is turned off. The I/O ports maintain the
status they had before the SLEEP instruction was exe-
cuted (driving high, driving low or high-impedance).
Note: A Reset generated by a WDT time-out
does not drive the MCLR pin low.
For lowest current consumption while powered down,
the T0CKI input should be at VDD or VSS and the RB3/
MCLR/VPP pin must be at a logic high level if MCLR is
enabled.
8.9.2 WAKE-UP FROM SLEEP
The device can wake-up from Sleep through one of
the following events:
1. An external Reset input on RB3/MCLR/VPP pin,
when configured as MCLR.
2. A Watchdog Timer Time-out Reset (if WDT was
enabled).
3. A change on input pin RB0, RB1, RB3 or RB4
when wake-up on change is enabled.
4. A change in one of the comparator output bits,
C1OUT or C2OUT (if comparator wake-up is
enabled).
These events cause a device Reset. The TO, PD and
CWUF/RBWUF bits can be used to determine the
cause of device Reset. The TO bit is cleared if a WDT
time-out occurred (and caused wake-up). The PD bit,
which is set on power-up, is cleared when SLEEP is
invoked. The CWUF bit indicates a change in a com-
parator output state while the device was in Sleep. The
RBWUF bit indicates a change in state while in Sleep
at pins RB0, RB1, RB3 or RB4 (since the last file or bit
operation on RB port).
Note:
Caution: Right before entering Sleep,
read the input pins. When in Sleep,
wake-up occurs when the values at the
pins change from the state they were in at
the last reading. If a wake-up on change
occurs and the pins are not read before
re-entering Sleep, a wake-up will occur
immediately even if no pins change while
in Sleep mode.
The WDT is cleared when the device wakes from
Sleep, regardless of the wake-up source.
Note:
Caution: Right before entering Sleep,
read the comparator Configuration
register(s) CM1CON0 and CM2CON0.
When in Sleep, wake-up occurs when the
comparator output bit C1OUT and C2OUT
change from the state they were in at the
last reading. If a wake-up on comparator
change occurs and the pins are not read
before re-entering Sleep, a wake-up will
occur immediately, even if no pins change
while in Sleep mode.
DS41326D-page 56
 2010 Microchip Technology Inc.