Recommended To Know before you go to this tutorial
1. How to configure PIC16F77A as a GPIO2. Simple Blinking LED tutorial with PIC16F77A
Multiple Blinking LED Tutorial
In this tutorial Blue, Green, Red, Yellow these 4 LEDs are turned on and off with some delay. It is one of the application of GPIO configuration.Embedded C Program
#include <xc.h>void main(void) {
//PORTA pin 0 as output
//Direction register configuration
TRISA = 0;
//Initialize the variable
//used for the delay
int i = 0;
//loop for ever
while(1)
{
//LED 4 OFF
RA3 = 0;
//LED 1 ON
RA0 = 1;
//Delay function
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
//LED 1 OFF
RA0 = 0;
//LED 2 ON
RA1 = 1;
//Delay
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
//LED 2 OFF
RA1 = 0;
//LED 3 ON
RA2 = 1;
//Delay function
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
//LED 3 OFF
RA2 = 0;
//LED 4 ON
RA3 = 1;
//Delay
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
for(i = 1; i< 6000; i++);
}
return;
}
Proteus Hardware simulation Circuit
Proteus Simulation Output
Here, All the LED's are turned on and off one by one with some delay.
Video Tutorial
Also See Multiple Bliking LED for 8051
I was getting bore since morning but as soon as I got this link & reached at this blog, I turned into fresh and also joyful too.
ReplyDeletefind
Rapidly this kind of fantastic web site will surely irrefutably often be well-known amongst many creating any website people, due to the fact thorough articles along with testimonies. visit here
ReplyDeleteBest Corporate Video Production Company in Bangalore and top Explainer Video Company, 3d, 2d Animation Video Makers in Chennai
ReplyDeleteExcellent article. Good tips! Fantastic stuff!
Your blogs further more each else volume is so entertaining further serviceable It appoints me befall retreat encore. I will instantly grab your rss feed to stay informed of any updates. entryway chandeliers
ReplyDelete