cancel
Showing results for 
Search instead for 
Did you mean: 

How to use ADC on Nucleo-G491

KatsuMat
Associate II

I am unable to obtain ADC values and would like some advice.

Here is the source code project.

https://github.com/katsumat/STM32CubeIDE/tree/main/workspace_1.16.1/ADCCalibration

 

PA0 is connected to GND, PA1 to Vdd, and PA3 to the output of a variable resistor.

The ends of the variable resistor are connected to Vdd and GND, ensuring an output range of 0 to 3.3V.

 

The input voltages for PA0, PA1, and PA3 are as follows:

KatsuMat_1-1735417352680.png

Here are the results after setting a breakpoint and checking:

KatsuMat_2-1735417413994.png

The variable did not hold any value.

KatsuMat_0-1735417870078.png

 

 

 

KatsuMat_0-1735417281046.png

 

1 REPLY 1
KnarfB
Principal III

Look at the generated config code in your main.c lines 246 ff and copy that as closely as possible in your own configs. ADC_REGULAR_RANK_1 is not a 1, offset fileds shall be initialized, etc.. 

hth

KnarfB