0% found this document useful (0 votes)
20 views

Experiment 2

Uploaded by

G B C
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Experiment 2

Uploaded by

G B C
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment-2

Title: Traffic light controller using 805! micrecontroller.


Aim: To study and understand Interfacing Traffic light controller to 8051
Objectives:
To understand the concept of Traffic ligiht controller.
To study interfacing of Traffic light controller to 8051.
To study Keil uVision DE software.
Software Used: Keil uVision DE
Circuit Diagram:
45V
+5V +5V

+5v
40

P3.0

9
IC74541 K
r

3.7

10
AT89S52
+5/
+5V

P2.0 R

18 K
gs

IC74541 g

19
P23
10
20

Procedure:
Connect 12V DC power adaptor to the MGTechSolution 8051 Target board.
Start Keil IDE and follow the steps mention in the Steps to use of Keil IDE software".
Set the Mode Sel side switch in the 805i section on Pgm mode.
Compile the written programn, if there are no errors connect the PC iothe programmer placed on
the MGTech Solution 8051 Target board; by using USB cable.
Steps to tuse of WLPRO sofiware Upload the program
Follow ihe proccdure mention n the
circuit diagram.
Make necessary connections as shown in the
section" onRun" mode
Set the Mode Scl slide switch in thes05I
Observe the output.
Program:
lhnchde<egslh
sbit rn P30,
sbit yo P3^1;
sbit rs-P3^2;
sbit ys-P3^3,
sbit rw P3^4;

sbit yw-P3^5;
sbit re P36;
sbit ye-P3^7;
sbit gn P20;
sbit gs-P^;
sbit gw-P2^2:
"sbit ge-P2^3;

void delay()

long int i,
for(i=0;i<=50000;it+); /3 sec

void main()

while (1)

l/north

m=l;rs-0;rw-0; re-0;
gn-0:gs-lgw-l:ge-1;
y1-1ys-l:yw-1:ye-i:
delay().l/south
:delay().delay0.delay();delay(). / 15 sec
n-0.rs-lw 0, re 0,
gn-1.gs 0:gw lge 1.
yn=I:ysyw-I;ye 1;
delay();delay():delay():delay():delay().
l/west
I/15 sec

rn-0;rs0rw-l; re-0;
gn=1:gs=l:gw 0:ge-1;
yn=1:ys=1:yw-1;ye-1;
delay( ):delay().delay():delay():delay(): |/15 sec
lleast

m-0rs-0:rw-0: re-1;
gn=lgs-l;gw-I:ge-0;
yn=1ysl;yw-I;ye- 1;
delay();delay);delay(0;delay();delay(); I/15 sec

Applications of Traffic light controler: (Student can search & write application here)
Resuit: Interfacing of Traffic light controller with 8051 is successfully studied, tested and observe the
output.

Teacher's Sign.

You might also like