3.1.4.2 Measuring Supply Voltage

VDD and VDDIO2 are available internal input channels to the AVR128DB48‘s ADC. The voltage is divided by ten. To measure VDD or VDDIO2, follow these steps:
  1. Configure the voltage reference for the ADC.
  2. Select VDD or VDDIO2 as the positive input to the ADC.
  3. Run a single-ended ADC conversion.
  4. Calculate the voltage using the following equation:
    1. V = ADC Result x V REF x 10 ADC Resolution