2018-10-01 5:51 AM
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:
The values reported in the table of which above have been obtained with the following conditions:
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
Solved! Go to Solution.
2018-10-01 6:20 AM
What about the code, especially the sampling time you are setting ?
If this time is short (too short), and you have a high input impedance, conversion results will apear too low.
It is useful to understand the basics of an SAR - ADC to configure it properly.
2018-10-01 6:20 AM
What about the code, especially the sampling time you are setting ?
If this time is short (too short), and you have a high input impedance, conversion results will apear too low.
It is useful to understand the basics of an SAR - ADC to configure it properly.
2018-10-02 1:46 AM
Dear Frank,
you are right: it was my fault. Basically I forgot to set up the ADC parameters in Cube.
I was sampling with 12 bits resolution with a sampling time of 1.5 cycles, which is the default value. Obviously, 1.5 cycles is way too short for the SAR, as at least 12.5 cycles are requested with 12 bits, according with STM.
Since I don't have strict constraints in terms of sampling time, I set up the period at 28.5 cycles: now the precision is more than acceptable, and as expected, with autocalibration, the ADC gives its best.
Thanks for your help.
Regards.
Marco