Hmmm... don't quite understand your figures...
1/60=16667uS = $411B based on 1uS tick time (4MHz clock)
$0000-$411B=$BEE5
Use Microsofts Calculator in Scientific mode... you cant do 0-411B in hex directly, so instead do FFFF-411B and just add 1 to your answer.
Setting the clock for a 16667uS count would be...
T1CON.0=0 ' Stop the Clock
TMR1H=$BE ' Set Timer Highbyte
TMR1L=$E5 ' Set Timer Lowbyte
T1CON.1=1 ' Restart the Clock
PIR1.0=0 ' Reset TMR1's Interrupt Flag
If you're returning from an Interrupt then use RESUME otherwise if it's from a subroutine use RETURN.
You may have to adjust the $E5 value slightly to trim your time accurately to account for instruction cycle time in setting the clock etc.
Bookmarks