cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-H563ZI ADC linearity

sh.lee
Associate II

I want to use my ADC of NUCLEO-H563ZI, but there is a problem with my ADC. ADC output does not match to input voltage. Test results are as fallows.

shlee_0-1722390211604.png

I am using ADC2 IN1, IN2, IN3, IN5, IN6, all singled ended. And I am using 25MHz HSE OSC of NUCLEO-H563ZI instead of ST-LINK 8MHz output, and disabled ICACHE. 

Is there a problem with my ADC/Clock configuration settings?

shlee_1-1722390498570.png

shlee_2-1722392112394.png

shlee_3-1722392143557.png

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The ADC needs to be calibrated on every startup before it is used. Are you doing that?

Sampling time generally has the largest impact. Use the longest sampling time for the highest accuracy on a DC signal.

Lots of other factors go into ADC accuracy. This application notes talks about many of them:

cd00211314-how-to-get-the-best-adc-accuracy-in-stm32-microcontrollers-stmicroelectronics.pdf

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

View solution in original post

4 REPLIES 4
TDK
Guru

The ADC needs to be calibrated on every startup before it is used. Are you doing that?

Sampling time generally has the largest impact. Use the longest sampling time for the highest accuracy on a DC signal.

Lots of other factors go into ADC accuracy. This application notes talks about many of them:

cd00211314-how-to-get-the-best-adc-accuracy-in-stm32-microcontrollers-stmicroelectronics.pdf

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

I am using ADC as below, to calibration my ADC before ADC Start.

shlee_0-1722399547083.png

Is this a normal way to use it? It seems that HAL_ADCEx_Calibration_Start() doesn't work.

Probably a test setup issue. How are you applying these voltages exactly? What is your ADC sampling time? If you directly tie an ADC input pin to GND on the board, what value do you get?

 

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

I changed ADC sampling time from ADC_SAMPLETIME_2CYCLES_5 to ADC_SAMPLETIME_6CYCLES_5, and ADC works normally.Thanks for help.

 

ps. Why ADC get wrong code with ADC_SAMPLETIME_2CYCLES_5? There was no problem in the other project. The only difference is OSC clock. when I use ST-LINK 8MHz clock ADC works exactly.