Skip to main content
Explorer II
August 7, 2024
Solved

STM32H753ZIT6 ADC calibration DMA

  • August 7, 2024
  • 2 replies
  • 1011 views

Hi,

I have setup the ADC in STM32H753ZIT6 to sample 4 channels with DMA in circular mode. This works as expected and I can check the values being updated in the "Live Expressions" tab.

But there is an offset, which I can only get rid of, if I perform the calibration of the ADC each time I start the ADC.

The reason I start the ADC and calibrate again, is that seems to be the only way to get correct results.  The DMA is setup to circular mode, so normally the ADC would only be started once. But as explained, this leads to an offset on all ADC values of some 0.05V.

Any help is appreciated. Thank you.

 

 

 

uint16_t ADC_result[4];

while (1)

{

HAL_ADCEx_Calibration_Start(&hadc2, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED);

HAL_ADC_Start_DMA(&hadc2, &ADC_result, 4);

}

tyassin_0-1723017604126.pngtyassin_1-1723017640123.png

 

 

 

    This topic has been closed for replies.
    Best answer by TDK

    HAL_ADCEx_Calibration_Start should be called only once at the program start. What values do you get if you do that? Be specific. You can't recalibrate it if the ADC is already busy.

    Is this a custom board? Is VDDA/VREF+ handled appropriately?

    2 replies

    TDKAnswer
    Super User
    August 7, 2024

    HAL_ADCEx_Calibration_Start should be called only once at the program start. What values do you get if you do that? Be specific. You can't recalibrate it if the ADC is already busy.

    Is this a custom board? Is VDDA/VREF+ handled appropriately?

    tyassinAuthor
    Explorer II
    August 7, 2024

    Thank you for your answer.
    I am not sure what has happened in the meantime, but it works now. I calibrate once and start the ADC with DMA and everything is running and precise.