Blink single LED among all LEDs connected to lines of port 1 to create running lights effect

Project Name:
Blink single LED among all LEDs connected to lines of port 1 to create running lights effect.

Objective of Project:
To blink single LED among all LEDs connected to all lines of port 1 to create running lights effect. Here port 1 is indicated by p1. If we work with port p1, then every bits of the port p1 will work together. So, we will be able to create running lights effect.

Circuit Diagram:




List of components:

SL
Name and Description
Quantity
1
MCU 89C2051
1
2
LED
9
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 used directive ORG for the assembler. Then we used A (Accumulator) register to store the hex value FEh so that port P1 bits become in pattern 11111110. Then we used the looping label START to continue the process forever. Inside loop, we used RL (Rotate Left) instruction to rotate and shift the bits so that it becomes 01111111. So that in the second iteration bits become 10111111 and continues this process. In every iteration, we call the DELAY procedure for delaying some time. And this process will be continued. Then we used the SJMP (Short Jump) instruction to continue the loop. Then we defined the DELAY procedure.
Inside DELAY procedure, we stored 40h in R1 register. Then we used several Labels for nesting of several loops. Then we used the DJNZ (Decrease Jump Not Zero) instruction. This instruction decreases the register and jump to the Label until the register becomes Zero. Then we used the RET instruction to return to the Caller. Finally we used END instruction to tell the assembler end of the program.

Achievements (Result): 
So, the running lights effect, is working properly.


See the project at https://youtu.be/3oVUwgGvAUA


Comments

Post a Comment