LED Blink Demo


Here is a simple example program in Assembly language for LED blinking project. This code written in MPLAB IDE.

Compiler : Microchip ASM Compiler

Kit : Bootloader USB PIC18F4550

Project : LED Blinking Demo


Hardware connection : RD6 -> LED 1


Create a project file in MPLAB is here



	processor PIC18F4550
	#include < p18f4550.inc>


temp1 equ 0x26
temp2 equ 0x27
temp3 equ 0x28

	org 0x2000
	goto init
	org 0x2020
	goto int_isr

init
	movlw b'00001111'
	movwf TRISD
	clrf INTCON
loop
	bsf PORTD,6
	call delay1sec
	bcf PORTD,6
	call delay1sec	
	goto loop	

delay1sec                    ; appx. 1sec delay
    movlw .60
	movwf temp3
dela
	decfsz temp1,1
	goto dela
	decfsz temp2,1
	goto dela
	decfsz temp3,1
	goto dela
	return
int_isr
	retfie
	end


User Comments

No Posts found !

Login to Post a Comment.