English
Language : 

PIC18F44J50-I Datasheet, PDF (397/562 Pages) Microchip Technology – 28/44-Pin, Low-Power, High-Performance USB Microcontrollers
PIC18F46J50 FAMILY
25.2 HLVD Setup
To set up the HLVD module:
1. Disable the module by clearing the HLVDEN bit
(HLVDCON<4>).
2. Write the value to the HLVDL<3:0> bits that
selects the desired HLVD trip point.
3. Set the VDIRMAG bit to detect one of the
following:
• High voltage (VDIRMAG = 1)
• Low voltage (VDIRMAG = 0)
4. Enable the HLVD module by setting the
HLVDEN bit.
5. Clear the HLVD Interrupt Flag, HLVDIF
(PIR2<2>), which may have been set from a
previous interrupt.
6. If interrupts are desired, enable the HLVD inter-
rupt by setting the HLVDIE and GIE/GIEH bits
(PIE2<2> and INTCON<7>).
An interrupt will not be generated until the
IRVST bit is set.
25.3 Current Consumption
When the module is enabled, the HLVD comparator
and voltage divider are enabled and will consume static
current. The total current consumption, when enabled,
is specified in electrical specification Parameter D022B
(IHLVD) (Section 30.2 “DC Characteristics: Power-
Down and Supply Current PIC18F46J50 Family
(Industrial)”).
Depending on the application, the HLVD module does
not need to operate constantly. To decrease the current
requirements, the HLVD circuitry may only need to be
enabled for short periods where the voltage is checked.
After doing the check, the HLVD module may be
disabled.
25.4 HLVD Start-up Time
The internal reference voltage of the HLVD module,
specified in electrical specification Parameter D420 (see
Table 30-8 in Section 30.0 “Electrical Characteris-
tics”), may be used by other internal circuitry, such as
the programmable Brown-out Reset (BOR).
If the HLVD, or other circuits using the voltage
reference, are disabled to lower the device’s current
consumption, the reference voltage circuit will require
time to become stable before a low or high-voltage con-
dition can be reliably detected. This start-up time,
TIRVST, is an interval that is independent of device
clock speed. It is specified in electrical specification
Parameter 36 (Table 30-13).
The HLVD interrupt flag is not enabled until TIRVST has
expired and a stable reference voltage is reached. For
this reason, brief excursions beyond the set point may
not be detected during this interval. Refer to Figure 25-2
or Figure 25-3.
 2011 Microchip Technology Inc.
DS39931D-page 397