cancel
Showing results for 
Search instead for 
Did you mean: 

Timer DMA to SSP0?

niko
Associate II
Posted on September 16, 2008 at 07:20

Timer DMA to SSP0?

2 REPLIES 2
niko
Associate II
Posted on May 17, 2011 at 09:55

Hi,

I'm trying to figure out a way to use TIM0 to control DMA transfer from memory to SSP0. My application needs to output one halfword from memory to SSP0 every 64 external events counted by TIM0.

I could always use TIM0 interrupt, but using DMA would be IMO more elegant solution and it would relax real-time requirements for the timer interrupt as the data must be output immedetealy after 64th external event has occurred in order to guarantee correct operation of external chips.

I've tried several diffent ways to configure SSP0, TIM0 and DMA to perform timer controlled SSP0 output, but I've not succeeded. If anyone has been able to implement any sort of TIMx controlled DMA to other peripheral than TIMx please let me know how you've done it.

Thanks,

Niko

niko
Associate II
Posted on May 17, 2011 at 09:55

I finally got it to work. The problem was in fw library where TIM_ITConfig clears DMA -enabled flag in CR2 of TIMx. So TIM_DMACmd(TIM0, ENABLE); must be called after TIM_ITConfig(TIM0, TIM_IT_OC2, ENABLE); in order to get the timer controlled dma thing to work properly.