A reference voltage plays a vital role in determining the range and the resolution (Volt/Count) of an A/D conversion. Besides, the absolute accuracy and the precision of the conversion also depend upon how accurate and stable the reference voltage is. Usually in PIC microcontrollers, the reference voltage for A/D conversion can be selected as the supply voltage (VDD) itself or provided externally through one or more I/O pins. The supply voltage may not be a good choice for the reference voltage where a precise A/D conversion is required unless you are confident that the supply voltage is very stable. Otherwise you need an external source of reference voltage, which will increases the hardware cost of your design and also consume a few of your I/O resources. Microchip's latest enhanced mid-range family of 8-bit PIC microcontrollers feature the Fixed Voltage Reference (FVR) module to generate a reference voltage internally. The output of the FVR module is stable and less susceptible to any fluctuations in the supply voltage. The FVR module can be configured to use its output as a reference voltage for A/D conversion internally, thus reducing the cost and freeing up one or more I/O pins.
In order to continue this discussion further I am selecting PIC16F1827-E/P.PIC16F1827-E/P., which is a member of Microchip’s enhanced mid-range 8-bit microcontroller family. It is pin-compatible with the popular 18-pin predecessors such as PIC16F628A and PIC16F88, but is equipped with lot more peripherals and other features. The Fixed Voltage Reference (FVR) module in PIC16F1827 provides three software selectable voltage levels, 1.024 V, 2.048 V and 4.096 V. The output can be configured to supply a reference voltage to the following:
Why the reference voltages are non integers like 1.024, 2.048, or 4.096 V?
The reference voltage of 1.024, 2.048, or 4.096 V makes calculations easier and accurate in A/D conversion. For example, if the positive A/D reference is 2.048 V and the negative reference is 0 V, then the resolution of 10-bit A/D conversion is 2.048 V/ 1024 = 2 mV/Count, which means in order to get the analog value (in mV) back from the digital count, you just need to multiply the count by 2. Similarly, the positive reference voltage of 4.096 V gives the conversion resolution of 4 mV/Count. |
In the following link I have described the full software implementation of FVR module in A/D conversion for reading the analog output from an LM34 temperature sensor. I hope you will find it useful.
http://embedded-lab.com/blog/?p=3045


