cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G070CB Internal ADC1 Not Reading Zero when PA0 Connects to GND

KKong.1
Associate

Hi ST Community!

I am new to the STM32 family of processors and have recently attempted to make a personal board that houses the STM32G070CBT6 controller.

One of the features I have on this board is the ability to measure the current via a TI INA181A1 (20V/V) Current Sense IC.

Currently, I have the output of the INA181 directly connected to PA0, which is the AIN0 for the internal ADC of the STM32.

However, the ADC is not reading the correct value:

Using a voltmeter, the INA181 output pin measures 34mV (which should translate to an ADC readout of 42; Vref+ = 3.3V and 12-bit) while the ADC reads a value of 125.

I decided to disconnect the INA181 from the AIN0 pin of the STM32 and directly connect the AIN0 pin to Ground.

And the result is that the ADC reads and jumps around 80.

I am wondering what is causing the error of the readout here?

Is there anything that can be done from SW perspective to correct this phenomenon?

I have used STM32CubeIDE to set up the ADC.

Please kindly advise what I am doing wrong here or if further information is needed!

Thank you very much in advance for your kind help!

-Kenneth

2 REPLIES 2
oeliks
Senior

Callibrate ADC.​ check vss.

Thank you oeliks!

I was not aware of the Calibration.

I have now performed the calibration and used some averaging and it approved:

Before - (with AIN0 connected directly GND) ADC reads ~80

After - (same config as above) ADC reads ~1