dolphinlabs
...
Doplhin labs
News

LED Multiaction


Ř  Program Statement: Interfacing of multiple LEDs with 89C51 microcontroller.

Connections: Port P2.0-P2.7= LED0-LED7(Sink mode)

                          Resistors are connected to limit the current.

Hardware Connections for 8051 Board:-

1.      Give supply to 8051 board with the help of adapter

2.       Connect +5V pin of 8051 microcontroller to +5V supply and GND pin of 8051 microcontroller to GND pin of supply.

3.      Connect +5V pin of RS232 interface to +5V supply and GND pin of RS232 interface to GND pin of supply.

4.      Connect R2OUT pin of RS232 interface to RXD pin of 8051 and T2IN pin of RS232 interface to TXD pin of 8051.

5.      Connect +5V of LED interface block to +5V supply.

6.      Connect all pins of PORT0 to all LEDs of LED interface block using bus wire.

 

 

 

 

 

                 

 

 

 

 

 

 

 

 

 

Circuit Diagram:

 

 

 

 

 

 

 

Program Code:

#include<reg51.h>

void delay();             

void main()

{

P2=0x00;                         //make P2 as output port

while(1)                          //repeat forever

{

P2=1;                // make P2 high

delay();              //call delay function

P2=0;                 //make P2 low

delay();

}

}

void delay()        

{

int i,j;                  

for(i=0;i<2000;i++);

for(j=0;j<10000;j++);

}

 

 

 

 

 

 

 

 


Get SOCIAL







SAFE & SECURE SHOPPING

visa card master card maestro card
Maverick IT Industries Pvt. Ltd.