Datasheet
2010 Microchip Technology Inc. DS39616D-page 261
PIC18F2331/2431/4331/4431
22.5 Operation During Sleep
When enabled, the LVD circuitry continues to operate
during Sleep. If the device voltage crosses the trip
point, the LVDIF bit will be set and the device will wake-
up from Sleep. Device execution will continue from the
interrupt vector address if interrupts have been globally
enabled.
22.6 Effects of a Reset
A device Reset forces all registers to their Reset state.
This forces the LVD module to be turned off.
22.7 Applications
Figure 22-3 shows a possible application voltage curve
(typically for batteries). Over time, the device voltage
decreases. When the device voltage equals voltage,
V
A, the LVD logic generates an interrupt. This occurs at
time, T
A. The application software then has the time,
until the device voltage is no longer in valid operating
range, to perform “housekeeping tasks” and to shut
down the system. Voltage point, V
B, is the minimum
valid operating voltage specification. This occurs at
time, TB. The difference, TB – TA, is the total time for
shutdown.
FIGURE 22-3: TYPICAL LOW-VOLTAGE DETECT APPLICATION
TABLE 22-1: REGISTERS ASSOCIATED WITH LOW-VOLTAGE DETECT MODULE
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
LVDCON
— — IRVST LVDEN LVDL3 LVDL2 LVDL1 LVDL0
INTCON GIE/GIEH PEIE/GIEL
TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF
IPR2
OSCFIP — — EEIP —LVDIP — CCP2IP
PIR2 OSCFIF — — EEIF —LVDIF — CCP2IF
PIE2
OSCFIE — — EEIE —LVDIE — CCP2IE
Legend: — = unimplemented, read as ‘0’. Shaded cells are unused by the LVD module.
Time
Voltage
VA
VB
TA
TB
VA = LVD trip point
V
B = Minimum valid device
operating voltage
Legend: