4 Measure VDD without External Components

Using the Device Information Area (DIA) fields on some PIC® MCUs, it is possible to measure the operating voltage of the microcontroller without using any external components.

Note: For AVR® MCUs or devices without DIA fields, see Measure Power Supplies and Batteries for an alternative method.

Inside of the DIA fields are the measured values of the Fixed Voltage Reference (FVR) from the factory. By using the power supply (VDD) as the voltage reference and measuring the FVR with the ADC, it is possible to compute the value of VDD.

To do so:

  1. Set the ADC to use VDD as a reference
  2. Select the FVR for the ADC input
  3. Acquire a sample
  4. Read the DIA field that correlates with FVR settings
  5. Solve for VDD with the following expression:
    DIA<<NMEASURED=VDD(inmV)

Where: DIA is the value from the look-up tables, N is the resolution of the ADC and MEASURED is the result from the ADC.