cancel
Showing results for 
Search instead for 
Did you mean: 

High-speed Data Transfer ADC-DMA-PC

matteopampana
Associate
Posted on June 20, 2015 at 10:54

Hi everyone,

I need to plot on my PC a signal that has a max frequency of about 86 KHz (i'm using an anti-aliasing filter with that cutoff frequency).

I'm working with a STM32F4 Discovery Board. I configured the ADC with the prescaler set to /8 and 56 cycles per conversion with APB2 set to 84MHz. If my reasoning is correct, I'm sampling at about 187 KHz, that would be ok for the Shannon Theorem. I'm using DMA in circular mode and a buffer of 1024 half-word items.

To exchange this data with my PC and plot it on Matlab I need very high speed baud rate using USART (921600 bits/s are not sufficient).

By setting the HalfComplete Transfer interrupt on DMA the ADC will fill those 512 items in about 3.3 ms while, to complete the serial transfer to the PC, it takes about 8 ms. Double Buffering DMA is not enough too.

So, I'm wondering if a possible solution exists to solve this issue. I'm currently thinking about using the VCP/OTG_FS. Does a better solution exist? Am I wrong in my analysis?

Thank you in advance.

#adc #stm32f4 #otg #dma #usart
1 REPLY 1
raptorhal2
Lead
Posted on June 20, 2015 at 14:34

You need to add 15 cycles for conversion after sampling.

Can your PC and MatLab input, analyze and display information this fast ?

Consider sampling a block that fills up available free RAM, then is sent to the PC more leisurely.

Cheers, Hal