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.
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:
- Set the ADC to use VDD as a reference
- Select the FVR for the ADC input
- Acquire a sample
- Read the DIA field that correlates with FVR settings
- Solve for VDD with the
following expression:DIA<< NMEASURED= VDD(in mV)
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.