2.1.2 Measuring the Supply Voltage with the Fixed Voltage Reference

On recent PIC MCUs, Device Information Area (DIA) fields are included on the device. These fields contain the factory measured values of the internal voltage reference and other calibration constants.

It is also possible to calculate the value of VDD on the device using the DIA fields with the Fixed Voltage Reference (FVR). This allows using VDD as a reference, which has the widest input range for signals. To measure VDD:

  • Set the ADC to use VDD as a reference
  • For the input channel to the ADC, select the Fixed Voltage Reference (FVR) channel
  • Measure the FVR
  • Read the DIA field that matches the voltage output of the FVR channel
  • Solve for VDD using the following formula:
    D I A < < N M E A S U R E D = V D D ( i n m V )

    Where: DIA is the programmed value, MEASURED is the value acquired by the ADC, and N is the number of bits in the ADC.