traffic lights with 7 segment using 8051 microcontroller
It is a nice project. It is easy to understand and implement. I have implemented it on Proteus not on hardware but its easy when you will implement on hardware.
toggle program in assembly
Toggling using timer:
org 00h
mov p3,#00h
mov p2,#00h
again: acall delay
mov p2,#0feh
mov p3,#7fh
acall delay
mov p2,#0fch
mov p3,#3fh
acall delay
mov p2,#0f8h
mov p3,#1fh
acall delay
mov p2,#0f0h
mov p3,#0fh
acall delay
mov p2,#0e0h
mov p3,#07h
acall delay
mov p2,#0c0h
mov p3,#03h
acall delay
mov p2,#80h
mov p3,#01h
acall delay
mov p2,#00h
mov p3,#00h
acall delay
mov p2,#80h
mov p3,#01h
acall delay
mov p2,#0c0h
mov p3,#03h
acall delay
mov p2,#0e0h
mov p3,#07h
acall delay
mov p2,#0f0h
mov p3,#0fh
acall delay
mov p2,#0f8h
mov p3,#1fh
acall delay
mov p2,#0fch
mov p3,#3fh
acall delay
mov p2,#0feh
mov p3,#7fh
sjmp again
delay:mov tmod,#01h
mov th0,#00h
mov tl0,#00h
setb tr0
here: jnb tf0,here
clr tr0
clr tf0
ret
end
Tag :
Timer