1.6.3 The Device May Not Wake From Sleep When Using the MF Internal Oscillator
The device may not wake up from Sleep mode when using the Medium-Frequency Internal Oscillator (MFINTOSC) as the system clock.
Work around
To ensure the device wakes up from Sleep, Use one of the following work arounds:
- Use the Low-Frequency Internal Oscillator (LFINTOSC) instead of the MFINTOSC.
- If the MFINTOSC must be used
as the system clock:
- Switch to the
LFINTOSC before executing the
SLEEP
command - Upon wake-up, switch to the 500 kHz MFINTOSC
- Wait for the oscillator start-up time to expire (approximately 2 μs)
- Check the MFIOFR status bit to ensure the MFINTOSC started up
- If the MFIOFR bit is clear, switch to the 500 kHz HFINTOSC
- Wait for the oscillator start-up time to expire (approximately 2 μs)
- When the HFIOFR bit is set, switch back to the 500 kHz MFINTOSC
- Switch to the
LFINTOSC before executing the
OSCCONbits.IRCF = 0x0; // Select the LFINTOSC SLEEP(); NOP(); NOP(); OSCCONbits.IRCF = 0x7; // Select the 500 kHz MFINTOSC __delay_us(2); // Oscillator start-up delay if(OSCSTATbits.MFIOFR == 0) { OSCCONbits.IRCF = 0xA; // Switch to the 500 kHz HFINTOSC } __delay_us(2); // Oscillator start-up delay if(OSCSTATbits.HFIOFR == 1) { OSCCONbits.IRCF = 0x7; // Switch back to the 500 kHz MFINTOSC }
Affected Silicon Revisions
A2 | A3 | A5 | A6 | A7 | A8 | A9 | |
X | X | X | X | X | X | X |