2025-07-12 4:10 PM - edited 2025-07-13 5:28 AM
I am unable to start a PWM signal on my Nucleo board --> I was not able to observe a signal on an oscilloscope.
Please see the following code and Cube configurations.
1) Is the following code all that is necessary to start a PWM on a channel (given it is configured correctly in IOC)?
2) I confirmed that I am connected to the right pin by toggling a GPIO prior to configuring for PWM
HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_1);
TIM2->CCR1 = 30;
2025-07-12 11:19 PM
Difficult to help with this information.
Can You provide some aditional information ( .ioc file and if possible the code You are using)
2025-07-13 1:00 AM
Make sure you are observing the right pin and that there are no obstacles (e.g. solder bridge) to that signal on the board.
Read out and check/post content of TIM and relevant GPIO registers.
JW
2025-07-13 11:34 AM - edited 2025-07-13 11:35 AM
I resolved my issue by grasping a better understanding of the following concepts
1) ARR (auto reload register), CCR, and counter period settings
In my case (without using a prescaler):
CLK / ARR (auto reload register) = PWM frequency
170MHz / 4096 = 41503.91KHz
2) I was mistakenly using the incorrect CCRx register. PWM CH1 should use CCR1, PWM CH2 should use CCR2, etc