2024-10-15 04:50 AM - last edited on 2024-10-15 06:37 AM by Sarra.S
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.
2024-10-15 06:40 AM
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.
2024-10-16 02:37 AM
I am using stm32h753.
2024-10-16 02:58 AM
Read out and check/post content of TIM and relevant DMA and GPIO registers.
JW
2024-10-16 03:20 AM
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.
2024-10-16 04:29 AM - edited 2024-10-16 04:30 AM
> 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
2024-10-17 06:09 AM
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.
Thanks in Advance!
2024-10-17 06:24 AM
What hardware is this, a "known good" board like Nucleo or Disco, or your own?
JW
2024-10-18 01:52 AM
I am using Nucleo-H753ZI.
2024-10-19 09:23 AM
Where do you measure the PC8 ouput?
Have you tried to set PC8 to GPIO output and toggle it "manually" in the program?
JW