908JK3 - clearing TOF bit.

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

908JK3 - clearing TOF bit.

1,075 Views
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?

Labels (1)
0 Kudos
Reply
3 Replies

586 Views
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 Kudos
Reply

586 Views
JimDandy
Contributor III

Aha!

I was imagining you had to read the whole byte.

 

Thanks, peg.  :smileytongue:

0 Kudos
Reply

586 Views
kef
Specialist I

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

0 Kudos
Reply