English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (532/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
23.5.4
WAKE-UP FROM SLEEP MODE
WITH CRYSTAL OSCILLATOR
OR PLL
If the system clock source is derived from a crystal
oscillator and/or the PLL, then the Oscillator Start-up
Timer (OST) and/or PLL lock times will be applied
before the system clock source is made available to the
device. As an exception to this rule, no oscillator delays
are applied if the system clock source is the POSC
oscillator and it was running while in SLEEP mode.
Note:
In spite of the various delays applied the
crystal oscillator (and PLL) may not be up
and running at the end of the TOST, or
TLOCK delays. For proper operation the
user must design the external oscillator
circuit such that reliable oscillation will
occur within the delay period.
23.5.5 FAIL-SAFE CLOCK MONITOR
DELAY AND SLEEP MODE
The Fail-Safe Clock Monitor (FSCM) does not operate
while the device is in SLEEP. If the FSCM is enabled it
will resume operation when the device wakes from
Sleep.
23.5.6 SLOW OSCILLATOR START-UP
When an oscillator starts slowly, the OST and PLL lock
times may not have expired before FSCM times out.
If the FSCM is enabled, then the device will detect this
condition as a clock failure and a clock event trap will
occur. The device will switch to the FRC oscillator and
the user can re-enable the crystal oscillator source in
the clock failure Interrupt Service Routine.
If the FSCM is not enabled, then the device will simply
not start executing code until the clock is stable. From
the user’s perspective, the device will appear to be in
SLEEP until the oscillator clock has started.
23.5.6.1 The USB peripheral control of
Oscillators in Sleep mode
For devices with a USB peripheral, POSC and FRC will
remain active in Sleep if the USB module is not dis-
abled prior to entering Sleep. The Oscillators remain-
ing active will not stop the halting of the CPU or
peripherals in Sleep.
EXAMPLE 23-1: PUT DEVICE IN SLEEP, THEN WAKE WITH WDT
// Code example to put the Device in sleep and then Wake the device
// with the WDT
OSCCONSET = 0x10;
// set Power-Saving mode to Sleep
WDTCONCLR = 0x0002;
WDTCONSET = 0x8000;
// Disable WDT window mode
// Enable WDT
// WDT timeout period is set in the device configuration
while (1)
{
... user code ...
WDTCONSET = 0x01; // service the WDT
asm volatile ( “wait” );// put device in selected Power-Saving mode
// code execution will resume here after wake
... user code ...
}
// The following code fragment is at the beginning of the ‘C’ start-up code
if ( RCON & 0x18 )
{
// The WDT caused a wake from Sleep
asm volatile ( “eret” );// return from interrupt
}
DS61143E-page 530
Preliminary
© 2008 Microchip Technology Inc.