dolphinlabs
...
Doplhin labs
News

Seven Segment Display Interfacing


·         Program Statement : Interfacing of 7 Segment with 89C51 microcontroller

Connections: Port P1.0-P2.7=Data pins of 7 segment (common anode configuration) Port P3.6=Disp1 pin of 7 segment.

 

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 COMMON ANODE pin of 7 segment interface to +5V supply pin

6.      Connect Disp1 pin to P3.6 pin of microcontroller

7.      Connect P1.0 to a 

         P1.1 to b

         P1.2 to c

         P1.3 to d

         P1.4 to e

         P1.5 to f

         P1.6 to g

         P1.7 to h pins of  microcontroller.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Circuit Diagram:

 

 

 

 

 

 

 

 

 

 

Program Code:

#include<reg51.h>

 sbit disp1=P3^6;                                   //P3.6=Display1

 void delay();

int  i, a[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};

void main()

 {

 while(1)                                             //Loop Forever

 {            

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

                                {

                                disp1=1;                //Disp1 on

                                P1=a[i];               //Data send on PORT P1

                                delay();               //Call delay

                                }

 }

 }

 void delay()                                    //Delay function

 {

                int i,j;

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

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

 }

 

 

 

 

 


Get SOCIAL







SAFE & SECURE SHOPPING

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