One instruction to jump to interrupt, one to stop timer, 2 to load TMR1H, 2 to load TMR1L, and 1 to enable time. So that is 7 instruction. So if you need 8, just add @ NOP.
But you say that you use DT_Int, so you probably use more than 7 instruction. You need to check dissembly of hex file to count how instruction is used between int vector, and timer reload. Also, this depending on clock source for that timer. This is case if clock source is from OSC/4. If you have 32768Hz crystal, then your Reload cycle is 0. Because TMR clock is much slower than interrupt. So probably 1 clock cycle for tmr last longer then all instruction to reload timer.
Your interrupt error is 0.001%, but crystal error are probably 1-5%, so that small error won't contribute much to overall time precision.
EDIT:
richard type faster than me![]()
Bookmarks