3.2.2 FVR as ADC Internal Channel

Battery voltage monitoring is necessary in numerous battery-powered applications where the supply voltage of a microcontroller may fall below the specified threshold level and require battery replacement or recharging for the uninterrupted operation of the system. When the microcontroller is directly powered by a battery power source, the battery voltage monitoring is possible using FVR connected internally to ADC. Hence, a microcontroller PORT pin or external passive components are not required for battery voltage measurement, as shown in Figure 3-5.

For battery voltage measurement using ADCC and FVR peripherals, use the supply voltage (VDD) as positive voltage reference and FVR as input to ADCC. The ADCC conversion result for the fixed FVR output varies depending on the battery voltage. Enable the ADCC threshold comparison feature to detect the battery depletion condition.

Figure 3-5. Battery Voltage Measurement Using FVR

The ADC result is computed as shown in Equation 1 when FVR is input to the ADC channel, the battery is the power source to the microcontroller, and VDD is the positive reference voltage of ADC.

Equation 1:

A D C R E S U L T = V F V R V B A T * ( 2 12 1 )

When the battery voltage is 3V and the FVR output is 1.024V, the ADC result count is 1398, as shown below.

Equation 2:

A D C R E S U L T ( V B A T = 3 V ) = 1.024 3 * ( 2 12 1 ) = 1398

When the battery voltage drops to 2.5V, the ADC result count for FVR (1.024V) is 1677, as shown below.

Equation 3:

A D C R E S U L T ( V B A T = 2.5 V ) = 1.024 2.5 * ( 2 12 1 ) = 1677

When the battery voltage drops to 2V, the ADC result count for FVR (1.024V) is 2097, as shown below.

Equation 4:

A D C R E S U L T ( V B A T = 2 V ) = 1.024 2 * ( 2 12 1 ) = 2097

The 3V battery can be used as the power source to the microcontroller until its voltage drops to the recommended minimum voltage of 2V. Keep the ADC 2000 threshold to detect the depleted battery condition and take further action when its voltage goes below the recommended minimum of 2V.