2025-09-18 11:25 PM - edited 2025-09-19 2:06 AM
I'm currently using single 16-bit ADC, my requirement is to have ADC conversion error less than 1mV.
I'm using the ADC with DMA. I'm a beginner, currently getting 1-2mV error and it is not constant too.
#define SCALE (3300.0f/65535.0f)
uint16_t adc_val = 0;
uint16_t ADC_ARR[5];
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc){
adc_val = ADC_ARR[0]*SCALE;
}
HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED);
HAL_ADC_Start_DMA(&hadc1, (uint32_t*)ADC_ARR,1);
Also the ADC clock is derived from HSI
2025-09-19 12:37 AM - edited 2025-09-19 12:42 AM
Hello @sreyas40 and welcome to the community,
Nucleo boards are not suitable to run the ADC especially for 16-bit resolution.
You can also refer to AN5354 "Getting started with the STM32H7 Series MCU 16-bit ADC" and use oversampling technique.
2025-09-19 12:43 AM
Use multiple samples and average them to reduce noise and improve accuracy.
Ensure a stable reference voltage (use VREFINT or an external reference).
Increase ADC sampling time and check grounding/shielding to minimize external noise.
2025-09-19 2:49 AM
is "AN5354" applicable to me, in the applicable products table i don't see H723, or is it applicable to all h7 series?
When i gave 0v the ADC will out 0-2mV, when i gave it 2V the error ranged in 0-15mV and the out is constantly varying by mV.
HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET_LINEARITY, ADC_SINGLE_ENDED);
HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED);
earlier the error was more, only after calibration i'm getting the above said errors.
Oversampling doesn't seem to help as the variations in reading happen more frequently now. Do you think variations in Vref or using HSI might be the issue? Or as you have said, are Nucleo boards not suitable for High precision ADC
2025-09-19 3:00 AM
I'm using the calibrate function, do i still need to implement additional logic to improve accuracy. I will try to use external reference. Do you thing using HSI for ADC might influence too. And what did you mean by to check grounding/shielding, i'm using the boards GND.
2025-09-19 8:01 AM
Here are tips for improving ADC accuracy:
How to optimize the ADC accuracy in the STM32 MCUs - Application note
Getting 1 mV accuracy, assuming a 3.3 VREF, would be 11.7 ENOB. This is just within grasp of the ADC, but only if you get EVERYTHING else correct in terms of layout and signal design, which is not done on the nucleo board. Expect to only get 9-10 ENOB.
If you are measuring a DC signal, oversampling can help quite a bit. Take 1000 readings and use the average.
2025-09-21 1:30 AM
So you are basically saying the chip can do it, but the board is not optimized for it.
2025-09-21 6:19 AM
It was already answered, ENOB = 11.7 Nether board or chip alone are not designed for 16-bits. 11.7 means that bits above this value are junk or noise. Averaging simply does trading noise level vs sampling rate. Running average over 1000 samples , rate drops by factor 1000, but noise sqrt(1000).
Show your circuit diagram, because to get 11 bits accuracy also require some efforts.
2025-09-21 8:52 AM
That is what I'm saying.
2025-09-21 9:02 PM
Show your circuit diagram - I'm only using the development board, a potentiometer connected to the pin.
I'm actually trying to read voltage peaks from photodetector, averaging might not be suitable for my case.
This is my first project using STM board :)