cancel
Showing results for 
Search instead for 
Did you mean: 

ADC of STM32wb55cgu6

mihirsinha_
Associate III

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:

  1. Around 70 mV offset – up to 70 mV, the ADC prints 0 V.

  2. 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.

1 REPLY 1
Mike_ST
ST Employee

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.