2020-01-31 10:31 PM
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
2020-02-01 06:17 AM
Callibrate ADC. check vss.
2020-02-05 09:50 AM
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