Microchip Technology MCP1631RD-MCC2 Data Sheet

Page of 338
 2006-2012 Microchip Technology Inc.
DS41291G-page 99
PIC16F882/883/884/886/887
8.10
Comparator Voltage Reference
The comparator voltage reference module provides an
internally generated voltage reference for the
comparators. The following features are available:
• Independent from Comparator operation
• Two 16-level voltage ranges
• Output clamped to V
SS
• Ratiometric with V
DD
• Fixed Reference (0.6V)
The VRCON register (
) controls the
voltage reference module shown in 
.
The voltage source is selectable through both ends of
the 16 connection resistor ladder network. Bit VRSS of
the VRCON register selects either the internal or
external voltage source.
The PIC16F882/883/884/886/887 allows the CV
REF
signal to be output to the RA2 pin of PORTA under
certain configurations only. For more details, see
.
8.10.1
INDEPENDENT OPERATION
The comparator voltage reference is independent of
the comparator configuration. Setting the VREN bit of
the VRCON register will enable the voltage reference.
8.10.2
OUTPUT VOLTAGE SELECTION
The 
CV
REF
 
voltage reference has 2 ranges with 16
voltage levels in each range. Range selection is
controlled by the VRR bit of the VRCON register. The
16 levels are set with the VR<3:0> bits of the VRCON
register.
The CV
REF
 
output voltage is determined by the following
equations:
EQUATION 8-1:
CV
REF
 OUTPUT VOLTAGE
The full range of V
SS
 to V
DD
 cannot be realized due to
the construction of the module. See 
8.10.3
OUTPUT CLAMPED TO V
SS
The CV
REF
 output voltage can be set to Vss with no
power consumption by clearing the FVREN bit of the
VRCON register.
This allows the comparator to detect a zero-crossing
while not consuming additional CV
REF
 module current.
8.10.4
OUTPUT RATIOMETRIC TO VDD
The comparator voltage reference is V
DD
 derived and
therefore, the CV
REF
 output changes with fluctuations in
V
DD
. The tested absolute accuracy of the Comparator
Voltage Reference can be found in 
8.10.5
FIXED VOLTAGE REFERENCE
The fixed voltage reference is independent of V
DD
, with
a nominal output voltage of 0.6V. This reference can be
enabled by setting the FVREN bit of the SRCON
register to ‘1’. This reference is always enabled when
the HFINTOSC oscillator is active.
8.10.6
FIXED VOLTAGE REFERENCE 
STABILIZATION PERIOD
When the fixed voltage reference module is enabled, it
will require some time for the reference and its amplifier
circuits to stabilize. The user program must include a
small delay routine to allow the module to settle. See
 for the
minimum delay requirement.
8.10.7
VOLTAGE REFERENCE 
SELECTION
Multiplexers on the output of the voltage reference
module enable selection of either the CV
REF
 or fixed
voltage reference for use by the comparators.
Setting the C1RSEL bit of the CM2CON1 register
enables current to flow in the CV
REF
 voltage divider
and selects the CV
REF
 voltage for use by C1. Clearing
the C1RSEL bit selects the fixed voltage for use by C1.
Setting the C2RSEL bit of the CM2CON1 register
enables current to flow in the CV
REF
 voltage divider
and selects the CV
REF
 voltage for use by C2. Clearing
the C2RSEL bit selects the fixed voltage for use by C2.
When both the C1RSEL and C2RSEL bits are cleared,
current flow in the CV
REF
 voltage divider is disabled
minimizing the power drain of the voltage reference
peripheral.
V
RR
1 (low range):
=
V
RR
0 (high range):
=
CV
REF
(V
LADDER
/4) +  
=
CV
REF
 (VR<3:0>/24) V
LADDER
=
(VR<3:0> V
LADDER
/32)
V
LADDER
V
DD
=
or ([V
REF
+] - [V
REF
-]) or V
REF
+
 
Note:
Depending on the application, additional
components may be required for a zero
cross circuit. Reference TB3013, “Using
the ESD Parasitic Diodes on Mixed Signal
Microcontrollers”
 (DS93013), for more
information.