cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405RG weird ADC spikes

LLOLO.1
Associate II

Hi I am working on a small project where I need to sample couple of ADC channels.

I am using STM32F405RG. ADC1 is running in continuous and scan mode with DMA. I am using ping pong buffers to send ADC data through USART.

After gathering some data I plot them in MATLAB.

Problem is that there are random spikes in my ADC values an example is shown below.

X axis is Seconds, Y axis is voltage. Graph belongs to an ADC channel where approximately 2.6 volts needs to be read.

0693W000005B0hlQAC.png 

Has anyone encountered this ?

32 REPLIES 32

Is this data (the spikes) the collected ADC data ?

Have you tried lowering the impedance at the ADC input, perhaps trying another low-impedance voltage source ?

What data noise do you see if you connect the ADC input to ground (0 Volts) ?

Also, do you run other ADC or DAC?

JW

LLOLO.1
Associate II

Yes, the figure in my post was collected ADC data. I use only ADC other analog peripherals are disabled.

"Have you tried lowering the impedance at the ADC input, perhaps trying another low-impedance voltage source ?

What data noise do you see if you connect the ADC input to ground (0 Volts) ?"

I will try that.

LLOLO.1
Associate II

measuring ground gives ADC standard noise with spikes. Also I sampled single channel with scan mode, still there are spikes. I tried using another low impedance function generator as my signal source. There are still spikes

gregstm
Senior III

Just some thoughts: try reading the Vrefint ADC channel. does your design have a ground plane? do you have 100nF surface mount caps at all VDD pins? (with minimal path between VDD pin, cap and ground plane). Does your CPU sleep while it waits for data/DMA/interrupts? - if so, try running without sleep (or other low powered mode) to see if spikes are caused by CPU demand surges. Can we see a schematic of your analog input section? What exactly are you measuring? Are any nearby computers using wifi?

tkor.1
Associate II

Do you have spikes when you put input to ground ?

tkor.1
Associate II

Do you have spikes when you put input to ground ?

> I am using ping pong buffers to send ADC data through USART.

Try to disconnect any unnecessary connections, including the USART, store the data in RAM, dump them later after connecting the USART.

JW

I am doing exactly that right now. There is nothing else connected.

Disabling scan mode didn't help.