'Timer 1 rollover on 16c73'
|On the 16C73 I'm using Timer 1 free running and need to get
the current value of the timer precisely. As you may be
reading either high or low bytes as the other is rolling over
you must check for the rollover and reread if necessary. This
is fine except that I now do not know the timer value precisely
as requested. I can recify this by taking a constant from the
read value (if it took the long route).
Hence the problem, at what point in the fetch/decode stage is the
timer incremented. Also if it is a rollover is the carry out
asyncronous and at what point would the high byte be incremented
based on the carry being set.
Here is the offending code:
//check if overflow
btfsc STATUS,2 //bit 2 is zero bit
// Fiddle to get timer value correct independant of
// above route to get timer
// If (var_timL <= ?VALUE?-1)
// var_timH = var_timH -1
// var_timL = var_timL - ?VALUE?
Here's hoping someone can help.
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- New search...