-I ask for help in making a 5-minute delay in PIC.. someone on this site (Gayan) had posted it.. I don't really understand most of the codes and on how it runs..
list p=16F84A
#include <p16F84A.inc>
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _RC_OSC
d1 equ 0x0D
d2 equ 0x0E
d3 equ 0x0F
d4 equ 0x10
org 0X000
goto Init
org 0X004
retfie
Init
bsf STATUS,RP0
clrf TRISB
clrf TRISA
bcf STATUS,RP0
clrf PORTA
clrf PORTB
Main
bsf PORTB,0
call Del5M
bcf PORTB,0
call Del5M
goto Main
Del5M
movlw 0x54
movwf d1
movlw 0xA1
movwf d2
movlw 0xFD
movwf d3
movlw 0x02
movwf d4
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto $+2
decfsz d4, f
goto Delay_0
;5 cycles
goto $+1
goto $+1
nop
return
end
list p=16F84A
#include <p16F84A.inc>
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _RC_OSC
d1 equ 0x0D
d2 equ 0x0E
d3 equ 0x0F
d4 equ 0x10
org 0X000
goto Init
org 0X004
retfie
Init
bsf STATUS,RP0
clrf TRISB
clrf TRISA
bcf STATUS,RP0
clrf PORTA
clrf PORTB
Main
bsf PORTB,0
call Del5M
bcf PORTB,0
call Del5M
goto Main
Del5M
movlw 0x54
movwf d1
movlw 0xA1
movwf d2
movlw 0xFD
movwf d3
movlw 0x02
movwf d4
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto $+2
decfsz d4, f
goto Delay_0
;5 cycles
goto $+1
goto $+1
nop
return
end