1

I'm trying to generate PWM wave but it seems that proteus has a problem with it. I've tried to do so using CMSIS and CubeMX and neither of them works.

tested timers: TIM 1, 2, 4, 5 with all their channels

Timer configuration in CubeMX Proteus Result

Edited: CubeMX doesn't generate HAL_TIM_PWM_Start as part of the generated codes for TIM's. adding HAL_TIM_PWM_Start to the code and changing the value of Pulse to a non-zero amount, fixed my problem.

Mehdi
  • 62
  • 6

1 Answers1

1

You should set Pulse value greater than zero. It is the PWM's duty value.

recep
  • 124
  • 5
  • I fixed that. But still, the problem didn't resolve. – Mehdi Jan 12 '21 at 10:05
  • Do you start PWM using 'HAL_TIM_PWM_Start' function? Can you please share your clock configuration? – recep Jan 12 '21 at 12:20
  • I thought CubeMX write HAL_TIM_PWM_Start as part of the generated codes. It seems that was the problem. thank you for your help. – Mehdi Jan 12 '21 at 12:51