Information

PIC18F87K22 FAMILY
DS80000507F-page 8 2010-2013 Microchip Technology Inc.
7. Module: Ultra Low-Power Sleep
Entering Ultra Low-Power Sleep mode, by
setting RETEN = 0 and SRETEN = 1, will cause
the part to not be programmable through ICSP.
This issue occurs when the RETEN fuse bit in
CONFIG1L<0> is cleared to ‘0’, the SRETEN bit
in the WDTCON register is set to ‘1 and a
SLEEP instruction is executed. This happens
within the first 350 µs of code execution or
whenever the above Sleep mode is entered and
MCLR
is disabled. Discontinue use of the MCLR
disabled RG5 mode if ICSP reprogramming is
necessary.
Work around
Use normal Sleep and Low-Power Sleep modes
only, or on any Reset, ensure that at least
350 µs passes before executing a SLEEP
instruction when ULP is enabled. To ensure the
Ultra Low- Power Sleep mode is not enabled,
the RETEN fuse bit in CONFIG1L<0> should be
set to a ‘1, and the SRETEN bit in the WDTCON
register should be cleared to a ‘0’. The following
code can be used:
//This will ensure the RETEN fuse is
set to 1
#pragma config RETEN = OFF
//This will ensure the SRETEN bit is 0
WDTCONbits.SRETEN = 0;
If the Ultra Low-Power Sleep mode is needed,
then the user must ensure that the minimum
time, before the first SLEEP instruction is
executed, is greater than 350 µs.
Affected Silicon Revisions
8. Module: Resets (BOR)
An unexpected Reset may occur if the
Brown-out Reset (BOR) module is disabled,
and then re-enabled when the High/
Low-Voltage Detection (HLVD) module is not
enabled (HLVDCON<4> = 0). This issue
affects BOR modes: BOREN<1:0> = 10
and BOREN<1:0> = 01. In both of these modes,
if the BOR module is re-enabled while the device
is active, unexpected Resets may be generated.
Work around
If BOR is required, and power consumption is
not an issue, use BOREN<1:0> = 11. For
BOREN<1:0> = 10 mode, either switch to
BOREN<1:0> = 11 mode or enable the HLVD
(HLVDCON<4> = 1) prior to entering Sleep. If
power consumption is an issue and low power is
desired, do not use BOREN<1:0> = 10 mode.
Instead, use BOREN<1:0> = 01 and follow the
steps below when entering and exiting Sleep.
1. Disable BOR by clearing SBOREN
(RCON<6> = 0).
WDTCONbits.SBOREN = 0;
2. Enter Sleep mode (if desired).
Sleep();
3. After exiting Sleep mode (if entered), enable the
HLVD (HLVDCON<4> = 1).
HLVDCONbits.HLVDEN = 1;
4. Wait for the internal reference voltage (T
IRVST)
to stabilize (typically 25 µs).
while(!HLVDCONbits.IRVST);
5. Re-enable BOR by setting SBOREN
(RCON<6> = 1).
WDTCONbits.SBOREN = 1;
6. Disable the HLVD by clearing HLVDEN
(HLVDCON<4> = 0).
HLVDCONbits.HLVDEN = 0;
Affected Silicon Revisions
A3 B1 B3 C1 C3
X X X
A3 B1 B3 C1 C3
X X X X X