AnsweredAssumed Answered

How to configure the starting direction of center-aligned Timer

Question asked by Zheng Liang on Mar 2, 2018
Latest reply on Mar 4, 2018 by waclawek.jan

Device: STM32F103

 

I wanna set the direction(counting up or down) when starting a center-aligned Timer, but once I set the DIR and then set the CMS to center-aligned mode, the DIR bit will be cleared by hardware.

 

I found this description in datasheet:

When starting in center-aligned mode, the current up-down configuration is used. It
means that the counter counts up or down depending on the value written in the DIR bit
in the TIMx_CR1 register. Moreover, the DIR and CMS bits must not be changed at the
same time by the software.

 

How could I start the center-aligned mode with down direction?

 

If someone knows, please tell me.

thanks.

Outcomes