Skip to main content
w21685
Associate II
October 4, 2016
Question

TIM3 Clock output control

  • October 4, 2016
  • 2 replies
  • 660 views
Posted on October 04, 2016 at 21:21

Hello,

I'd like to know how to enable or disable freely for TIM3 clock output after initialization.

Once clock output is enabled, I cannot disable the clock ouput.

Device: STM32F207ZG

Thanks.

#timer-clock-enable-disable
This topic has been closed for replies.

2 replies

waclawek.jan
Super User
October 4, 2016
Posted on October 04, 2016 at 22:14

Assuming you output PWM through one of the timer's compare channel and you want to tristate the related pin, you have several options:

- change the pin's mode from AF to Input, in GPIO

- disable output compare through respective TIMx_CCER.CCyE (this is probably what you really want)

- change the given channel's mode from Compare to Capture, TIMx_CCMRz.CCyS = 0b01 (changing this requires to switch the channel off using CCyE anyway, so this is not really an option)

JW

w21685
w21685Author
Associate II
October 7, 2016
Posted on October 07, 2016 at 16:27

Thank you very much for your relpy!

I solved it thanks to your help.