0% found this document useful (0 votes)
92 views11 pages

Seven Segment Interfacing With 8051

This document describes how to interface a seven segment display with an 8051 microcontroller and display numeric digits. It includes a lookup table containing the patterns to light the correct LEDs to display each number, and a program that copies these patterns to the port pins to display the digits in sequence with a delay.

Uploaded by

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

Seven Segment Interfacing With 8051

This document describes how to interface a seven segment display with an 8051 microcontroller and display numeric digits. It includes a lookup table containing the patterns to light the correct LEDs to display each number, and a program that copies these patterns to the port pins to display the digits in sequence with a delay.

Uploaded by

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

Seven Segment Interfacing with

8051
• Seven Segment display is nothing but an electronic
device used for displaying the numeric data.
• It's a complex form of LED matrix and is normally
used in clocks, LCD displays, calculators etc where
there's a need to display the numeric data.
• It has total seven leds in it which you can also count
from above image and by turning these LEDs ON or
OFF we can display any numeric on it.
• For example, have a look at the below image.
• In this image I have shown numeric 0 on
seven segment.
• Now in order to do so, I just simply turn OFF
the centered LED and turn ON all the corner
LEDs and it becomes 0.
Keil Program
• ORG 4000H
• DB 3FH, 06H, 5BH, 4FH, 66H, 6DH, 7DH, 07H, 7FH, 6FH, 8FH
• ; Lookup table for digits 0 to 9

• ORG 0000H
• main: MOV DPTR, #4000H
• repeat: CLR A
• MOVC A, @A+DPTR ; Copy data from external location to accumulator
• MOV P2, A ; Move the pattern of the digit into port P2
• ACALL delay ; Call a delay to so that the transition is visible
• INC DPTR ; Point to the next pattern
• CJNE A, 0, repeat ; Repeat till 0 (Stop bit) is received
• SJMP main ; Run this forever till externally stopped

• ; generate a decent enough delay between transitions


• delay:
• MOV R0, #08H
• LP2: MOV R1, #0FFH
• LP1: MOV R2, #0FFH
• LP3: DJNZ R2, LP3
• DJNZ R1, LP1
• DJNZ R0, LP2
• RET
• END

You might also like