AnsweredAssumed Answered

Calibrating A/D on STM32L0

Question asked by Scott Dev on Mar 29, 2017
Latest reply on Mar 30, 2017 by Scott Dev

Hi

   Ive been looking through documentation (and web sites), and testing some code on using the A/D on the STM32L0 processor. As the chip I am using uses the VDD as the reference voltage I am currently calculating the Vdd using the following:

VDD= 3V * VrefintCalValue / AdcValue . I got  3.48V. 

 

I now have been looking the calibration command :

HAL_ADCEx_Calibration_Start(..);

HAL_ADCEx_Calibration_GetValue(..);

HAL_ADCEx_Calibration_SetValue(..);

 

My question is after calling HAL_ADCEx_Calibration_Start(..); what do I do to get the VDD (above) value?

Do I use the HAL_ADCEx_Calibration_GetValue(..);, and the HAL_ADCEx_Calibration_SetValue(..);?

 

After I use the calibration commands how does this effect the value in VrefintCalValue to calculate VDD?

 

And how do I use the calibration value on the A/D value read from a channel?

 

Sorry for all the questions, but just trying to get my head around how to use the calibration result.

 

Thanks

Scott

Outcomes