cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering DMA transfers using a timer

moomoo
Associate
Posted on June 18, 2012 at 13:16

Hello everyone,

We're currently evaluating the STM32F4 platform for a sophisticated data logging device. One of the requirements is that 14 digital I/Os need to be sampled at a rate of >1MSamples/s. What we'd like to do is use a timer that periodically triggers a DMA transfer from e.g. port E's IDR register to RAM. As the processor needs to perform signal analysis tasks, using an ISR to start the DMA transfer is unfeasible.

AN2548 (Using the STM32F101xx and STM32F103xx DMA controller) describes how this problem could be solved by using two timers: one generating a PWM on a pin, one sampling the same pin and triggering the DMA accordingly.

This would work but we're looking for a more elegant solution that doesn't involve using a pin.

So to sum it up: do you know of a way to periodically initiate DMA transfers through the use of a timer without an ISR?

Thanks in advance!

#stm32-dma-gpio-timer
4 REPLIES 4
alok472
Associate II
Posted on June 18, 2012 at 15:20

i dont think ISR is absolute mandatory. You can try with Input capture Interrupt disabled. Or, even an output compare condition shall generate the DMA request.

Pls correct me if this is wrong understanding.

Posted on June 18, 2012 at 16:05

Look at the DAC DMA examples, simple sample triggering at TIM's periodicity. You might need to use DMA2 and Memory-to-Memory against the GPIO bank's IDR

STM32F4-Discovery_FW_V1.1.0\Project\Peripheral_Examples\DAC_SignalsGeneration\main.c

Need to check the reference manual to determine which timer to use for which channel, etc.

Interrupt could be set for TC and/or HT.

Not sure TIM pins need to physically output, could always park the output on a pin that isn't bonded out on a given package.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
cb23
Associate
Posted on June 18, 2012 at 17:55

If I understood it right you want to sample 14 analog signals at 1 MHz. I have sampled two signals at a lower frequency using one ADC in multichannel scan mode and DMA. I configured the ADC to trigger on a timer. According to AN3116 it's possible to use up to 16 streams with one ADC.

Posted on June 18, 2012 at 18:12

14 digital I/Os need to be sampled

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..