Adrian,
All latencies can be easily compensated for, by ADDING the reload value to the timer instead of just copying the value to the time.
At the time the interrupt occurs, the value of the timer is 0, and it continues counting while the chip is doing what ever it has to do to get to the Handler.
When it gets to the handler, and is ready to reload the timer, the timer already has an EXACT count of how long it took to get there. So when you ADD the const to the timer, it actually subtracts the time it took from the const and EVERYTHING is accounted for.
Take a look at this page ...
http://www.darreltaylor.com/DT_INTS-...rTemplate.html
That program has everything you need, but at a minimum, check out the ReloadTMR1 routine which shows an easy 8 instruction cycle adding reload.
hth,
Bookmarks