cancel
Showing results for 
Search instead for 
Did you mean: 

TIM3 Clock output control

w21685
Associate II
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
2 REPLIES 2
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
Associate II
Posted on October 07, 2016 at 16:27

Thank you very much for your relpy!

I solved it thanks to your help.