Search code examples
c++timerstm32dma

STM32F427 controlling TIM4 channels (PWM) with signle DMA stream


I am trying to control all 4 TIM4 pins for PWM signal using DMA. Can I send data to each pin with single DMA stream ?

When I setup the pins and DMA in STM32 IDE it links the TIM4 Channel 1 pin to DMA1 stream 0, channel 2 to DMA1 stream 3 and channel 3 to DMA1 stream 7 + channel 4 doesn't let me add a DMA request.

Is there a way to to this or do I need to use different DMA streams ?


Solution

  • Different streams for different channels: As you noticed, TIM4 channel 1 is linked to DMA1 Stream 0, channel 2 to DMA1 Stream 3, channel 3 to DMA1 Stream 7, and channel 4 doesn't allow a DMA request. This is due to the hardware configuration of STM32 peripherals.