Ioannis,
Thanks for catching the typo! As for the prescaler not clearing, I actually thought about that but the datasheet says that writing to TMR0 does clear the prescaler (when it is assigned to TMR0) so it shouldn't be an issue. Now, with the '877 it's of little importance anyway.
grimmjow,
Yes, TMR1 on the 'F877 is controlled thru its own control register and you get its 16bit value almost like you shown:
timepassed = TMR1H * 256 + TMR1L
Make sure you stop the timer before reading it or you MAY get weird results if the low byte happens to roll over between you reading it and the high byte.
And no, you don't need to use any prescaler since the 16bit wide timer allows you to measure 65535us which is far more than you need.
Good luck!
/Henrik.
Bookmarks