Datasheet

2012 Microchip Technology Inc. DS30575A-page 497
PIC18F97J94 FAMILY
24.0 COMPARATOR VOLTAGE
REFERENCE MODULE
The comparator voltage reference is a 32-tap resistor
ladder network that provides a selectable reference
voltage. Although its primary purpose is to provide a
reference for the analog comparators, it may also be
used independently of them.
A block diagram of the module is shown in Figure 24-1.
The resistor ladder is segmented to provide a range of
CV
REF 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 V
DD/VSS or an external voltage reference.
24.1 Configuring the Comparator
Voltage Reference
The comparator voltage reference module is controlled
through the CVRCONH register (Register 24-1). The
comparator voltage reference provides a range of
output voltage with 32 levels.
The CVR<4:0> selection bits (CVRCONH<4:0>) offer a
range of output voltages. Equation 24-1 shows how the
comparator voltage reference is computed.
EQUATION 24-1:
The comparator voltage reference supply can come
from either V
DD and VSS, or the external VREF+ and
V
REF- that are multiplexed with RA3 and RA2. The
voltage source is selected by the CVRPSS<1:0> bits
(CVRCONL<5:4>).
The settling time of the comparator voltage reference
must be considered when changing the CV
REF out-
put (see Table 31-10 in Section 31.0 “Electrical
Characteristics”).
If CVRSS = 1:
CVREF = VREF- + • (VREF+ – VREF-)
CVR<4:0>
32
()
If CVRSS = 0:
CVREF = AVSS + • (AVDD – AVSS)
CVR<4:0>
32
()
REGISTER 24-1: CVRCONH: COMPARATOR VOLTAGE REFERENCE CONTROL REGISTER HIGH
U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CVR4 CVR3 CVR2 CVR1 CVR0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-5 Unimplemented: Read as ‘0
bit 4-0 CVR<4:0>: Comparator V
REF Value Selection 0 CVR<4:0> 31 bits
CVREF = VNEGSRC + (CVR<4:0>/32) • (VPOSSRC – VNEGSRC)