2022-08-01 10:15 AM
I'm generating a PWM signal inside a loop, but I can't stop it. What would be the reason? I need both to generate PWM and channels.
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
HAL_TIM_PWM_Stop(&htim3, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim14, TIM_CHANNEL_1);
I need to generate a PWM signal from another channel and stop this signal.
2022-08-01 11:23 AM
>>What would be the reason?
I've got next to no contextual understanding of what your code/implementation is doing. What all you've tried, and the effects at a pin level you've observed.
TIM3->CCR1 = 0 should pretty much stop output, how quickly/abruptly will depend if you've got preload enabled or not.
TIM1/TIM8 there's probably also an MOE bit that'll stop output too.
2022-08-01 12:12 PM
I actually light up the LED. I'm trying to turn off the LED on TIM3 (stop PWM) and turn on the LED on TIM14. But since I can't stop the PWM signal I started in TIM3, I can't get a signal from TIM14. (So that's what I think.)
2022-08-01 12:19 PM
I will ask one more thing, can't I start the channels of the same timer one by one? so it's like this:
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_2);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_3);
it looks like i can start PWM like this but
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
Only when I want to activate tim_channel_1 it is not active
2022-08-01 04:06 PM
I was able to stop the PWM, I don't know how I did it I changed some pins and it stopped. Now I have a problem, I can't send the PWM signal in a new timer. The commands I use are PWM_START AND STOP.
If I see it, it shows the PWM signal of TIM1, it reacts as I want. but I stop this signal. When I start TIM16, I can't get the PWM signal.