
PIC18F1230/1330
2009 Microchip Technology Inc.
DS39758D-page 183
18.0
COMPARATOR VOLTAGE
REFERENCE MODULE
The comparator voltage reference is a 16-tap resistor
ladder network that provides a selectable reference
voltage. Its purpose is to provide a reference for the
analog comparators.
The resistor ladder is segmented to provide two ranges
of CVREF values and has a power-down function to
conserve power when the reference is not being used.
The module’s supply reference can be provided from
either device VDD/VSS or an external voltage reference.
18.1
Configuring the Comparator
Voltage Reference
The voltage reference module is controlled through the
voltage reference provides two ranges of output
voltage, each with 16 distinct levels. The range to be
used is selected by the CVRR bit (CVRCON<5>). The
primary difference between the ranges is the size of the
steps
selected
by
the
CVREF
selection
bits
(CVR3:CVR0), with one range offering finer resolution.
The equations used to calculate the output of the
comparator voltage reference are as follows:
If CVRR = 1:
CVREF = ((CVR3:CVR0)/24) x CVRSRC
If CVRR = 0:
CVREF = (CVRSRC x 1/4) + (((CVR3:CVR0)/32) x
CVRSRC)
The comparator reference supply voltage can come
from either AVDD or AVSS, or the external VREF+ that is
multiplexed with RA4 and AVSS. The voltage source is
selected by the CVRSS bit (CVRCON<4>).
Additionally, the voltage reference can select the
unscaled VREF+ input for use by the comparators,
The settling time of the comparator voltage reference
must be considered when changing the CVREF
).
TABLE 18-1:
VOLTAGE REFERENCE
OUTPUT
CVREN
CVRSS
CVREF
Comparator Input
00
Disabled
No reference
01
Disabled
From VREF
(CVREF bypassed)
10
Enabled
From CVREF
11
Enabled
From CVREF