About Timer TCNT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

About Timer TCNT

611 Views
jx1207
Contributor I

Hi,

  调试程序的时候发现,使能定时器后定时器开始计数,但是禁止定时器TIM0TSCR1_TEN=0;定时器的TCNT和TCTL并没有清零,而是在定时器开启后继续向上计数。我想要在定时器关断时,定时器TCNT和TCTL都清零,有什么办法吗?

0 Kudos
3 Replies

535 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi jx1207@126.com,

Which MCU are you using?

Thank you,

BR, Daniel

0 Kudos

535 Views
jx1207
Contributor I

S12ZVL

0 Kudos

535 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi jx1207@126.com,
The TCTL registers can be cleared by a write anytime.
But unfortunately, the TCNT counter cannot be reset in Normal mode, the register is writable in Special mode only.
And there is no mechanism that would clear the counter automatically.

Regards,

Daniel

0 Kudos