Content-ID: <0_156_874349646@emout09.mail.aol.com.7684> Content-type: text/plain You wrote >I'm looking for a routine that I can plug into my code that will >provide a delay of around three seconds, although a universal timing >routine would be nice where I could plug in a number between 1 and 255 and get some kind of delay out of it. I don't need to be doing >anything during the time delay so it doesn't have to be interrupt >driven. A long period timer uses one ram location and TMR0 can be expanded for longer times by using two locations three seconds is easy all the text assumes you are using a 4.00mHz osc 1US instruction time See attached TIMER.ASM Cheers Steve..... Content-ID: <0_156_874349646@emout09.mail.aol.com.7685> Content-type: text/plain; name="TIMER.ASM" section of initalisation code BANK1 ; REGISTER SET 1 MOVLW B'00000111' ; RTCC PRESCALER /256 MOVWF OPTION_REG ; 256 US PER COUNT BANK0 ; RESET REGISTER BANK long time timer w should contain the ammount 64mS periods to be counted when entering this timer LONG CLRF TMR0 ; CLEAR TO START MOVWF GP1 ; TEMP COUNT REG LONG2 BTFSC TMR0,7 ; 256 * 256 US = 64 MS@ 4.00 mhz GOTO JMP1 GOTO LONG2 ;LOOP UNTIL BIT SET JMP1 CLRF TMR0 ; YES SO CLR RTCC DECFSZ GP1,1 ; DECREASE TIL ZERO GOTO LONG2 ; ROUND THE LOOP RETLW 0 ; RETURN FROM SUB