cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753ZIT6 ADC calibration DMA

tyassin
Associate III

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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?

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

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?

If you feel a post has answered your question, please click "Accept as Solution".
tyassin
Associate III

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.