0% found this document useful (0 votes)
21 views4 pages

codeORG 4000HDB 06H

The document provides assembly code for interfacing a seven-segment display with an 8051 trainer kit, detailing the initialization and display patterns for digits 1 to 4. It includes a delay function to manage transitions between displayed digits. Additionally, it features diagrams for common anode and common cathode seven-segment displays along with a circuit diagram for the interface setup.

Uploaded by

AMEYA NALAVADE
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)
21 views4 pages

codeORG 4000HDB 06H

The document provides assembly code for interfacing a seven-segment display with an 8051 trainer kit, detailing the initialization and display patterns for digits 1 to 4. It includes a delay function to manage transitions between displayed digits. Additionally, it features diagrams for common anode and common cathode seven-segment displays along with a circuit diagram for the interface setup.

Uploaded by

AMEYA NALAVADE
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/ 4

To interface seven- segment display with 8051 trainer kit

1. Code :-

ORG 4000H
DB 06H, 5BH, 4FH, 66H

ORG 0000H
main: MOV DPTR, #4000H
MOV P3, #00H ; clear the port 3 to use it as output port
CLR P3.3 ; Mode 1
CLR P3.4 ; 00
CLR A
MOVC A, @A+DPTR
CPL A
MOV P2, A ; P2 = 00000110b = pattern of digit ‘1’
ACALL delay
INC DPTR

SETB P3.3 ; Mode 2


CLR P3.4 ; 01
CLR A
MOVC A, @A+DPTR
CPL A
MOV P2, A ; P2 = 01011011b = pattern of digit ‘2’
ACALL delay
INC DPTR

CLR P3.3 ; Mode 3


SETB P3.4 ; 10
CLR A
MOVC A, @A+DPTR
CPL A
MOV P2, A ; P2 = 01001111b = pattern of digit ‘3’
ACALL delay
INC DPTR

SETB P3.3 ; Mode 4


SETB P3.3 ; 11
CLR A
MOVC A, @A+DPTR
CPL A
MOV P2, A ; P2 = 01100110b = pattern of digit ‘4’
ACALL delay

SJMP main ; Run this program forever

; To generate a very small delay so that we won’t be able


; to notice the transition from one module to another
delay:
MOV R0, #01H
LP2: MOV R1, #010H
LP1: MOV R2, #010H
LP3: DJNZ R2, LP3
DJNZ R1, LP1
DJNZ R0, LP2
RET
END

2. Diagram

Common Anode (CA) 7 Segment Display


Common Cathode (CC) 7 Segment Display

Pin Diagram of the seven-segment LED


Circuit diagram to interface seven segment display with 8051

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