cancel
Showing results for 
Search instead for 
Did you mean: 

PWM signal generating by using DMA stream on TIM3_CH3

AnoopYadav
Associate II

I tried configuring PC8 for TIM3_CH3 to generate a PWM signal by using DMA stream. But im not seeing any signal on the line. The same is tried by configuring TIM3_CH4 on PB1 and this works. Please help me understanding what can be going wrong.

9 REPLIES 9
Sarra.S
ST Employee

Hello @AnoopYadav

Could you specify which product are you using?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I am using stm32h753.

Read out and check/post content of TIM and relevant DMA and GPIO registers.

JW

Hi waclawek.jan,

Thank you for the response. The information provided in the reference manual does not contain details about the pin that is to be used for PWM and it is observed that when TIM3 - Channel 3 is enabled for PWM generation, two options are available in the DMA settings namely TIM3_CH3 and TIM3_UP. Needed more clarity of which selection of channel and the GPIO to use for my requirement.

> The information provided in the reference manual does not contain details about the pin that is to be used for PWM

Assignment of pins to individual peripherals (here TIM3_CH3) is in the Datasheet to given STM32.

> when TIM3 - Channel 3 is enabled for PWM generation, two options are available in the DMA settings namely TIM3_CH3 and TIM3_UP

You are probably talking about CubeMX. I don't use Cube/CubeMX. The choice of DMA trigger depends on whether the respective TIMx_CCRx register is set to be preloaded or not. In the former case (which is in the majority of cases the preferred one), you want to use the Update event (TIM3_UP), as that gives you the most time until the next Update where the preloaded value gets active; in the latter case you probably want to use TIM3_CH3 as trigger.

But get PWM working first, without DMA.

If you are a beginner, you also may want to start with the examples provided in Cube.

JW

Going with the very basic PWM generation on both lines "PC8" and "PB0", Im hereby providing more details of the configuration i made. I configured PB0 for TIM3_CH3 for PWM with the below settings and called APIs HAL_TIM_Base_Init(htim) and HAL_TIM_PWM_Start(htim, Channel). The settings successfully generated PWM on the line PB0 as observed on the salae capture.

 

Exactly the same settings made for the pin "PC8" which is also an AF of TIM3_CH3 (Ref: STM32H753xI datasheet Table 8), There is no PWM signal observed on the line. Hence, I seek more clarity on why such difference when datasheet claims that both PC8 and PB0 can be configured for TIM3_CH3.

 

AnoopYadav_6-1729170568098.png

AnoopYadav_5-1729170517215.png

 

Thanks in Advance!

What hardware is this, a "known good" board like Nucleo or Disco, or your own?

JW

I am using Nucleo-H753ZI.

Where do you measure the PC8 ouput?
Have you tried to set PC8 to GPIO output and toggle it "manually" in the program?

JW