Associate
October 1, 2018
Solved
ADC error in reading voltage
- October 1, 2018
- 2 replies
- 2628 views
Hi everyone,
I'm having troubles with the internal ADC (STM32F072CBTX): a significant offset is present in the values provided by the converter. I performed a set of test measurments on the ADC: the results are shown in Table1.jpg.
Where:
- Vmis is the voltage measured with a voltage meter at the ADC input pin (voltage drop on a resistor, in a voltage divider).
- ADC is the value produced by the converter.
- Vcalc is the correspondent voltage value with 12 bits resolution: Vcalc = Vmis * ADC / 4096
- Err = Vmis - Vcalc
The values reported in the table of which above have been obtained with the following conditions:
- VDDA = 3.3V
- VSSA = 0V
- No autocalibration
I tried autocalibration as well, by calling HAL_ADCEx_Calibration_Start before starting conversions: strangely, with autocalibration, things get even worse, as shown in Table2.jpg.
Does anyone have any idea on what is going on?
Am I doing something wrong?
Any help is appreciated.
Thanks.
Marco