Hello Xyvind, Again, you leave the room for error. Even if you read TMR0 and then check for TMR0 overflow, this doesn't solve the problem. TMR0 can read 255 and overflow before you check T0IF. So you get the error again. Nikolai On Tuesday, February 08, 2000 Xyvind Kaurstad wrote: [snip] > The current ISR looks like this: > org 0x04 > movwf W_TEMP > swapf STATUS,0 > bcf STATUS,RP0 > movwf STAT_TEMP ;Saves W and STATUS registers > btfss INTCON,INTF ;RPM-interrupt? > goto nex_chk_1 ;Nope, skip to end of handler > bsf STAT,0 ;Signals that an RPM pulse-count is ready > movf TMR0,0 > clrf TMR0 ;Clears TMR0 > movwf TIMER_STR ;Stores cur. TMR0 value in TIMER_STR low byte > btfss INTCON,T0IF ;Timer interrupt pending? > goto $+3 ;Nope, skips next two instructions > incf TIMER,1 ;Increases TIMER manually > bcf INTCON,T0IF ;Clears the timer interrupt > movf TIMER,0 > movwf TIMER_STR+1 ;Stores TIMER in TIMER_STR high byte > clrf TIMER > bcf INTCON,INTF ;Clears the RPM-interrupt > nex_chk_1 > btfss INTCON,T0IF ;Timer interrupt? > goto end_handler ;Nope, skip to end of handler > incf TIMER,1 ;Increase timer high byte by 1 > bcf INTCON,T0IF ;Clears the T0IF interrupt > end_handler > swapf STAT_TEMP,0 > movwf STATUS > swapf W_TEMP,1 > swapf W_TEMP,0 ;Restores W and STATUS registers > retfie > Any good hints on jitter improvement? > The external interrupt is in the frequency range of 0 to 350 Hz, and > the TMR0 module has a prescaler of 1:2. The processor is running > at 10MHz. > -Xyvind > _______________________________________________ > Xyvind Kaurstad, oyvind@safetel.no > Safetel AS > P.B. 405, N-4067 Stavanger, Norway > Tel: +47 51 81 78 80 (Switchboard) > +47 51 81 78 82 (Office) > +47 51 81 78 93 (Fax)