908JK3 - clearing TOF bit.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

908JK3 - clearing TOF bit.

928 次查看
JimDandy
Contributor III

As per the manual:

"Clear TOF by reading the TIM status and control register when TOF is set and then writing a zero to TOF."

 

Now if the timer has overflowed I have no use for the data it now contains, so to clear the TOF bit do I still have to do a dummy read of TSC and then clear the TOF bit, or can I just clear the TOF bit and be done with it?

标签 (1)
0 项奖励
回复
3 回复数

439 次查看
peg
Senior Contributor IV

Hello,

 

Yes you must still do the read.

However if you use BCLR this is a read-modify-write and so does this in one instruction.

 

0 项奖励
回复

439 次查看
JimDandy
Contributor III

Aha!

I was imagining you had to read the whole byte.

 

Thanks, peg.  :smileytongue:

0 项奖励
回复

439 次查看
kef
Specialist I

And you make CPU reading whole byte. Doing BSET/BCLR CPU still is reading and writing whole memory bytes.

0 项奖励
回复