Skip to main content
Gabriele C
Associate
April 12, 2022
Question

ADC with Circular DMA on long buffer, not working well

  • April 12, 2022
  • 5 replies
  • 1404 views

Hi everybody!

I'm trying to acquire data from the ADC1 with two channels, and store them in a 40k long buffer with Circular DMA.

The problem is the following: it seems that every about 3k samples the ADC stops workinkg for a while and then starts again, so the overall acquired signal has some discontinuities.

But this doesn't happen with all the same settings, but without Circular DMA (so Normal DMA).

Which can be the problem?

Thanks in advance for the help.

PS: I'm using the STM32F411VE-DISCO board.

This topic has been closed for replies.

5 replies

TDK
April 12, 2022

> The problem is the following: it seems that every about 3k samples the ADC stops workinkg for a while and then starts again, so the overall acquired signal has some discontinuities.

How are you determining this?

Most likely the buffer is being rewritten and you're comparing values that were taken during different cycles.

What is your rate of data capture and are you processing all of that data before it gets repopulated?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Gabriele C
Associate
April 12, 2022

I can see that in the Debugger window: I'm acquiring a known signal (sawtooth with very low frequency) with a sample rate of 20 kSa/s in a 40k samples buffer.

Inspecting the buffer after the acquisition I can see some "jumps".

TDK
April 12, 2022

This is almost certainly a debugger artifact rather than a hardware/software issue. The debugger can't read all values instantly.

If you stop the DMA, then read values, the jumps will go away (apart from the jump at the current writing position within the circular buffer).

"If you feel a post has answered your question, please click ""Accept as Solution""."