0% found this document useful (0 votes)
7 views2 pages

Interfacing with Seven Segment LED Display

The document explains how to interface a seven segment LED display with a microcontroller, detailing its structure and types (common cathode and common anode). It includes a digit drive pattern table for displaying numbers 0-9 and provides a sample C program for interfacing with the 8051 microcontroller. The program demonstrates how to display digits by sending hexadecimal values corresponding to each digit to the display.

Uploaded by

suraj.k2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Interfacing with Seven Segment LED Display

The document explains how to interface a seven segment LED display with a microcontroller, detailing its structure and types (common cathode and common anode). It includes a digit drive pattern table for displaying numbers 0-9 and provides a sample C program for interfacing with the 8051 microcontroller. The program demonstrates how to display digits by sending hexadecimal values corresponding to each digit to the display.

Uploaded by

suraj.k2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Interfacing with Seven Segment LED Display :

7 segment LED display is very popular and it can display digits from 0 to 9 and quite a few characters
like A, b, C, ., H, E, e, F, n, o,t,u,y, etc. Knowledge about how to interface a seven segment display to
a micro controller is very essential in designing embedded systems. A seven segment display consists
of seven LEDs arranged in the form of a squarish ‘8’ slightly inclined to the right and a single LED as
the dot character. Different characters can be displayed by selectively glowing the required LED
segments. Seven segment displays are of two types, common cathode and common anode. In
common cathode type , the cathode of all LEDs are tied together to a single terminal which is usually
labeled as ‘com‘ and the anode of all LEDs are left alone as individual pins labeled as a, b, c, d, e, f, g
& h (or dot) . In common anode type, the anode of all LEDs are tied together as a single terminal and
cathodes are left alone as individual pins. The pin out scheme and picture of a typical 7 segment LED
display is shown in the image below.

Digit drive pattern of a seven segment LED display is simply the different logic combinations of its
terminals ‘a’ to ‘h‘ in order to display different digits and characters. The common digit drive
patterns (0 to 9) of a seven segment display are shown in the table below.

Digit a b c d e f g

0 1 1 1 1 1 1 0

1 0 1 1 0 0 0 0

2 1 1 0 1 1 0 1

3 1 1 1 1 0 0 1

4 0 1 1 0 0 1 1

5 1 0 1 1 0 1 1

6 1 0 1 1 1 1 1

7 1 1 1 0 0 0 0

8 1 1 1 1 1 1 1
9 1 1 1 1 0 1 1

C – Program :

/ Code for 7 Segment Display Interfacing with 8051 Microcontroller

#include<reg51.h>
void msdelay(unsigned int time) // Function for creating delay in milliseconds.
{
unsigned i,j ;
for(i=0;i<time;i++)
for(j=0;j<1275;j++);
}
void main()
{
unsigned char no_code[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; //Array for hex
values (0-9) for common anode 7 segment
int k;

while(1)
{
for(k=0;k<10;k++)
{
P2=no_code[k];
msdelay(100);
}
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy