2024-07-30 07:17 PM
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.
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?
Solved! Go to Solution.
2024-07-30 07:56 PM
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
2024-07-30 07:56 PM
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
2024-07-30 09:21 PM
I am using ADC as below, to calibration my ADC before ADC Start.
Is this a normal way to use it? It seems that HAL_ADCEx_Calibration_Start() doesn't work.
2024-07-31 06:25 AM
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?
2024-07-31 06:24 PM
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.