Blinking LED using PIC microcontroller PIC16F877A and Proteus simulation

Before Going to this PIC16F877A LED blinking tutorial, we are recommending you to see how to configure a pin in PIC microcontroller PIC16F877A as input or outtput. From the link below

Click Here

If you have learned how to configure the PIN as a output using TRIS directio register. You can go forward to use it in a application. i.e., Blinking LED using PIC16F877A pic microcontroller.

PICF16F877A Blinking LED Circuit (Proteus)


In this circuit Oscillator frequency is used as 8MHz. and a RA0 is connected to the LED through a 400 ohm resistor.

Embedded C Program

#include <xc.h>
void main(void) {
    //PORTA pin 0 as output
    TRISA0 = 0;
    //Initialize the variable
    int i = 0;
    //loop for ever
    while(1)
    {
       //LED ON
       RA0 = 1;
       //Delay
       for(i = 1; i< 6000; i++);
       //LED OFF
       RA0 = 0;
       //Delay
       for(i = 1; i< 6000; i++);    
    }
    return;
}

PIC16F877A blinking LED Proteus Output



Whenever the RA0 is high LED will blink, and when it is low it will not blink. A small delay is given to visually see the led blink in a real world.

Blinking LED using PIC16F877A PIC microcontroller video tutorial


To Download this Project Click here

Blinking LED for 8051

No comments:

Post a Comment