Quote Originally Posted by Art View Post
...For the 20MHz example where the constant is 03B7h, it's the reverse of this:

FFFFh - 03B7h = C348h (49992 decimal),
49992 + 8 = 50000 (it must take eight instruction cycles to reload the timer)
50000 / 10000 = 5
5 x 4 = 20MHz

... Art.

For the next guy that needs to incorporate the Prescaler into Art's formula (like when you want to calculate Preload for faster oscillators):

65535 - (((( MHz / Prescaler ) / 4 ) x 10000 ) - 8 )

Then set T1CON prescaler accordingly.