hi J. Newport, here you have a one second exact! rutine, sorry the commments are in spanish, but it works fine any way :) i have no time to translate it now. if you need longer time intervals, just call the rutine several times with a loop or keep the count in a register every time it finishes the routine. regards juan. ;****************** RUTINA DE RETARDO DE UN SEGUNDO ******************** un_segundo Y EQU .207 ;VALOR PARA UN SEGUNDO X EQU .254 ;VALOR PARA UN SEGUNDO XF EQU 12 ;REGISTRO DONDE SE GUARDA EL VALOR DE X YF EQU 13 ;REGISTRO DONDE SE GUARDA EL VALOR DE Y ;FORMULA GENERAL T= CXY + 3XY + BY + 4Y + A + 1 ; DONDE T= MICROSEGUNDOS, ;X= CONSTANTE ;Y= CONSTANTE ; A= RETARDO ;CONOCIDO ; B= RETARDO CONOCIDO ; C= RETARDO CONOCIDO. ; EN ESTE EJEMPLO, X=207, Y=254, A= 1, B= 0, C= 16 ; PARA X = 1; Y = 1; A=B=C= 0 T = 0 + 3 + 0 + 4 + 0 + 1 = 8 us. ; PARA X = 207; Y = 254; A=1, B=0, C=16 T = 841248 + 157734 + 0 + 828 + 1 + 1 = 999,812 MOVLW Y MOVWF YF ;DELAY (A) =1 NOP LABEL1 MOVLW X MOVWF XF ;DELAY (B)=0 LABEL2 ;DELAY (C) = 16 GOTO $+1 ;2 us. GOTO $+1 ;2 us. GOTO $+1 ;2 us. GOTO $+1 ;2 us. GOTO $+1 ;2 us. GOTO $+1 ;2 us. GOTO $+1 ;2 us. GOTO $+1 ;2 us. DECFSZ XF,F GOTO LABEL2 DECFSZ YF,F GOTO LABEL1 ;return END