Skip to main content
SMali.4
Associate
July 12, 2023
Solved

Reading non zero value on HAL_ADC_GetValue when input is connected to ground STM32G030F6P6.

  • July 12, 2023
  • 1 reply
  • 1347 views

Hello,

    I am working on STM32G030F6P6 microcontroller. PA0 pin is configured as analog input, 12 bit resolution. I am reading non zero values when PA0 pin is connected to ground. I tried on 3 different microcontrollers but each microcontroller ADC values are different from each other (eg. 145,  165). 

   Power supply to microcontroller is connected through 3.3V linear voltage regulator, also 100nf capacitor is added close to the microcontroller power pins.

   What should I do? Please help with the same.

thanks,
siddharth.

This topic has been closed for replies.
Best answer by STOne-32

Dear @SMali.4 ,

it seems you have a ground noise to minimize and ensure offset calibration is done at startup of the ADC. Here is our Generic Application Note on how to get best from Our ADCs https://www.st.com/resource/en/application_note/an2834-how-to-get-the-best-adc-accuracy-in-stm32-microcontrollers-stmicroelectronics.pdf#page23

Ciao

STOne-32

1 reply

STOne-32
STOne-32Best answer
ST Technical Moderator
July 22, 2023

Dear @SMali.4 ,

it seems you have a ground noise to minimize and ensure offset calibration is done at startup of the ADC. Here is our Generic Application Note on how to get best from Our ADCs https://www.st.com/resource/en/application_note/an2834-how-to-get-the-best-adc-accuracy-in-stm32-microcontrollers-stmicroelectronics.pdf#page23

Ciao

STOne-32