Monday, January 30, 2012

How to interface seven segment display with 8051 microcontroller (AT89C51)

Posted by Anonymous at 9:17 PM 0 Comments
Seven Segment displays are used in a number of systems to display the numeric information. The seven segment can display one digit at a time. Thus the no. of segments used depends on the no. of digits in the number to be displayed. Interfacing seven segment with a controller or MCU is tricky. This article explains the interfacing of seven segment with MCU AT89C51. It displays the digits 0 to 9 continuously at a predefined time delay.

DESCRIBTION(click here)
  • A seven segment consists of eight LEDs which are aligned in a manner so as to display digits from 0 to 9 when proper combination of LED is switched on. Seven segment uses seven LED’s to display digits from 0 to 9 and the eighth LED is used for the dot. A typical seven segment looks like as shown in the figure below.
     
    Seven Segment are available in two configuration - (1) Common Anode (2) Common Cathode.
    Here common anode seven segment display is used because the output current of the microcontroller is not sufficient enough to drive the LED’s, similar to the case of driving an LED. The circuit diagram shows the connections of seven segment to the controller. The pins a to g of the Seven Segment are connected to the Port P2 of the microcontroller. The common pin of the seven segment is connected to Vcc. The  ‘h’  has not been used, which is the dot pin of the controller.

    Since the seven segment display works on negative logic, we will have to provide logic 0 to the corresponding pin to make an LED glow. Table below shows the hex values used to display the different digits.
     
    DIGIT
    a
    b
    c
    d
    e
    f
    g
    HEX Value
    0
    0
    0
    0
    0
    0
    0
    1
    0x40
    1
    1
    0
    0
    1
    1
    1
    1
    0xF9
    2
    0
    0
    1
    0
    0
    1
    0
    0x24
    3
    0
    0
    0
    0
    1
    1
    0
    0x30
    4
    1
    0
    0
    1
    1
    0
    0
    0x19
    5
    0
    1
    0
    0
    1
    0
    0
    0x12
    6
    0
    1
    0
    0
    0
    0
    0
    0x02
    7
    0
    0
    0
    1
    1
    1
    1
    0xF8
    8
    0
    0
    0
    0
    0
    0
    0
    0x00
    9
    0
    0
    0
    1
    1
    0
    0
    0x10

    When the values corresponding to the digits 0 to 9 are given on the output port, the digit gets displayed on the seven segment.

CODE(click here)
  • 
    // Program to interface single seven segment
    
     
    
    #include<reg51.h>
    
    
    
    delay_ms(int time)  // Time delay function
    
    {
    
     int i,j;
    
      for(i=0;i<time;i++)
    
       for(j=0;j<1275;j++);
    
    }
    
    
    
    void main()
    
    {
    
     char num[]={0x40,0xF9,0x24,0x30,0x19,0x12,0x02,0xF8,0x00,0x10};  // Hex values corresponding to digits 0 to 9
    
     int c;
    
     while(1)
    
     {
    
      for(c=0;c<10;c++)
    
      {
    
      P2=num[c]; 
    
      delay_ms(200);
    
      }
    
     }
    
    }
    
    
COMPONENTS(click here)
  • AT89C51 Microcontroller
  • LED
  • Seven segment display
Tags:

Share This Post

Get Updates

Subscribe to our Mailing List. We'll never share your Email address.

0 comments:

THANKS FOR UR COMMENT ....

Categories

Labels

AERONAUTICAL AEROSPACE AGRICULTURE ANDROID Android project titles Animation projects Artificial Intelligence AUTOMOBILE BANK JOBS BANK RECRUITMENTS BIG DATA PROJECT TITLES Bio instrumentation Project titles BIO signal Project titles BIO-TECHNOLOGY BIOINFORMATICS BIOMEDICAL Biometrics projects CAREER CAT 2014 Questions CHEMICAL CIVIL Civil projects cloud computing COMP- PROJ-DOWN COMPUTER SCIENCE PROJECT DOWNLOADS COMPUTER(CSE) CONFERENCE Data mining Projects Data protection. Design projects DIGITAL SIGNAL PROCESSING IEEE Project titles Dot net projects EBOOKS ELECTRICAL MINI PROJECTS ELECTRICAL PROJECTS DOWNLOADS ELECTRONICS MINI PROJECTS ELECTRONICS PROJECT DOWNLOADS EMG PROJECTS employment Engineering projects Exams Facts final year projects FOOD TECHNOLOGY FREE IEEE 2014 project Free IEEE Paper FREE IEEE PROJECTS GATE GAte scorecard GOVT JOBS Green projects GSM BASED Guest authors HIGHWAY IEEE 2014 projects ieee 2015 projects IEEE computer science projects IEEE Paper IEEE PAPER 2015 ieee project titles IEEE projects IEEE Transactions INDUSTRIAL INNOVATIVE PROJECTS INTERFACING IT IT LIST Java projects labview projects LATEST TECHNOLOGY list of project centers Low cost projects m.com MARINE Matlab codes MATLAB PROJECT TITLES MATLAB PROJECTS MBA MBA 2015 projects MCA MECHANICAL MECHANICAL PROJECTS DOWNLOAD MINI PROJECTS modelling projects MP3 MP3 cutter Mp4 Networking topics ns2 projects online jobs PETROCHEMICAL PHYSIOLOGICAL MODELLING projects physiotheraphy Projects Power electronics power system projects PRODUCTION project centers project downloads Prosthesis projects RAILWAY RECRUITMENT 2012 Recent RECENT TECHNOLOGY RECENT TECHNOLOGY LIST RECRUITMENT Rehabilitation projects renewable power respiration projects RESUME FORMAT. Ring Tone Cutter Robotics projects. Robots in medical social network jobs Solar projects Songs Cutter Speech-music separation-Abstract structural engineering TECHNOLOGY technology management TELE COMMUNICATION TEXTILE TOP ENGINEERING COLLEGES Training VLSI

Disclaimer

This blogs is an effort to club the scattered information about engineering and project titles and ideas available in the web. While every effort is made to ensure the accuracy of the information on this site, no liability is accepted for any consequences of using it. Most of the material and information are taken from other blogs and site with the help of search engines. If any posts here are hitting the copyrights of any publishers, kindly mail the details to educations360@gmail.com It will be removed immediately.

Alexa Rank

back to top