English
Language : 

PIC18F45K80-I Datasheet, PDF (381/622 Pages) Microchip Technology – 28/40/44/64-Pin, Enhanced Flash Microcontrollers with ECAN and nanoWatt XLP Technology
PIC18F66K80 FAMILY
25.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 25-1.
The resistor ladder is segmented to provide a range 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.
25.1 Configuring the Comparator
Voltage Reference
The comparator voltage reference module is controlled
through the CVRCON register (Register 25-1). The
comparator voltage reference provides a range of
output voltage with 32 levels.
The CVR<4:0> selection bits (CVRCON<4:0>) offer a
range of output voltages. Equation 25-1 shows the how
the comparator voltage reference is computed.
EQUATION 25-1:
If CVRSS = 1:
( ) CVREF =
VREF-
+
CVR<4:0>
32
• (VREF+ – VREF-)
If CVRSS = 0:
( ) CVREF =
AVSS +
CVR<4:0>
32
• (AVDD – AVSS)
The comparator reference supply voltage can come
from either VDD and VSS, or the external VREF+ and
VREF- that are multiplexed with RA3 and RA2. The
voltage source is selected by the CVRSS bit
(CVRCON<5>).
The settling time of the comparator voltage reference
must be considered when changing the CVREF
output (see Table 31-2 in Section 31.0 “Electrical
Characteristics”).
REGISTER 25-1: CVRCON: COMPARATOR VOLTAGE REFERENCE CONTROL REGISTER
R/W-0
CVREN
bit 7
R/W-0
CVROE
R/W-0
CVRSS
R/W-0
CVR4
R/W-0
CVR3
R/W-0
CVR2
R/W-0
CVR1
R/W-0
CVR0
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4-0
CVREN: Comparator Voltage Reference Enable bit
1 = CVREF circuit powered on
0 = CVREF circuit powered down
CVROE: Comparator VREF Output Enable bit
1 = CVREF voltage level is output on CVREF pin
0 = CVREF voltage level is disconnected from CVREF pin
CVRSS: Comparator VREF Source Selection bit
1 = Comparator reference source, CVRSRC = VREF+ – VREF-
0 = Comparator reference source, CVRSRC = AVDD – AVSS
CVR<4:0>: Comparator VREF Value Selection 0  CVR<4:0>  31 bits
When CVRSS = 1:
CVREF = (VREF-) + (CVR<4:0>/32)  (VREF+ – VREF-)
When CVRSS = 0:
CVREF = (AVSS) + (CVR<4:0>/32)  (AVDD – AVSS)
 2010-2012 Microchip Technology Inc.
DS39977F-page 381