Datasheet

PIC16F785/HV785
DS41249E-page 70 © 2008 Microchip Technology Inc.
10.0 VOLTAGE REFERENCES
There are two voltage references available in the
PIC16F785/HV785: The voltage referred to as the
comparator reference (CVREF) is a variable voltage
based on V
DD; The voltage referred to as the VR refer-
ence (VR) is a fixed voltage derived from a stable band
gap source. Each source may be individually routed
internally to the comparators or output, buffered or
unbuffered, on the RA1/AN1/C12IN0-/VREF/ICSPCLK
pin.
10.1 Comparator Reference
The comparator module also allows the selection of an
internally generated voltage reference for one of the
comparator inputs. The VRCON register (Register 10-1)
controls the voltage reference module shown in
Figure 10-1.
10.1.1 CONFIGURING THE VOLTAGE
REFERENCE
The voltage reference can output 32 distinct voltage
levels, 16 in a high range and 16 in a low range.
The following equation determines the output voltages:
EQUATION 10-1: CVREF OUTPUT VOLTAGE
10.1.2 VOLTAGE REFERENCE
ACCURACY/ERROR
The full range of VSS to VDD cannot be realized due to
the construction of the module. The transistors on the
top and bottom of the resistor ladder network
(Figure 10-1) keep CV
REF from approaching VSS or
V
DD. The exception is when the module is disabled by
clearing all CVROE, C1VREN and C2VREN bits. When
disabled with VR<3:0> = 0000 and VRR = 1 the refer-
ence voltage will be V
SS. This allows the comparators
to detect a zero-crossing and not consume CV
REF
module current.
The voltage reference is V
DD derived and therefore, the
CV
REF output changes with fluctuations in VDD. The
tested absolute accuracy of the comparator voltage
reference can be found in Table 19-8.
VRR = 1 (low range):
CV
REF = VR<3:0> x VDD/24
V
RR = 0 (high range):
CV
REF = (VDD/4) + (VR<3:0> x VDD/32)