English
Language : 

PIC18F66K22-I Datasheet, PDF (383/550 Pages) Microchip Technology – PIC18F87K22 Family Data Sheet
PIC18F87K22 FAMILY
FIGURE 26-3:
CASE 1:
HIGH-VOLTAGE DETECT OPERATION (VDIRMAG = 1)
HLVDIF may not be Set
VDD
HLVDIF
VHLVD
Enable HLVD
IRVST
TIRVST
Internal Reference is Stable
HLVDIF Cleared in Software
CASE 2:
VDD
VHLVD
HLVDIF
Enable HLVD
IRVST
TIRVST
Internal Reference is Stable
HLVDIF Cleared in Software
HLVDIF Cleared in Software,
HLVDIF Remains Set since HLVD Condition still Exists
26.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 26-4 shows a
possible voltage curve. Over time, the device voltage
decreases. When the device voltage reaches voltage,
VA, the HLVD logic generates an interrupt at time, TA.
The interrupt could cause the execution of an Interrupt
Service Routine (ISR), which would allow the applica-
tion to perform “housekeeping tasks” and a controlled
shutdown before the device voltage exits the valid
operating range at TB. This would give the application
a time window, represented by the difference between
TA and TB, to safely exit.
FIGURE 26-4:
TYPICAL LOW-VOLTAGE
DETECT APPLICATION
VA
VB
Time TA TB
Legend: VA = HLVD trip point
VB = Minimum valid device
operating voltage
 2009-2011 Microchip Technology Inc.
DS39960D-page 383