cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F427 PWM on 40 pins with DMA and BSRR

Vach23
Associate

Hi,

I need to generate ~8khz PWM on 40 pins with at least 1% resolution. I was thinking about solution using GPIO ports D,G,F and DMA2 streams 1,2, 7 which are all triggered by TIM8 (TIM8_UP, TIM8_CH1, TIM8_CH4/TRIG/COM).

I am worried about the data transfer speed of the DMA. 8khz, with 1% resolution means 0,8Mhz x 3 ports = 2,4Mhz DMA streams. Reffering to documentation it takes about 8 APB clock cycles to process and perform DMA transfer which means that it takes about ~20M clockcycles/sec and APB2 is running currently at 84Mhz. This seems quite a lot and Im worried about saturating the bus.

Can someone correct me please? How big of a problem this could potentially be? How fast i can go with this?

Thank you very much in advance!

1 REPLY 1
TDK
Guru

DMA transfers at 2.4 MHz are definitely at the upper end of what is possible but should be doable if that's the only thing using the bus.

But at that update rate, you're going to run out of memory unless what you're sending is very short in duration and cyclical.

If you feel a post has answered your question, please click "Accept as Solution".