Skip to main content
Explorer II
January 14, 2024
Question

Timer + PWM + DMA

  • January 14, 2024
  • 2 replies
  • 1072 views

Hi,

I’m looking for some tutorial (or any other learning staff) related to Timer + PWM + DMA.

Unfortunately, I couldn’t find much info related to these issues.

 

I’d like to learn:

  1. LL_TIM_CC_EnableChannel() and LL_TIM_CC_DisableChannel():
    1. What exactly do these func do? When should IO use them?
    2. Is it available only while using DMA?
    3. What is the sequence of calling this func?
      1. Do I have to start DMA first using HAL_TIM_PWM_Start_DMA()?
      2. Will LL_TIM_CC_DisableChannel() stop/pause the DMA operation, or I must call HAL_TIM_PWM_Stop_DMA()?
  2. What is the flow chart (i.e.: sequence) of the MCU while using Timer + PWM + DMA? As far as I understood (please fix me:( Timer event --> “Send” data using to PWM DMA --> PWM operation on gpio (according to data)
  3. ...

Thanks,

Aviv

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    January 14, 2024

    Hello @AFink 

    I suggest you to follow the fifth and sixth video of this playlist.

    Best Regards.

    STTwo-32 

    ST Employee
    January 15, 2024

    Hello @AFink and @STTwo-32 ,

    Thank you for your question !
    I am adding some information / questions :

    • You can also read this article named "Custom Signal generation using PWM and DMA"
    • I need to know more about what is your application & STM32 product ? Can you please explain it ?
    • According to User Manual LL_TIM_CC_EnableChannel() allow to enable capture/compare channels. Each Capture/Compare channel is built around a capture/compare register (including a shadow register), a input stage for capture (with digital filter, multiplexing and prescaler) and an output stage (with comparator and output control). To read more about capture/compare channels, read chapter 17.3.5 of the RM0090.
    • Check also the 17.4.7 chapter, which mode are you interested in ?

    Best Regards,

    Pierre