2025-08-19 6:30 AM
Dear Sir,
I am working on reading values from 10 ADC channels of the STM32WB55CGU6 (WeAct Studio board). However, I am not getting the correct voltage readings. Please note the following details about my setup:
I am using USB (Virtual COM Port) to print the values.
I have set the reference to 3.3 V.
The ADC output is not stable, and temperature readings are also included.
I would like to properly calibrate the ADC so that I can obtain accurate values, including the temperature in degrees Celsius. I have attached my code for your reference.
The main issues I am facing are:
Around 70 mV offset – up to 70 mV, the ADC prints 0 V.
The ADC values are not stable – they vary by about 100 mV.
Could you please review my code and guide me on how to correctly calibrate the ADC for stable and accurate results?
Your support will be very helpful.
2025-08-19 6:44 AM
Hello,
>> Around 70 mV offset – up to 70 mV, the ADC prints 0 V
Please check whether you call
HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED) function before the
HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buf, ADC_BUF_LEN) line
>> the ADC values are not stable – they vary by about 100 mV.
Choose longer sampling time instead of ADC_SAMPLETIME_47CYCLES_5
You might want to use oversampling functionnality as well.