LIST P=18F452,r=hex,n=80,x=off,st=off
#include <P18F452.INC>
; Configuration bits
; ==================
CONFIG OSC=XT, PWRT=ON, BOR=OFF, WDT=OFF, LVP=OFF, DEBUG=OFF
cblock 0x000 ; start of ram memory
d1,d2,d3 ; delay work files
endc
ORG 0000H
goto start
start
clrf TRISB
movlw 0ffh
MOVWF PORTB
again:
SETF PORTB
call DELAY
CLRf PORTB
CALL DELAY
bra again
; Subroutine
; Delay = 1 seconds
; Clock frequency = 4 MHz
DELAY
movlw 0x08
movwf d1
movlw 0x2F
movwf d2
movlw 0x03
movwf d3
DLY0
decfsz d1, f
goto DLY1
decfsz d2, f
DLY1
goto DLY2
decfsz d3, f
DLY2
goto DLY0
return
end