Skip to main content
Explorer
May 20, 2026
Solved

Stopping a Buzzer driven by Timer 16, STM32G071

  • May 20, 2026
  • 1 reply
  • 71 views

Hi All, 

 

I want to do something very basic, but somehow cannot manage to do it. 
What happens if you have a PWM signal on an IO Pin, generated by a timer, and you disable the timer? 

What happens to the physical IO Pin ? Is it stuck at the state where it was when you disabled it ?, Does it go Low ? Or High. The Idle state of the Timer is Low, and the On state High. 

 

Thanks, 

DJ 

Best answer by waclawek.jan

> and you disable the timer?

Define "disable the timer".

If it's clearing TIMx_CR1.CEN, it stops the counter and the related TIMx_CHx pin remains in that state in which it was at that moment.

But you can for example also clear the respective TIMx_CCER.CCxE bit, and that would set the given pin to Hi-Z.

JW

1 reply

waclawek.jan
Super User
May 20, 2026

> and you disable the timer?

Define "disable the timer".

If it's clearing TIMx_CR1.CEN, it stops the counter and the related TIMx_CHx pin remains in that state in which it was at that moment.

But you can for example also clear the respective TIMx_CCER.CCxE bit, and that would set the given pin to Hi-Z.

JW