Author Topic: STM32 ADC Internal Calibration - how reliable is it?  (Read 4177 times)

0 Members and 2 Guests are viewing this topic.

Offline unscriptedTopic starter

  • Contributor
  • Posts: 11
  • Country: pr
STM32 ADC Internal Calibration - how reliable is it?
« on: April 08, 2022, 05:38:49 pm »
The STM32L4 ADC includes a calibration step, with HAL it is performed with function HAL_ADCEx_Calibration_Start. When I skip this step I get better accuracy than when including it.. Why could this be?
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: STM32 ADC Internal Calibration - how reliable is it?
« Reply #1 on: April 08, 2022, 07:27:09 pm »
IIRC in some devices there's a required time delay between enabling the voltage regulator which powers the ADC, and the ADC actually working correctly. If your code doesn't include a pause, it can end up running the calibration before the power supply to the ADC is stable.

This is, not surprisingly, worse than not calibrating at all.

Offline unscriptedTopic starter

  • Contributor
  • Posts: 11
  • Country: pr
Re: STM32 ADC Internal Calibration - how reliable is it?
« Reply #2 on: April 11, 2022, 11:30:30 am »
IIRC in some devices there's a required time delay between enabling the voltage regulator which powers the ADC, and the ADC actually working correctly. If your code doesn't include a pause, it can end up running the calibration before the power supply to the ADC is stable.

This is, not surprisingly, worse than not calibrating at all.

I took that time delay into consideration. My micro has an external +VREF pin so I'm using a precise voltage reference. I wonder if even using this external ref I still need to perform the micro internal self-calibration.
« Last Edit: April 11, 2022, 11:36:37 am by unscripted »
 

Offline uer166

  • Frequent Contributor
  • **
  • Posts: 893
  • Country: us
Re: STM32 ADC Internal Calibration - how reliable is it?
« Reply #3 on: April 11, 2022, 10:53:56 pm »
I used HAL for the self-cal routines and always found the results to be better after the calibration, than before. The ADCs aren't terrible, but not great either, so a little extra performance is welcome with the cal. I have no idea what it actually does internally, but it seems to work..
 

Offline raw1

  • Newbie
  • Posts: 1
  • Country: us
Re: STM32 ADC Internal Calibration - how reliable is it?
« Reply #4 on: December 01, 2023, 06:44:12 pm »
Dear Unscripted,
 I am running into the same issue now on a STM32L471RGT6. did you ever resolve your issue and if so can you share any details?

Thanks a lot

RAW1
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: sk
Re: STM32 ADC Internal Calibration - how reliable is it?
« Reply #5 on: December 01, 2023, 07:33:29 pm »
If ADC conversions are better without calibration than with calibration, then you either did something incorrectly during calibration, or, more probably, do something incorrectly during the conversions.

VREF+ instability is one of the candidates, as said previously; too short sampling times are one of the other possibilities.

JW
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf