Cant help you on the overflow case till I look at it a bit more.
But the assignment
[code:1:2945b3e06b]
dim I as word
I = tcnt1
'or
I = timer1
'or
I - counter1
[/code:1:2945b3e06b]
should all compile correctly, and read the timer1 current count. At least they do when I do it.
Actually, for what you want, its better to read the value in capture1, since that is the value 'captured' by the interrupt at the edge of the pulse. You dont even have to do this in the ISR, just clear the timer count in there ready for the next edge.
That still leaves the problem of handling the overflow, though.
↧