cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding ADC input source on STM32F3Discovery board

Kye-Hyun Park
Associate II
Posted on November 21, 2017 at 13:27

Dear All,

I'd like to test an ADC conversion using ADC example from STM32F3Discovery's peripheral examples.

I connected ADC1 channel(PC1) and GND to external power supply directly. and It was measured anormalvoltage between PC1 and GND using FLUKE Multimeter 8846A.

But, as attached the ADC value on Terminal I/O, theresults are very unstable. Is that due to the bad connection for ADC input source? or I cannot catch the problem exactly. Could you please help the issue?

1. supplying 0V to ADC1 channel(PC1)

0690X0000060PFEQA2.png

2. supplying 1.0V to ADC1 channel(PC1)

0690X0000060PFFQA2.png

14 REPLIES 14
Posted on November 22, 2017 at 13:12

Shorter, and shielded/twisted wiring would probably have helped, too.

I use to test my ADC implementations with a battery, and wires no longer than 5..10cm.

Posted on November 22, 2017 at 16:17

Thank you for your helpful information.

PeterJ
Associate II
Posted on November 23, 2017 at 11:30

You could also set HW oversampling to 16 or higher, this will also give a low pass / averaging of your signal.

You then have 2 choices:

You can use the build-in shift function to divide by 2, 4, 8, 16 or ...

Or you can use the adc value as it is (all the samples are added in HW so it only requires the setup and are read as if you are making one simple sample) and divide by the number of oversamples you do, this will give you the best resolution.

Remember to that the variable might be set as half word which means that if you add 16 samples of 4095, this i the maximum value of a half word.

Using e.g 32 times oversampling you can shift the result right 1 place (also setup in adc settings and will be automatically done without any additional code).

David.Yves
Associate II
Posted on November 23, 2017 at 14:07

Your results may not be as bad as you think. With 0V applied the largest deviation is 45mV  or 1.5% of full scale(3V). Your voltmeter will read between 2% to 5% of full scale depending on make and model. This is very good performance for your design. 

The second set of reading show an offset of +0.1 or 10% of the applied test voltage this can be due to the source you are using ( power supply, voltage divider ...) . I will assume that you have verified the math to convert from ADC output  value  to mV.

To verify the performance of your ADC use a fresh battery single cell ( Duracell alcaline will read 16xx mV)

I don't know your application but if you require more precision you can use an op amp to boost the signal making the radiated and conducted noise less relevant.

Posted on November 23, 2017 at 14:17

Your results may not be as bad as you think. With 0V applied the largest deviation is 45mV  or 1.5% of full scale(3V). .... This is very good performance for your design.

I beg to disagree on this one.

Shorting the ADC input as close as possible to the input should yield a zero result reading, give one LSB.

A 45mV reading suggests noise, i.e. the sample cap picked up a substantial charge through long wiring and improper impedance.