Usb pic18f4550 :: Led blinking

LED Blink Demo


Compiler : Microchip ASM Compiler

Kit : Bootloader USB PIC18F4550

Project : LED Blinking Demo


Hardware connection : RD6 -> LED 1

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


Create a project file in MPLAB is here


/*  SOURCE : WWW.ROMUX.COM
    AUTHOR : romux team     */ 
    
    
	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








Post Your Comments Here :
 


User Login

Username :


Password :