You are on page 1of 2

list p=18f4550

#include "p18f4550.inc"

CONFIG FOSC = XT_XT ; Oscillator Selection bits (XT oscillator (XT))


CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled)
CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset
disabled in hardware and software)
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled
(control is placed on the SWDTEN bit))
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are
configured as digital I/O on Reset)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply
ICSP disabled)

org 0x0000
goto usuario

org 0x0020

usuario:
bcf TRISD, 0
lazo:
btfss PORTB, 0
goto no
bcf LATD, 0
goto lazo
no:
bsf LATD, 0
goto lazo
end

//

list p=18f4550
#include "p18f4550.inc"

CONFIG FOSC = XT_XT ; Oscillator Selection bits (XT oscillator (XT))


CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled)
CONFIG BOR = OFF ; Brown-out Reset Enable bits (Brown-out Reset
disabled in hardware and software)
CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled
(control is placed on the SWDTEN bit))
CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are
configured as digital I/O on Reset)
CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply
ICSP disabled)

cblock 0x0200
papa
camote
yuca
endc
org 0x0000
goto usuario

org 0x0020

usuario:
bcf TRISD, 0
lazaso:
bsf LATD, 0
call retardaso
bcf LATD, 0
call retardaso
goto lazaso

retardaso:
movlw .100
movwf papa
otro1:
call bucle1
decfsz papa,1
goto otro1
return

bucle1:
movlw .100
movwf camote

otro2:
call bucle2
decfsz camote,1
goto otro2
return

bucle2:
movlw .100
movwf yuca

otro3:
decfsz yuca,1
goto otro3
return

end

You might also like