Follow me on Linkedin

PROGRAM FOR TRAFFIC LIGHT CONTROLLER




 TRAFFIC LIGHT CONTROLLER Basics  :

Port A – E800 / E804

EAST
RED
EAST
AMBER
EAST
RIGHT
EAST
LEFT
SOUTH
RED
SOUTH
AMBER
SOUTH
RIGHT
SOUTH
LEFT

Port B – E801/ E805

WEST
RED
WEST
AMBER
WEST
RIGHT
WEST
LEFT
NORTH
RED
NORTH
AMBER
NORTH
RIGHT
NORTH
LEFT


Port C – E802 / E806
EAST
PEDESTRIAN
SOUTH
PEDESTRIAN
WEST
PEDESTRIAN
NORTH
PEDESTRIAN
SOUTH
STRAIGHT
EAST
STRAIGHT
NORTH
STRAIGHT
WEST
STRAIGHT

Pedestrian LED – 1 –RED                                                       Other LEDs      1 – GLOW
                              0 – GREEN                                                                        2 - OFF

MOV DPTR,#E803
MOV A,#80
MOVX @DPTR,A
RPT:    MOV DPTR,#0000
NXT:   MOVX A,@DPTR
PUSH 83
PUSH 82
MOV DPTR,#E800
MOVX @DPTR,A
POP 82
POP 83
INC DPTR
MOVX A,@DPTR
PUSH 83
PUSH 82
MOV DPTR,#E801
MOVX @DPTR,A
POP 82
POP 83
INC DPTR
MOVX A,@DPTR
PUSH 83
PUSH 82
MOV DPTR,#E802
MOVX @DPTR,A
POP 82
POP 83
LCALL DELAY
INC DPTR
MOV A,82
CJNE #06,NXT (06 – if number of data byte is six)
SJMP RPT

DELAY:    MOV R0,#06
MOV R1,#FF
MOV R2,#FF
DJNZ R2,L1
DJNZ R1,L2
DJNZ R0,L3
RET





Tag : micro controller, micro controller lab, traffic controller code, traffic signal, 

0 comments:

Post a Comment

a