Skip to main content
Graduate
September 19, 2025
Question

NUCLEO-H723ZG ADC Accuracy

  • September 19, 2025
  • 6 replies
  • 1157 views

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  

    This topic has been closed for replies.

    6 replies

    Technical Moderator
    September 19, 2025

    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.

    sreyas40Author
    Graduate
    September 19, 2025

    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

    Visitor II
    September 19, 2025

    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.

    sreyas40Author
    Graduate
    September 19, 2025

    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.

    Super User
    September 19, 2025

    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.

    sreyas40Author
    Graduate
    September 21, 2025

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

    Explorer
    September 21, 2025

    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.

    Graduate II
    September 22, 2025

    I'm actually trying to read voltage peaks from photodetector, averaging might not be suitable for my case.

    Do you need the exact peak voltage?

    What's the voltage difference of the peaks compared to "idle / no-signal level" ?

    Maybe a comparator would be more suited?

    Or an amplifier before the ADC.

    Anyway, isn't the H723 ADC 12-bit only?

     

    sreyas40Author
    Graduate
    September 22, 2025

    sreyas40_0-1758539610092.png

    yes i need exact peak voltage.

    There is no fixed difference between peaks.

    I don't think a comparator will be useful?

    Currently i'm testing by sampling at different voltages( 0-3V)

    The board has 2 16-bit ADC and 1 12-bit ADC

    Explorer
    September 30, 2025

    @sreyas40 wrote:

    sreyas40_0-1758539610092.png

    yes i need exact peak voltage.

    There is no fixed difference between peaks.

    I don't think a comparator will be useful?

    No, not a comparator but peak detector with reset circuits. If pulses arrive not very often, than you don't need fast adc

    Graduate II
    September 22, 2025

    So... I never tested these 16-bit ADCs, but from the datasheet values (H723) theoretically it might be possible to get your 1 mV accuracy at 2.5 MSPS.

    I guess you refer the 1 mV to a full scale input of VDDA = VREF = 3.3 V, referred to GNDA = GND = 0 V ?

    1 mV at 3.3 V FS at 16 bit resolution equals ~ 20 LSB , which is just about the error sum you get by datasheet and is about an ENOB of 12.

    To get that, all the settings of the STM32 must be perfect, calibration must be performed before using the ADC.
    And you should use a more stable clock source than HSI, so switch to HSE. The Nucleo gets its HSE from the STLink MCU - attention, this might be 8.333 MHz (not sure), maybe 8 MHz.

    And I'm pretty sure that you need an analog ADC driver, some (relatively) high-slew-rate & high-drive op-amp with 3.3V-single-supply and RRIO. Add an RC low pass with ~ 50R / 100pF between op-amp and ADC input, both R&C as close as possible to the ADC pin.

    But no guarantee that this will work!
    Especially on a Nucleo-board, where the ADC input lines go long ways across the board.

    Graduate II
    October 2, 2025

    pulses arrive in intervals of near 400ns - assumption

    That is no easy task... any colleagues available with high-speed analog / ADC experience?

    sreyas40Author
    Graduate
    October 3, 2025

    Unfortunately no, I was thinking of using AD7960 external ADC, 

    link