cancel
Showing results for 
Search instead for 
Did you mean: 

TIM1 DMA2 Request while in DMA Memory-Memory mode

muffin
Associate
Posted on March 30, 2015 at 02:07

Hello friends,

I'm messing around with the f4 discovery trying to get Timer 1 to send a DMA transfer request to DMA2, which would transfer a whole GPIO input register (GPIOx_IDR) to somewhere in memory.

I was able to enable the transfers myself by setting the EN bit in  DMA_SxCR during a timer interrupt, but that's too slow for my application.  I'd like to transfer the GPIO input register into memory at around 20MHz, which means no software control of the DMA.

Am I trying to do the impossible? 

Thanks

#tim1-stm32-gpio-dma #stm32f4-dma-gpio-gpio_idr-tim1
4 REPLIES 4
c10ud
Associate
Posted on March 31, 2015 at 19:14

Hi,

I'm trying the same thing in order to acquire PDM samples from the on-board microphone (timer1 externally clocked and acquiring GPIOB->IDR).

The TIM1_CH2 DMA Tx (half) complete events are triggered correctly but the samples look wrong (I can hear sound coming from the mic but there's somekind of white noise!).

The TIM1 is clocked externally with a 24.576Mhz source and its PWM output is set to 1024Khz. (The whole setup works 100% ok when acquiring with I2S slave Rx).

Any idea?

Thanks,

Riccardo

Posted on March 31, 2015 at 19:32

Any idea?

Get a logic analyzer, and compare/contrast the data you see on the pins vs the data you acquire in memory?

Generate some simple/reproducible test signals you can validate the data with?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
c10ud
Associate
Posted on April 02, 2015 at 09:23

Ah! The issue was in the bit order.. got it working now :)