cancel
Showing results for 
Search instead for 
Did you mean: 

low accuracy for ADC1 on STM32F030R8-Nucleo

Benjamin Brammer
Senior II
Posted on June 09, 2018 at 14:28

Hey Guys,

I am using the ADC1 to sample A0 as a voltage input and A17 and A18 as temperature and VrefInt for Temperature and exact Vdda calculaion. So far my implementation works fine. I also calibrate the ADC everytime before I start the ADC. Datahandling is done via DMA in circular mode, so continous.

I also want to use the analog WatchDog to check wether my voltage on A0 is inside a specified range (0,8V - 3V). Sadly when I programm the lower and upper threshold value for the watchdog and try to test it with my laboratory power supply, The watchdog triggers from 2,7V not 3. When I compare the converted values I see some overshots in reading. As I am avagering my calculated values this is not bothering me, but for the accuracy of the WatchDog this is a problem.

Has anybody seen this kind of behaviour before? Am I doing something wrong, or forgot something? Or is this inherent since the integrated ADC is simply not very accurate?

For the thresholds I used the following formula: HT = 3V * 4095/3,3V and LT = 0,8V * 4095/3,3V

So I would be happy for any help

best regards

Benjamin

#analog-watchdog #adc #adc-accuracy
14 REPLIES 14
T J
Lead
Posted on June 11, 2018 at 01:14

After a calibrate cycle it should be better.

AvaTar
Lead
Posted on June 11, 2018 at 09:25

How about your input circuitry, you have proper impedances ?

The datasheet specifies VDDA must be >= than VDD, is this satisfied ?

Is your VDDA stable ?

Posted on June 11, 2018 at 08:18

Hello TJ,

I allready wrote, that I calibrate before every start of the ADC, so I doubt that this could better the situation.

best regards

Benjamin

Posted on June 11, 2018 at 08:52

you are using 12bit data I guess,

   otherwise you would have to translate through Table 47 Analog watchdog comparison

    6 - 12Bit decoder RM 0091 p249

did you see app note AN4195 ?

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0ahUKEwi7vtuOgsvbAhXLh1QKHSFeA0MQFghJMAM&url=http%3A%2F%2Fwww.st.com%2Fresource%2Fen%2Fapplication_note%2Fdm00069390.pdf&usg=AOvVaw2DdtS7MDE7Iy4wN6aqJbsh

 
Posted on June 11, 2018 at 22:55

Hey TJ,

yes I use 12Bit. No I did not know that AppNote. I will check on it, thx.

best regards

Benjamin

Posted on June 11, 2018 at 23:04

Hello AvaTar,

I use a laboratory power supply..so I have only a neglegible output impedance, but you are right, his could be perhaps a problem with my long sampoling time, I will check on that tomorrow.

I am using a Nucleo board, so I think, hope that Vdda is stable, but I will also check on that tomorrow.

Vdda >= Vdd?? This is wrong. and makes no sense to me. Even the datasheets don't cover this statement.

best regards

Benjamin

Posted on June 12, 2018 at 08:03

Vdda >= Vdd?? This is wrong. and makes no sense to me. Even the datasheets don't cover this statement.

en.DM00088500.PDF, section 3.5.1, page 13:

The VDDA voltage level must be always greater or equal to the VDD voltage level and must be provided first.

The same in section 3.5.2.

Section 6.2, page 42:

VDD–VDDA,  Allowed voltage difference for VDD > VDDA : max. 0.4 V

Section 6.3.1, page 44:

VDDA, Analog operating voltage, Must have a potential equal to or higher than VDD ,  2.4 ... 3.6 V

But without actually checking it, I believe VDDA is directly connected to VDD on the Nucleo board, so this condition is fulfilled.

But have you measured VDD/VDDA ?

And have you checked the ADC with reference input voltages, especially in the 2,5 ... 3,0 V range ?

Posted on June 12, 2018 at 09:02

Hey AvaTar,

sorry for my arrogance! Obviously I did not check the complete datasheet for every entry on Vdda. I will today measure the voltages. Yes I tried a lot of different voltages. As I am avaeraging for the calculated values, the results are pretty good, but I don't check on every sampled raw value in my array. The AWD is also trigerring randomly after x samples, so this is no deterministic behaviour.

best regards

Benjamin

Posted on June 12, 2018 at 10:06

sorry for my arrogance!

Rather negligence ...

Yes I tried a lot of different voltages.

Have you tried voltage is said range, especially around 2,7V ?

Lab power supplies are not always that accurate. Have you cross-checked with a calibrated voltmeter ?

BTW, check the Nucleo schematics.

The ST discovery boards use to have shottky diodes in the supply path to avoid damage with multiple power inputs. This reduces VDD (and VDDA) to about 3.0V, and makes it drift, depending on supply current.

The Nucleo boards might have the same feature. At least check the actual VDD/VDDA value.