Skip to main content
LLOLO.1
Associate III
November 11, 2020
Question

STM32F405RG weird ADC spikes

  • November 11, 2020
  • 32 replies
  • 15087 views

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 ?

This topic has been closed for replies.

32 replies

tkor.1
Associate
November 12, 2020

Do you have spikes when you put input to ground ?

LLOLO.1
LLOLO.1Author
Associate III
November 13, 2020

ground has also spikes.

Ozone
Principal
November 13, 2020

That doesn't sound good.

A proper and stable power supply at least for the analog branch (Vdda) is required to get stable results.

Sounds like a PCB redesign for me ...

waclawek.jan
Super User
November 13, 2020

> 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

LLOLO.1
LLOLO.1Author
Associate III
November 13, 2020

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

tkor.1
Associate
November 13, 2020

Try to run another program such as DC voltmeter, check for spikes DAC pin on grand, you should have straight pure line on 0V. For grounding use wire jumper not a capacitor.

TDK
November 14, 2020

> ground has also spikes.

If you're tying "ground" to the ADC channel input and you still see spikes, it's unlikely to be a software issue and unlikely to be a problem than can be fixed by software changes. The SAR ADC within the STM32F4 isn't going to read significantly more than 0 counts in this configuration. It could be that the "ground" you're tying is a different potential than "VSSA," at least during some transient periods. Could also be something damaged in the ADC itself, but seems less likely to me.

"If you feel a post has answered your question, please click ""Accept as Solution""."
LLOLO.1
LLOLO.1Author
Associate III
November 16, 2020

So assuming it is not a software issue, where should I look first? VDDA line?

LLOLO.1
LLOLO.1Author
Associate III
November 16, 2020

I checked VDDA and its stable during sampling.

tkor.1
Associate
November 16, 2020

The first think is - you have to have straight line @ 0V when you put ground directly on ADC pin. The spikes comes from your ADC wiring, without drawing and picture of it, it is just guessing work.

waclawek.jan
Super User
November 16, 2020

ST has AN2834 and AN4073 as guidelines to the ADC.

JW