cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-H723ZG ADC Accuracy

sreyas40
Associate II

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  

27 REPLIES 27
mƎALLEm
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
finn-eaton01
Associate

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.

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. 

sreyas40_1-1758274667787.png

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

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.

TDK
Super User

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.

TDK_0-1758294063658.png

 

If you are measuring a DC signal, oversampling can help quite a bit. Take 1000 readings and use the average.

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

So you are basically saying the chip can do it, but the board is not optimized for it.

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.

That is what I'm saying.

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

Show your circuit diagram - I'm only using the development board, a potentiometer connected to the pin.

this is the board

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 :)