Electrofriends

Interfacing 7-Segment Display using lookup table

by Ranjith | April 28th, 2009.

The Light Emitting Diode (LED), finds its place in many applications in this modern electronic fields. One of them is the Seven Segment Display. Seven-segment displays contains the arrangement of the LEDs in “Eight” (8) passion, and a Dot (.) with a common electrode, lead (Anode or Cathode). The purpose of arranging it in that passion is that we can make any number out of that by switching ON and OFF the particular LED’s. Here is the block diagram of the Seven Segment LED arrangement.

Pin configuration of a seven segment display:
7 segment pin configuration

LED’s are basically of two types:

  1. Common Cathode (CC)
    All the 8 anode legs uses only one cathode,  which is common.
  2. Common Anode (CA)
    The common leg for all the cathode is of Anode type.

For the discussion purpose, we use CC LED, where by just reversing the logical voltages we can implement the same for CA LED also.

In a CC LED, all the 8 legs (‘a’ through ‘h’) are of anode type and the common cathode will be connected to the GND of the supply. By energizing any of the legs with +5 Volts will lead to switch the correspondent segment ON. In the microprocessor binary system, 0Volts will be considered as Binary 0, and 5Volts will be considered as Binary1. Considering these two condition, we can make an arrangement as the microcontroller gives OUT the 0s and 1s through its ports, which is connected to the 8 legs of the LED. Of course, we can control the Port Output; implicitly we can Switch-ON required legs of the display.

There 2 methods of interfacing LED with the Microcontroller Intel 8051/8951.

  1. Using lookup table. This uses 7 output pins of microcontroller
  2. Using 7447 decoder. This method uses 4 output pins of microcontroller

The difference between the two main methods is simple and clear. In both the cases, microcontroller communicates with external world through its ports. But, in the 1st case, we connect all the 8 pins of the port directly to the LED and control the voltage through the ports manually to display the desired number.  But, in the second case, we send the BCD of the number that we wanted to display to a middleware IC 7447, the BCD to LED code converter, which by itself gives out the correspondent 7 segment codes to the LED.

Here we explain using lookup table. Click here for the method “using 7447 decoder”

Using Lookup Table:

As we discussed, this method uses the port of the microcontroller to display the desired number. The common cathode pin is connected to GND by external wire, if it is the CC LED and in the case of the common Anode LED, the Anode pin is connected to +Vcc. Here, other pins of the LED are connected to Port 2 of 8951. A table will be prepared which relates the BCD code to the LED display code (pattern). We call it as Lookup table. The table below explains how we construct the Lookup table. Circuit diagram is given below.

Circuit diagram for Common Anode 7-Segment Display:

7 segment circuit comon anode

Circuit diagram for Common Cathode 7-Segment Display:

7 segment circuit comon cathode

Pages: 1 2

Share and Enjoy:
  • Digg
  • Technorati
  • StumbleUpon
  • TwitThis
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • Mixx
  • Yahoo! Buzz
  • LinkedIn
  • MySpace
  • FriendFeed
  • NewsVine
  • Netvibes
Similar Posts:

3 Responses to Interfacing 7-Segment Display using lookup table

  1. nithinissac

    need a AT89C51 microcontroller compiler

  2. Interfacing 7-segment display using 7447 decoder | electrofriends

    [...] Using lookup table. This uses 7 output pins of microcontroller [...]

  3. progs

    do you have pcb diagram of 7 segment

Leave a Reply

Electrofriends Comments
  • Ranjith: You can give a link to this article in your website.
  • ashish: i need to design this car…would you pls send me all the details of it..what all stuff is required every...
  • Rinny Verma: hi………..plz send me the details n specifications of the robot….
  • omar: can u tell me how to control pitman motor using at89s51 through h bridge give ,jut move the motor in forward...
  • dinesh raghuwanshi: respected sir, i want make digital ic tester ,so i required some more detail of this project such...
  • Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya