cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 ADC Error

Avid
Associate II

Hello, 

I am trying to read from the ADC of an STM32H750VBT6 on a custom PCB at 16 bits and am getting a constant value of 32768 when sending data over USB. When factors like the number of bits is changed, the value also changes to be around half the max value even if the ADC input is re-connected to ground. I measured Vref and it is at 3.3V and I had a voltage divider circuit with 1.6 V going directly to the analog pin. Could there be an issue with the settings or how the ADC is being initialized? 

Avid_0-1742427307702.png

Avid_1-1742427476785.png

Avid_2-1742427538639.pngAvid_3-1742427627518.png

Avid_4-1742427682819.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Avid
Associate II

Figured out what the issue was. 

 

I ended up switching all my analog input pins into GPIO_Output pins and noticed that a lot of them were not outputting anything likely due to a bad soldering connection between the STM32 and the pads. A lot of the bad connections were also around Vref so it likely had a bad connection as well which led to the strange ADC readings. Re-heating some of the pads and adding some solder got me a good enough connection to be able to read from a channel. 

View solution in original post

2 REPLIES 2
TDK
Guru

Do you calibrate the ADC with HAL_ADCEx_Calibration_Start on startup? This is required.

Consider converting an internal channel like temperature or VREFINT to see if results vary.

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

Figured out what the issue was. 

 

I ended up switching all my analog input pins into GPIO_Output pins and noticed that a lot of them were not outputting anything likely due to a bad soldering connection between the STM32 and the pads. A lot of the bad connections were also around Vref so it likely had a bad connection as well which led to the strange ADC readings. Re-heating some of the pads and adding some solder got me a good enough connection to be able to read from a channel.