Skip to main content
1 of 3
Şener
  • 65
  • 2
  • 6

STM32F0 ADC reads wrong values

I am using STM32F030F4P6 MCU for a project. This MCU has no Vref+ pin and using VDDA pin for AD conversions, PLL etc. While prototyping the circuit that I am going to use on my project, I shorted VDDA and VDD pins together with 10uF and 100nF capacitors to the ground. I am giving exact 3.3V to these pins with an DC power supply.

ADC will be reading voltage with max amplitude of 16,8V. Therefore I've used 10k / 2k voltage divider, to bring this voltage to logic level. Since I will be reading mostly DC values, I've set the sampling time to highest possible which is 239,5 adc clock cycle - 17,1 microseconds.

The problem is values that I read are way different than voltages I measure with multimeter. For example, ADC is reading ~2.8V when I measure 2.87V.

As you know these MCUs have Vref built-in which you can read through ADC_IN17. When I try to use this to calibrate my ADC, this time measured voltage is lower than read voltage. For example, read voltage is 2.8V when I measure 2.72V.

Şener
  • 65
  • 2
  • 6