English
Language : 

PIC18F44J50-I Datasheet, PDF (60/562 Pages) Microchip Technology – 28/44-Pin, Low-Power, High-Performance USB Microcontrollers
PIC18F46J50 FAMILY
4.7 Ultra Low-Power Wake-up
The Ultra Low-Power Wake-up (ULPWU) on RA0 allows
a slow falling voltage to generate an interrupt-on-change
without excess current consumption.
Follow these steps to use this feature:
1. Configure a remappable output pin to output the
ULPOUT signal.
2. Map an INTx interrupt-on-change input function to
the same pin as used for the ULPOUT output func-
tion. Alternatively, in Step 1, configure ULPOUT to
output onto a PORTB interrupt-on-change pin.
3. Charge the capacitor on RA0 by configuring the
RA0 pin to an output and setting it to ‘1’.
4. Enable interrupt-on-change (PIE bit) for the
corresponding pin selected in Step 2.
5. Stop charging the capacitor by configuring RA0
as an input.
6. Discharge the capacitor by setting the ULPEN
and ULPSINK bits in the WDTCON register.
7. Configure Sleep mode.
8. Enter Sleep mode.
When the voltage on RA0 drops below VIL, an interrupt
will be generated, which will cause the device to
wake-up and execute the next instruction.
This feature provides a low-power technique for
periodically waking up the device from Sleep mode.
The time-out is dependent on the discharge time of the
RC circuit on RA0.
When the ULPWU module causes the device to
wake-up from Sleep mode, the WDTCON<ULPLVL>
bit is set. When the ULPWU module causes the device
to wake-up from Deep Sleep, the DSULP
(DSWAKEL<5>) bit is set. Software can check these
bits upon wake-up to determine the wake-up source.
Also in Sleep mode, only the remappable output func-
tion, ULPWU, will output this bit value to an RPn pin for
externally detecting wake-up events.
See Example 4-1 for initializing the ULPWU module.
Note:
For module-related bit definitions, see the
WDTCON register in Section 27.2
“Watchdog Timer (WDT)” and the
DSWAKEL register (Register 4-6).
A series resistor between RA0 and the external
capacitor provides overcurrent protection for the
RA0/AN0/C1INA/ULPWU/RP0 pin and can allow for
software calibration of the time-out (see Figure 4-9).
FIGURE 4-9:
RA0
SERIAL RESISTOR
R1
C1
A timer can be used to measure the charge time and
discharge time of the capacitor. The charge time can
then be adjusted to provide the desired interrupt delay.
This technique will compensate for the affects of
temperature, voltage and component accuracy. The
ULPWU peripheral can also be configured as a simple
Programmable Low-Voltage Detect (LVD) or
temperature sensor.
Note:
For more information, refer to AN879,
“Using the Microchip Ultra Low-Power
Wake-up Module” application note
(DS00879).
DS39931D-page 60
 2011 Microchip Technology Inc.