1.12.record - Traffic Light Control PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

EXP.

No : 12

TRAFFIC LIGHT CONTROL

DATE :
AIM:
To write and execute an assembly language program for traffic light controller
using 8051 microcontroller kit.
APPARATUS REQUIRED:

8051 Microcontroller kit 1


TLC module board-1
Key board -1
Power chord-1
Interface card

ALGORITHM:
1. Initialize port A,B and C
2. Load values for blinking light in anyone of the register
3. Initialize the counter
4. Out the values through port A,B and C
5. Decrement the counter and step 4 is repeated until count = 0.
6. Repeat the process
PROGRAM:
MEMORY
ADDRESS

CODE

8200
8203
8205
8206
8209
820A
820D
8210
8212
8214
8216
8218
821A
821C
821F
8221
8222
8223
8224
8226
8229
822B
822C

90 A0 03
74 81
F0
90 A0 02
E0
20 E1 0F
20 E2 06
7E 05
7F 02
80 1D
7E 03
7F 01
80 17
90 A0 00
74 22
F0
A3
F0
51 72
90 A0 00
74 00
F0
A3

LABEL
START

INPUT

NORMAL

NIGHT

79

MNEMONICS
MOV DPTR,#0A003H
MOV A,#81H
MOV C @DPTR,A
MOV DPTR,#0A002H
MOVX A, @DPTR
JB ACC.1,NIGHT
JB ACC.2,NORMAL
MOV R6,#05H
MOV R7,#2H
SJMP DAY
MOV R6,#03H
MOV A,#22H
SJMP DAY
MOV DPTR,#0A000H
MOV A,#22H
MOVX @DPTR,A
INC DPTR
MOV X @DPTR,A
ACALL ONE SEC
MOV DPTR,#0A000H
MOV A,#00H
MOV X@DPTR,A

822D
822E
8230
8233
8236
8238
8239
823C
823E
823F
8240
8241
8243
8245
8248
824A
824B
824C
824D
824F
8251
8254
8256
8257
825A
825C
825D
825E
825F
8261
8263
8266
8268
8269
826A
826B
826D
826F
8272
8275
8277
827A
827D
827F
8282
8284
8286
8288

F0
5172
02 82 06
90 A0 00
74 44
F0
90 A0 01
74 99
F0
EE
FD
51 72
DD FC
90 A0 00
74 22
F0
EF
FD
51 72
DD FC
90 A0 01
74 44
F0
90 A0 00
74 99
F0
EE
FD
51 72
DD FC
90 A0 01
74 22
F0
EF
FD
51 72
DD FC
02 82 06
75 89 10
7B 0E
75 8B 08
75 8D 01
D2 8E
30 8F FD
C2 8E
C2 8F
DB EF
22

DAY

K1

K2

K3

K4

ONE SEC
REPEAT

BACK

END

80

MOV X @DPTR,A
ACALL ONE SEC
LJMP INPUT
MOV DPTR,#0A00H
MOV DPTR,#0A000H
MOVX @DPTR,A
MOV DPTR,#0A001H
MOV A,#99H
MOV X @DPTR,A
MOV A,R6
MOV R5,A
ACALL ONE SEC
DJNZ R5,K1
MOV DPTR,#0A000H
MOV A,#22H
MOVX @DPTR,A
MOV A,R7
MOV R5,A
ACALL ONE SEC
DJNZ R5,K2
MOV DPTR,#0A001H
MOV A,#99H
MOVX @DPTR,A
MOV DPTR,#0A00H
MOV A,#99H
MOVX @DPTR,A
MOV A,R6
MOV R5,A
ACALL ONE SEC
DJNZ R5,K3
MOV DPTR,#0A001H
MOV A,#22H
MOV X @DPTR,A
MOV A,R7
MOV R5,A
ACALL ONE SEC
DJNZ R5,K4
LJMP INPUT
MOV TMOD,#10H
MOV R3,#14
MOV T11,#08
MOV TH1,#01
SETB TR1
JNB TF1,BACK
CLR TR1
CLR TF1
RET

S.No

Mark Allocation

Max.
Marks

Preparation

Interest and Involvement

Skill in completing the


experiments & results

Viva-Voce

Total

10

Date

Sign

RESULT:
The assembly language program for Traffic Light Control using 8051
microcontroller was executed and the result was verified

81

Marks
Awarded

You might also like