2020-11-10 10:12 PM
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.
Has anyone encountered this ?
2020-11-12 02:51 AM
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) ?
2020-11-12 03:19 AM
Also, do you run other ADC or DAC?
JW
2020-11-12 03:35 AM
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.
2020-11-12 04:45 AM
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
2020-11-12 05:28 AM
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?
2020-11-12 07:29 AM
Do you have spikes when you put input to ground ?
2020-11-12 07:51 AM
Do you have spikes when you put input to ground ?
2020-11-12 05:27 PM
> 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
2020-11-12 09:09 PM
I am doing exactly that right now. There is nothing else connected.
2020-11-12 09:09 PM
Disabling scan mode didn't help.