Interfacing LEDs with the 80C51 Microcontroller
Pin Diagram:
In this tutorial, I'll ahow you how to interface LEDs with 8051 family microcontroller, 80C51 Controller. The LEDs in this tutorial are connected in the Sinking mode.
Components Used:
1. 80C51 Controller
2. Resistors
3. Capacitors
4. Crystal Oscillator
5. LEDs
6. Push Button
Proteus Circuit Diagram Code:
//Code by Shahid Khan
//Interfacing LEDs
#include
sbit REDLED = P3^4;
sbit GREENLED = P3^5;
void Delay();
void main()
{
for(;;)//end less loop
{
REDLED = 1;
Delay();
GREENLED =1;
Delay();
REDLED = 0;
Delay();
GREENLED = 0;
Delay();
}
}
void Delay()
{
unsigned int x;
for(x=0; x<20000; x++);
}
Simulation Video
Components Used:
1. 80C51 Controller
2. Resistors
3. Capacitors
4. Crystal Oscillator
5. LEDs
6. Push Button
Proteus Circuit Diagram Code:
//Code by Shahid Khan
//Interfacing LEDs
#include
sbit REDLED = P3^4;
sbit GREENLED = P3^5;
void Delay();
void main()
{
for(;;)//end less loop
{
REDLED = 1;
Delay();
GREENLED =1;
Delay();
REDLED = 0;
Delay();
GREENLED = 0;
Delay();
}
}
void Delay()
{
unsigned int x;
for(x=0; x<20000; x++);
}
Simulation Video
Post a Comment