LED interfacing with PIC18F4550 Microcontroller

By | July 20, 2015

LED interfacing with PIC18F4550 – Block diagram

 

LED(s) interfacing with pic18f4550

LED interfacing with PIC18F4550 – Code

/*
* Project : LED interfacing with PIC18F4550 Microcontroller
* Description : In this project, Let us interface
*               8 LEDs to a PIC18f4550 microcontroller.
* Software : MPLAB IDE v8.33
* MCU : PIC18F4550
* Oscillator : 12 MHz
* Date : 19-July-2015
*/

#include<p18f4550.h>

#pragma config PLLDIV = 5, CPUDIV = OSC1_PLL2, USBDIV = 2
#pragma config FOSC = HS, FCMEN = OFF, IESO = OFF
#pragma config PWRT = OFF, BOR = OFF, VREGEN = OFF
#pragma config WDT = OFF, WDTPS = 32768
#pragma config MCLRE = ON, LPT1OSC = OFF, PBADEN = OFF
#pragma config STVREN = ON, LVP = OFF, ICPRT = OFF, XINST = OFF

/****************  Delay ****************/
void delay(int i)
{
int j;
for(;i;i--)
for(j=0;j<500;j++);
}

/**************** Main ******************/
void main(void)
{
TRISB = 0x00 ;
while(1)
{
LATB = 0x55;
delay(300);
LATB = 0xAA;
delay(300);
}
}

/* THE END */

LED interfacing with PIC18F4550 – Circuit

LED(s) interfacing with pic18f4550

 

LED interfacing with PIC18F4550 – Output image

LED interfacing with pic18f4550

 

 

LED interfacing with PIC18F4550 – Video

Category: PIC

2 thoughts on “LED interfacing with PIC18F4550 Microcontroller

  1. kgan4dev

    Hi Sir,

    Can you please describe about your development board.?

    Thanks,
    Ganesh

    Reply
  2. Hosting

    It should work try changing the pin of microcontroller.. verify that the LED is working .. by connecting it to 5V instead of .. to pic.. If above solutions not working.. try replacing your microcontroller or programmer..

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *