6 function 8 channel light chaser using 8051.
6 function 8 channel light chaser using 8051.
A 6 function 8 channel light chaser using 8051 is shown here. The hardware and software of this circuit are very simple and the light functions gets repeated one after another automatically. P1.0 to P1.7 of the microcontroller (AT89S51) are assigned as the output pins. Corresponding LEDs are connected to the output pins through 1K current limiting resistors (R1 to R8). The sequence by which the output pins (P1.0 to P1.7) goes high and low is determined by the program and the LEDs follow this sequence. Circuit diagram of the 6 function chaser using 8051 is shown below.
6 function light chaser using 8051
Program.
START: MOV A,#80H
MOV R7,#07H
MOV P1,A
LCALL DELAY
LABEL1: RR A
MOV P1,A
LCALL DELAY
DJNZ R7,LABEL1
MOV R7,#07H
LABEL2: RL A
MOV P1,A
LCALL DELAY
DJNZ R7,LABEL2
MOV P1,#81H
LCALL DELAY
MOV P1,#42H
LCALL DELAY
MOV P1,#24H
LCALL DELAY
MOV P1,#18H
LCALL DELAY
MOV P1,#0FFH
LCALL DELAY
MOV P1,#00H
LCALL DELAY
MOV A,#80H
MOV P1,A
LCALL DELAY
MOV R7,#07H
LABEL3: SETB C
RRC A
MOV P1,A
LCALL DELAY
DJNZ R7,LABEL3
MOv P1,#00H
LCALL DELAY
MOV A,#0AAH
MOV P1,A
LCALL DELAY
CPL A
MOV P1,A
LCALL DELAY
LJMP START
DELAY: MOV R4,#03H
WAIT1: MOV R3,#00H
WAIT2: MOV R2,#00H
WAIT3: DJNZ R2,WAIT3
DJNZ R3,WAIT2
DJNZ R4,WAIT1
RET
END