
Originally Posted by
Darrel Taylor
There's the problem ...
Code:
TMR1L=0
TMR1H=128
@ INT_RETURN
By the time it gets all the way through the interrupt handler, another tick or two may have been counted by Timer1.
That gets lost when you reload both bytes of the Timer.
For 32768 crystals, the reload is really simple ...
And it's best to put it at the beginning of the handler.
Although in your case, the handler is fast enough it won't matter were it is.
I did TMR1H.7=1, but the code is not entering the interrupt. I checked it with changing it to TMR0, it works. Am I making a mistake in setting up timer1?
___________________
WHY things get boring when they work just fine?
Bookmarks