You are on page 1of 6

TRAFFIC LIGHT CONTROL INTERFACE

AIM:
To interface the traffic light control system board to 8085
microprocessor kit and write an assembly language program for the
given traffic conditions.
APPARATUS REQUIRED:
8085 microprocessor kit, traffic light control system board, 26 pin port
THEORY:
Figure shows a simple arrangement and pin connections for
microprocessor based traffic control. All ports of 8255 have been
programmed as output ports. Three types of LED’s have been used, red,
yellow and green. Green light glows to allow crossing, yellow to make
alert and red does not allow crossing. Eight dual colour LED’s are
provided for pedestrian crossing. These LED’s change their colour to red
or to green. When the LED is ON it shows green colour and when it is
OFF it shows red colour.
The following traffic control states are for the experiment:
State1: Vehicles can go from South to North.
State2: Wait state.
State3: Vehicles can go from East to West.
State4: Wait state.
State5: Vehicles can go from North to South.
State6: Wait state.
State7: Vehicles can go from West to East.
State8: Wait state.
State9: All pedestrians can cross.
State10: Wait state.
Since the LED is an output device, all 8255 ports are assumed to
be output ports in mode 0. Therefore the control word is 80H. For
the state 1, the green LED connected to pin PA4 must glow and the
red LED’s connected to pins PA1, PB3, PA3 must glow. Also
pedestrians must be in OFF conditions. Therefore the data that is to
be sent to the ports A, B and C are 1A, F8, 00 respectively.
DIRECTION
PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 DATA
S
South-North 0 0 0 1 1 0 1 0 1A
DIRECTION PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 DATA
S
South-North 1 1 1 1 1 0 0 0 F8

The above data is sent to the respective port to allow the vehicle
from south to north. Similarly all the data’s are sent to the port for
the further process

Port A Data table:


DIRECTIONS PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 DATA
South-North 0 0 0 1 1 0 1 0 1A
Wait-1 0 1 1 0 1 0 0 0 68
East-West 1 0 0 0 1 0 0 0 88
Wait-2 1 0 1 0 1 0 0 0 A8
North-South 1 0 0 0 1 0 1 0 8A
Wait-3 1 0 0 0 0 1 1 0 86
West-East 1 0 0 0 0 0 1 1 83
Wait-4 1 0 0 0 0 1 1 0 86
All pedestrians 1 0 0 0 1 0 1 0 8A
Wait-5 0 1 0 0 1 0 1 0 4A

Port B Data table:


DIRECTIONS PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 DATA
South-North 1 1 1 1 1 0 0 0 F8
Wait-1 1 1 1 1 1 0 0 0 F8
East-West 1 1 1 1 1 0 1 0 FA
Wait-2 1 1 1 1 0 1 0 0 F4
North-South 1 1 1 1 0 0 0 1 F1
Wait-3 1 1 1 1 0 1 0 0 F4
West-East 1 1 1 1 1 0 0 0 F8
Wait-4 1 1 1 1 1 0 0 0 F8
All pedestrians 0 0 0 0 1 0 0 0 08
Wait-5 1 1 1 1 1 0 0 0 F8
Program
Memory code Label Mnemonics Comments
location
4100 3E,80 MVIA,80
4102 D3,OF OUT OF
4104 3E,1A START MVIA,1A
4106 D3,OC OUT OC
4108 3E,F8 MVIA,F8
410A D3,OD OUT OD
410C CD,85,41 CALL DELAY1
410F 3E,68 MVIA,68
4111 D3,OC OUT OC
4113 3E,F8 MVIA,F8
4115 D3,OD OUT OD
4117 CD,75,41 CALL DELAY2
411A 3E,88 MVIA,88
411C D3,OC OUT OC
411E 3E,FA MVIA,FA
4120 D3,OD OUT OD
4122 CD,85,41 CALL DELAY1
4125 3E,A8 MVIA,A8
4127 D3,OC OUT OC
4129 3E,F4 MVIA,F4
412B D3,OD OUT OD
412D CD,75,41 CALL DELAY2
4130 3E,8A MVIA,8A
4132 D3,OC OUT OC
4134 3E,F1 MVIA,F1
4136 D3,OD OUT OD
4138 CD,85,41 CALL DELAY1
413B 3E,86 MVIA,86
413D D3,OC OUT OC
413F 3E,F4 MVIA,F4
4141 D3,OD OUT OD
4143 CD,75,41 CALL DELAY2
4146 3E,83 MVIA,83
4148 D3,OC OUT OC
414A 3E,F8 MVIA,F8
414C D3,OD OUT OD
414E CD,85,41 CALL DELAY1
4151 3E,86 MVIA,86
4153 D3,OC OUT OC
4155 3E,F8 MVIA,F8
4157 D3,OC OUT OC
4159 CD,75,41 CALL DELAY2
415C 3E,8A MVIA,8A
415E D3,OC OUT OC
4160 3E,08 MVIA,08
4162 D3,OD OUT OD
4164 CD,85,41 CALL DELAY1
4167 3E,4A MVIA,4A
4169 D3,OC OUT OC
416B 3E,F8 MVIA,F8
416D D3,OD OUT OD
416E CD,75,41 CALL DELAY2
4172 C3,04,41 JUMP START
4175 OE,14 DELAY 2 MVIC,14
4177 21,94,F6 LOOP 2 LXIH,F694
417A 2B LOOP 1 DCX,H
417B 7D MOV A,L
417C B4 ORA,A
417D C2,7A,41 JNZ LOOP1
4180 OD DCR, C
4181 C2,77,41 JNZ LOOP2
4184 C9 RET
4185 OE,14 DELAY 1 MVIC,84
4187 21,94,F6 LOOP 4 LXIH,93F2
418A 2B LOOP 3 DCX,H
418B 7D MOV A,L
418C B4 ORA,A
418D C2,8A,41 JNZ LOOP3
4190 OD DCR,C
4191 C2,87,41 JNZ LOOP4
4194 C9 RET

You might also like