cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 Reading multiple adc channels using DMA issue

Posted on June 03, 2018 at 09:31

Hi everyone and thanks for the  help in advance

I'm trying to read 4 channels of ADC using stm32f043 MCU and get the results on DMA interrupt, the problem I'm having is that I can only get accurate and fix results from one channel and although the signal is steady, the reading on all other channels are bouncing and changing constantly , I have tried to decouple the line using different capacitors and also I have taken the VSSA and VDDA from the hardware design file from ST.

how can I get steady readings from all my ADC channels?

again thanks in advanced 

#stm32f0 #hal-adc #dma-adc
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on June 04, 2018 at 06:58

do you have any pins on 5V level ?like TTL-RS232 bouncing around...

any level above VDD will affect some channels

Try the slowest rate of conversion, is there a hurry ? 

I found the first and second fastest were less stable, then everything else seemed to work.

drop the clocking rate too.. it all helps

did you add the a small capacitance to the pin ? maybe 0.1uF

View solution in original post

6 REPLIES 6
Posted on June 03, 2018 at 13:25

Make sure the sources you are measuring can charge/discharge the sampling capacitor within the sample-time window you have selected.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 03, 2018 at 20:34

Thanks for the heads up

so far I have tried 1.5 cycles and 7.5 cycles and 71.5 cycles.

the problem is that in the first two sampling times I can read one channel accurately no matter what kind of sensor I'm connecting to it but for the second channel it stays the same bouncing up and down no matter what I attach to the analog input, even if I connect it to the ground it still does not stay on 0.

what am I missing here?

thanks again.

Posted on June 04, 2018 at 06:58

do you have any pins on 5V level ?like TTL-RS232 bouncing around...

any level above VDD will affect some channels

Try the slowest rate of conversion, is there a hurry ? 

I found the first and second fastest were less stable, then everything else seemed to work.

drop the clocking rate too.. it all helps

did you add the a small capacitance to the pin ? maybe 0.1uF

Posted on June 04, 2018 at 22:11

Hi T J

Thanks for responding

yes I have the small capacitor on the pin as you said and I have also tried slower rates of conversion, actually the slower the rate of conversion the bouncier it gets, any other suggestions?

Posted on June 05, 2018 at 00:12

Do you have a scope ?

I guess that your signal is actually moving around...

or you power supply is noisy.

Posted on June 28, 2018 at 11:40

Thanks for your great help.

I managed to solve the problem by changing the sampling time to the right value.