cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Returning "0" zeros

Miha
Associate II

Hello. 

I have a problem with my ADC readings. I use Nucleo 64 with SM32G474 and ADC1 Channel 6. Pin coresponds to A5, Arduino compatible pin on board. No matter what i do, change adc or channel, i get 0 as an output. I use comands 

MX_GPIO_Init();

MX_ADC2_Init();

HAL_ADC_Start_IT(&hadc1);

I have ADC1,2 global interupts enabled in CubeMX, my HAL_ADC_ConvCpltCallback are geting

called (i checked with breakpoints). My while is running, program except ADC works normaly,

GPIOs work. Enable regular conversions i have DISABLED, so i use software calls for ADC.

Scan Converscion and Continious Conversion i have both DISABLED. I tried almost everything.

No matter what i do HAL_ADC_GetValue() always returns me 0.

 

 

1 REPLY 1
Mahmoud Ben Romdhane
ST Employee

Hello @Miha ,

First let me thank you for posting and welcome to the ST Community.

I advise you to consult this Wiki and this Post

It explains what ADC is and how to use it through an example.

Thanks.

Mahmoud.