Skip to main content
Visitor II
March 19, 2025
Solved

STM32 ADC Error

  • March 19, 2025
  • 2 replies
  • 639 views

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

 

 

 

 

    This topic has been closed for replies.
    Best answer by Avid

    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. 

    2 replies

    Super User
    March 20, 2025

    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.

    AvidAuthorAnswer
    Visitor II
    March 24, 2025

    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.