Show a sentence scrolling on array of five 7 segment display.

Project Name: 
Show a sentence scrolling on array of five 7 segment display.

Objective of Project:
Creating a program to show the sentence “750-250=500” scrolling on array of 5 Common Anode 7 segment display.

Circuit Diagram:




List of components:

SL
Name and Description
Quantity
1
MCU 89C2051
1
2
7 segment display ( Common Anode )
5
3
74244 Buffer
1
4
Capacitors 30pf
(10 uf 50Volt(1), 100uf 50Volt(1))
2
5
Crystal Q11.059A1
1
6
Voltage regulator 7805
1
7
Bread board
1
8
Connecting wires

9
Battery 9 Volt
1

Printout of Program:


ORG 00H
;; PREP
                MOV DPTR, #CACODE
                MOV R1, #31H                   ; buffer
                MOV R3, #00H                   ; index
                MOV R2, #05H                   ; counter

GETBUFER:
                MOV A, R3
                MOVC A, @A+DPTR
                INC R3
                CJNE A, #'$', OVER
                MOV A, #0FFH                  ; ca code of blank
                MOV R3, #00                      ; index at 00 offset
OVER:
                MOV @R1, A
                INC R1
                DJNZ R2, GETBUFER

AGAIN:
                MOV R2, #05H                   ; counter
                MOV R1, #31H                   ; adjust buffer(30-34h)
                MOV R0, #30H
ADJUST:
                MOV A, @R1
                MOV @R0, A
                INC R0
                INC R1  
                DJNZ R2, ADJUST
                MOV R6, #16                      ; outmost loop
OUTLOOP1:
                MOV R7, #32                      ; outer loop
OUTLOOP2:
                MOV B, #01H                     ; display control code
                MOV R1, #30H                   ; buffer
                MOV R2, #05H                   ; counter

DISP:                                                     ; inner loop
                MOV A, @R1
                MOV P1, A
                MOV P3, B
                LCALL DELY         
                LCALL DELY
                INC R1
                MOV A, B
                RL A
                MOV B, A
                DJNZ R2, DISP
                DJNZ R7, OUTLOOP2
                DJNZ R6, OUTLOOP1

                MOV R1, #35H                   ; append buffer

                MOV A, R3
                MOVC A, @A+DPTR
                CJNE A, #'$', OVER1
                MOV A, #0FFH                  ; ca code of blank
                MOV R3, #0FFh                 ; index at 00 offset
OVER1:
                MOV @R1, A
                INC R3

                SJMP AGAIN

DELY:
                 MOV R5, #0FFh
FIV: DJNZ R5, FIV
                 RET

CACODE:
                 DB 0F8h, 92h, 0C0h, 0BFh, 0A4h, 92h, 0C0h, 0B7h,  92h, 0C0h, 0C0h, '$'
END

Brief Description of Program:
What are the new concepts are given below:-
Value #05h for five display as counter. And then adjust r1 and r2 register. Another section moves
the content of RAM which address is hold by r1 to a. move a value to the content of RAM which
address is hold by r0. Increment r0 and r1. Decrement r2 if not 0 then branches address to ADJUST.
Then set a delay. Move accumulator value to a p1, and move b to p3. We set table value define
byte 0F8h, 92h, 0C0h, 0BFh, 0A4h, 92h, 0C0h, 0B7h,  92h, 0C0h, 0C0h. Each hex code contains a character.

Achievements (Result): 
So, it is showing the sentence “750-250=500” on 5 common anodes 7 segment display at once.
        

Comments