Arduino Projects    |   Raspberry Pi  |     Electronic Circuits    |    AVR    |    PIC    |    8051    |    Electronic Projects   |   Free TI Design & Simulation Tools 

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

Summary

Developed By: 
Himanshu Choudhary

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.

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

Description


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.
 

Circuit Diagram


Video

Code

This Code is only visible to Registered users. Please Login/Register

Code2

This Code is only visible to Registered users. Please Login/Register

Components

LEDs | Light Emitting Diode
LED
 
Light emitting diodes (LEDs) are semiconductor light sources. The light emitted...
7 Segment Display | Seven Segment LED Display
Seven Segment Display
 
A seven segment display is the most basic electronic display device that can display digits from 0-9. They find wide application in devices that display numeric information like digital clocks, radio, microwave ovens...
AT89C51 Microcontroller, Atmel 89C51 Controller Image
AT89C51 Microcontroller

AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (...

Free Circuit Design & Simulation Tool by TI

Free Powerful Circuit Design & Simulation Tool by Texas Instruments

TINA-TI is a powerful circuit design and simulation tool. TINA-TI is ideal for designing, testing, and troubleshooting a broad variety of basic and advanced circuits, including complex architectures, without any node or number of device limitations.

Download It Here

Features:

Tina TI

TINA is an easy-to-use, powerful circuit simulation tool based on a SPICE engine. TINA-TI is a fully functional version of TINA, loaded with a library of TI macromodels plus passive and active models.

TINA-TI's new version 9 has changes from Version 7.0 in the following areas:

  • Schematic Symbol Editor (useable with the Macro Wizard) is included, so you can create your own symbols for imported SPICE macromodels.
  • Macros do not have to be from TI - you can import anyone's SPICE model now!
  • Does not require active or non-linear components for analysis (so you can now run a circuit using just passives).
  • TINA-TI includes Initial Condition and Nodeset components
  • TINA-TI includes Linear and nonlinear controlled sources (VCVS, CCVS, VCCS, CCCS), and the Controlled Source Wizard.
  • TINA-TI now allows WAV files to be used as stimulus (signal sources). You can play calculated waveforms on PC's multimedia system, and export calculated waveforms as a *.wav file.
  • TINA-TI has Multi-core processor support; this along with other optimizations makes simulations run 2-20 times faster.
  • Schematic file import/export in XML format
  • Block Wizard included for making block diagrams
  • TINA-TI has more SPICE models and example circuits included.
  • Circuits developed in TINA-TI 9 will work with TINA Industrial version 9.
  • TINA-TI Version 7.0 is forward compatible with Version 9, and version 9 supports saving schematics in version 7.0 format.
  • Available in English, Traditional and Simplified Chinese, Japanese, and Russian versions.

Download The Tool Here Free

You are here