cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 ADC Accuracy

Nuppo
Associate II
Posted on May 31, 2018 at 11:34

Hi, everyone. I've been using STM32F030F4P6 for a project. 

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.

The problem is my voltage readings are usually

50mV off. My ADC configuration; continuous mode with software trigger with only EOC interrupt, SMPR set to highest (111). I've also used Vref to calibrate Vdda. Using Vref made results a bit better (Not that much). But it didn't make a lot of sense to me since Vref_int data was 1472 and Vref_cal was 1536. This tells me Vdda that I'm giving is 3.44V which is not true at all.

How can I improve this MCU's ADC? Should I seperate Vdda - Vdd and give a voltage reference to Vdda? Would these improve my readings that much?

#adc-supply #stm32f030 #stm32f0 #adc-configuration #adc-calibration
7 REPLIES 7
Nesrine M_O
Lead II
Posted on May 31, 2018 at 11:38

Hi

nuppo

,

I recommend you to have a look to the

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/3f/4c/a4/82/bd/63/4e/92/CD00211314/files/CD00211pdf/jcr:content/translations/en.CD00211pdf

Application note aboutHow to get the best ADC accuracy in STM32 microcontrollers.

-Nesrine-

henry.dick
Senior II
Posted on May 31, 2018 at 12:07

'

The problem is my voltage readings are usually

±

50mV off.'

1. have the right expectation;

2. use calibration;

3. some of the chips, i think F0 is one of them, have adc calibration stored in the chip. that greatly improve the accuracy.

4. make sure you are measuring right.

Posted on May 31, 2018 at 15:24

Yes F0 has the calibration function and it works well.

final results are close to only 1mV error.

I am having the exact same problem on an STM32F070. tie the VDDA pin to VDD through a ferrite bead (to filter the input to VDDA) which is 3.319V. My analog input is a solid 0.6V (verified by 2x multimeters and an O-Scope). The MCU ADC measures 679 counts and it calcuates out to be approx 0.55V. According to my math at 0.6V I should be getting 740 counts. This is approx. 60 count / 50mV difference.

Have you found a solution to your problem that you can share?

raptorhal2
Lead

The ADC reads the sample & hold capacitor, which is not accessible to a multi meter. Ensure you have a low impedance signal, or set the sampling time high as explained in Nesrine's application note reference. Grounding unused ADC channel pins can also help.

Cheers, Hal

​Hal,

Thank you for responding, when I said I used a multimeter I meant I checked he incoming signal...not the inaccessible internal caps.  I do have a low impedance signal, I am running the signal through a unity gain buffer (opamp).  I have also tried changing he sampling rate with no effect.

I did speak with a person that works for ST Microelectronics after posting here and he said it sounds like I have to calibrate the ADC.  I am going to try that and see if it fixes the issue.

Nick

​Ran the HAL_ADCEx_Calibration_Start(&hadc) command and that fixed it.  ADC Is reading very accurate now.