Show 5 letters on a single Common Anode 7 segment display one after another.

Project Name: 
Show 5 letters on a single Common Anode 7 segment display one after another.

Objective of Project:
Creating a program to show each characters of the string “iubat” on a single Common Anode 7 segment display one after another.

Circuit Diagram:





List of components:

SL
Name and Description
Quantity
1
MCU 89C2051
1
2
7 segment display ( Common Anode )
1
3
Resistance 1K Ohm
10
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




Flowchart of program:




Printout of Program:



Brief Description of Program:
Here in this program, we followed an algorithm. That is, it will get the display code first. So our display codes will be for each characters of the string “iubat”. For that, we created a TABLE where we stored the display codes for “iubat” using the directive DB ( Define Byte ). For accessing each one by one we used the DPTR(Data Pointer Register)  and for Counting we used the register R0. Since we have 5 characters in “iubat”, we stored the value 05h in R0. Then we stored the address of the created TABLE in the DPTR register. After that we stored the value 00h in B register for indexing like array in high level programming languages. These things happens under the LABEL START. Then the algorithm says to show the display code. For that we used another label LOOP for looping. Inside of that the first instruction MOV A, B used to store the index value which we stored in the B register so that we can use MOVC for accessing external code ROM. So we have index in the Accumulator and the address of the TABLE in the Data Pointer register. We used MOVC instruction to store these values in the A (Accumulator) so that we can point to the display codes created in the TABLE. So we transferred the pointed value the P1 by the instruction MOV P1, A so that we can see the first character of ‘iubat’ in the display. Then we called the delay for delaying some time. After that we incremented the index value what we have in our B register by the instruction INC B so that we can point to the next characters code in the TABLE. We continued this process until the display code is finished with the help of DJNZ R0, LOOP instruction. After finishing all the display codes, we started from the beginning by the instruction SJMP START. And this will go on forever.


Achievements (Result): 
So, it is showing each characters of the string “iubat” one after another on the display.


See the project at https://youtu.be/_4HUl-753Lc



Comments