Skip to main content
Senior III
March 12, 2026
Solved

Timer2 does not generate PWM output in Slave Mode and Tim1 in Master Mode

  • March 12, 2026
  • 3 replies
  • 199 views

I am testing the Timer and PWM with different combinations to understand it better on NucleoF446RE board. I have configured as below

Timer1 as Master with trigger output as update event, PWM channel1 output on PA8 (interrupt). 

Timer2 as slave in trigger mode and output PWM Channel1 on PA5 same as LED based on interrupt.

Problem is Timer2 Channel1 output does not toggle on PA5 but if i place break point in tiimer2 interrupt is triggered.

void TIM2_IRQHandler(void)
{
 /* USER CODE BEGIN TIM2_IRQn 0 */
 /* USER CODE END TIM2_IRQn 0 */
 HAL_TIM_IRQHandler(&htim2);
 /* USER CODE BEGIN TIM2_IRQn 1 */

 /* USER CODE END TIM2_IRQn 1 */
}

Please guide to solve the issue.

Best answer by TDK

> sConfigOC.Pulse = 0;

This produces a DC signal, not a PWM.

3 replies

waclawek.jan
Super User
March 12, 2026

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

JW

PS. Don't @-invoke users to attract attention. It's inappropriate.

TDK
TDKBest answer
Super User
March 12, 2026

> sConfigOC.Pulse = 0;

This produces a DC signal, not a PWM.

"If you feel a post has answered your question, please click ""Accept as Solution""."
STuser2Author
Senior III
March 12, 2026

Yes i have to verifying the register values, it may give some hint of solving the problem.