cancel
Showing results for 
Search instead for 
Did you mean: 

How can I stop PWM signal?

buccno
Associate II

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.

4 REPLIES 4

>>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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
buccno
Associate II

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.)

buccno
Associate II

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

buccno
Associate II

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.0693W00000QMdpQQAT.png 

0693W00000QMdpVQAT.png