Quote Originally Posted by selbstdual View Post
Difference of time(MyMethod <-> Timer0) is the linchpin of this thread. .
As far as I understood you need to get the time elapsed between two states of your comparator. You can always get two intermediate readings. Get the difference between the readings. Even if prescale is 1:1 and you are using ASM interrupts then you know how may cycles you consumed to take a reading and asjust your results thus. This should give you far more accurate results than looping around. Cause you can just stop the timer at the comparator interrupt. Get the results. I suggested a pseudo 16bit because I don't know your possible timings between comparator changes. Thus timer zero may overflow. You did ask how to handle overflow!! With the additional Highbyte incrementing on overflow you do get a 16bit timer.