cancel
Showing results for 
Search instead for 
Did you mean: 

DMA request via GPIO pin

de2
Associate
Posted on June 06, 2010 at 18:57

DMA request via GPIO pin

3 REPLIES 3
epassoni950
Associate II
Posted on May 17, 2011 at 13:53

Hello,

I think there is no way to trigger a DMA transfer with a standard GPIO pin.

But you can route your signal to a Timer input, configure this input for a capture with a rising edge and activate a DMA transfer for the capture event.

I don't try this method. But I have an application in which a Timer generate an output compare with a trigger for a DMA transfer which write on a GPIO port and all is well.

Best regards

Eric

bjdooks
Associate
Posted on May 17, 2011 at 13:53

Posted on May 17, 2011 at 13:53

Do you have a reference on what needs to be done, as I want to trigger a DMA based on a timer set to a specific frequency. Is there any demo code available?

Should be one bundled in the Keil and IAR evals from the prior library.

Examples\ST\STM32F10xFWLib\Examples\DMA\ADC_TIM1

This is perhaps a tad more complicated than you want, but does advance the DMA on the timer update.

The crux of the code is to use DMA1 and TIM1

 Initialize DMA1, Channel 5

 Initialize TIM1

  /* Enable TIM1 */

  TIM_Cmd(TIM1, ENABLE);

  /* Enable TIM1 DMA interface */

  TIM_DMACmd(TIM1, TIM_DMA_Update, ENABLE);

 DMA1 stroked at TIM1 Update Interval

Referring to the RM0008 (Reference Manual), Rev 11, Table 65 lists the DMA requests for each channel.

DMA1, Channel 2, TIM2 Update

DMA1, Channel 3, TIM3 Update

DMA1, Channel 5, TIM1 Update

DMA1, Channel 7, TIM4 Update

DMA2, Channel 1, TIM8 Update

DMA2, Channel 2, TIM5 Update

There are other timer inputs to the DMA controllers, but the update would seem to be the simplest mode and not require any intervention via interrupt, etc.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..