Datasheet

2012 Microchip Technology Inc. DS30575A-page 505
PIC18F97J94 FAMILY
25.5 Applications
In many applications, it is desirable to detect a drop
below, or rise above, a particular voltage threshold. For
example, the HLVD module could be periodically
enabled to detect Universal Serial Bus (USB) attach or
detach. This assumes the device is powered by a lower
voltage source than the USB when detached. An attach
would indicate a high-voltage detect from, for example,
3.3V to 5V (the voltage on USB) and vice versa for a
detach. This feature could save a design a few extra
components and an attach signal (input pin).
For general battery applications, Figure 25-4 shows a
possible voltage curve. Over time, the device voltage
decreases. When the device voltage reaches voltage,
V
A, the HLVD logic generates an interrupt at time, TA.
The interrupt could cause the execution of an ISR, which
would allow the application to perform “housekeeping
tasks” and a controlled shutdown, before the device
voltage exits the valid operating range at T
B. This would
give the application a time window, represented by the
difference between TA and TB, to safely exit.
FIGURE 25-4: TYPICAL LOW-VOLTAGE
DETECT APPLICATION
25.6 Operation During Sleep
When enabled, the HLVD circuitry continues to operate
during Sleep. If the device voltage crosses the trip
point, the HLVDIF 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.
25.7 Effects of a Reset
A device Reset forces all registers to their Reset state.
This forces the HLVD module to be turned off.
Time
Voltage
VA
VB
TA
TB
VA = HLVD trip point
VB = Minimum valid device
operating voltage
Legend: