cancel
Showing results for 
Search instead for 
Did you mean: 

ADC with Circular DMA on long buffer, not working well

Gabriele C
Associate II

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.

5 REPLIES 5
TDK
Guru

> 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".

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".

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".

Maybe is easier if I explain what I want to implement.

I need to acquire a lot of data, more than the available RAM memory. Using circular DMA, how can I send data to a VCOM (or something else) before the ADC buffer will be overwritten?

Capture data at a slower rate than you can send it out. Process the first half of the buffer on the HT interrupt and the second half on the TC interrupt.
Using UART as the transport is going to limit your bandwidth depending on the baud rate and settings you choose.
If you feel a post has answered your question, please click "Accept as Solution".