ADC with Circular DMA on long buffer, not working well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-12 5:27 AM
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.
- Labels:
-
ADC
-
DMA
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-12 5:41 AM
> 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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-12 10:48 AM
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".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-12 10:57 AM
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-12 11:08 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-12 11:14 AM
Using UART as the transport is going to limit your bandwidth depending on the baud rate and settings you choose.
