You are on page 1of 11

LAB 1 : LEB 40503-MICROPROCESSOR

INTRODUCTION
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a
single integrated circuit containing a processor core, memory, and programmable input/output
peripherals. Program memory in the form of NOR flash or OTP ROM is also often included
on chip, as well as a typically small amount of RAM. Microcontrollers are designed for
embedded applications, in contrast to the microprocessors used in personal computers or other
general purpose applications.
Microcontrollers are used in automatically controlled products and devices, such as
automobile engine control systems, implantable medical devices, remote controls, office
machines, appliances, power tools, and toys. By reducing the size and cost compared to a
design that uses a separate microprocessor, memory, and input/output devices,
microcontrollers make it economical to digitally control even more devices and processes.
Mixed signal microcontrollers are common, integrating analog components needed to control
non-digital electronic systems.
Effective handling of the traffic in modern towns is impossible without the application
of microprocessor equipment in the control systems, which allows one to realize complex
functional programmable control of facilities. The application of microprocessors increases
essentially the flexibility and reliability of the control system and also decreases expenses
connected with its manufacturing and exploitation. The described microprocessor system
represents a universal device with the correspondent software and can be also used for the
various technological processes control.

OBJECTIVE

• To control the traffic lights by using programming.

LIST OF EQUIPMENT AND MATERIALS

• Text editor
• Switches SW2/4
• Switch/ADC – switch
• Remainder – OFF

Page | 1
LAB 1 : LEB 40503-MICROPROCESSOR

FLOW CHART

Initialize
Set Table Base
No. of Entries

Table Data to LED’s

Use delay from table

Increment table
pointer

PROCEDURE
1. Enter the following program.

Page | 2
LAB 1 : LEB 40503-MICROPROCESSOR

 Using the cross assembler and type X68K (filename.ASM) to create the output
(filename.OBJ).

 Type LINK and enter.


 Type (filename.OBJ) at Input filename.

 Enter a few times to create the (.S28) filename.

Page | 3
LAB 1 : LEB 40503-MICROPROCESSOR

 Run the COMM on PC and type LT.


 Select send text file from transfer for HyperTerminal and select the (filename.S28) and
press enter.
 Type GO and enter the 400400 to respond for the prompt the enter address.

 The program will run now.

Page | 4
LAB 1 : LEB 40503-MICROPROCESSOR

QUESTION 1
Using the other yellow LED’s (bits 0 and 4) to represent pedestrian crossings (LED’s on,
when it is safe to cross, and flash during last 5 seconds), generate a new table similar to above
program to include a pedestrian facility.

Procedure

a) Enter the program to note pad and save as (.ASM) at sample folder.

b) Using the cross assembler and type X68K (filename.ASM) to create the output
(filename.OBJ).

Page | 5
LAB 1 : LEB 40503-MICROPROCESSOR

c) Type LINK and enter.


d) Type (filename.OBJ) at Input filename.
e) Enter a few times to create the (.S28) filename.
f) Run the COMM on PC and type LT
g) Select send text file from transfer for HyperTerminal and select the (filename.S28) and
press enter
h) Type GO and enter the 400400 to respond for the prompt the enter address.

Page | 6
LAB 1 : LEB 40503-MICROPROCESSOR

RESULT

Traffic Light Sequence by Binary System

 First condition (green color)


 Second condition ( peach color)

Second Junction First Junction

Red Yellow Green Yellow Red Yellow Green Yellow Delay Hexa.
(pedestrian) (pedestrian) value
7 6 5 4 3 2 1 0 - -
1 0 0 1 0 0 1 0 5sec 92
1 0 0 0 1 1 0 0 1sec 8C
1 0 0 1 1 1 0 0 1sec 9C
1 0 0 0 1 1 0 0 1sec 8C
1 0 0 1 1 1 0 0 1sec 9C
1 0 0 0 1 1 0 0 1sec 8C
1 0 0 0 1 0 0 0 2sec 88
0 0 1 0 1 0 0 1 5sec 29
1 1 0 0 1 0 0 0 1sec C8
1 1 0 0 1 0 0 1 1sec C9
1 1 0 0 1 0 0 0 1sec C8
1 1 0 0 1 0 0 1 1sec C9
1 1 0 0 1 0 0 0 1sec C8
1 0 0 0 1 0 0 0 2sec 88

Binary to Hex = $92 Junction 1 Green light


GREEN,YELLOW On, 5second delay,
(pedestrian), RED car is moving.
Junction 2 Red light
On car stop, Yellow
light On pedestrian
walk.
Binary to Hex = $8C Junction 1 Yellow and
YELLOW, RED, RED Red light On, for
standby mode, delay 1
second. Junction 2
Red light On, Yellow
light Off, flashing
condition for
pedestrian.

Page | 7
LAB 1 : LEB 40503-MICROPROCESSOR

Binary to Hex = $9C Junction 1 Yellow and


YELLOW,RED,YELLOW Red light On for
(pedestrian), RED standby mode, delay 1
second. Junction 2
Red and Yellow light
On, flashing condition
for pedestrian.

Binary to Hex = $8C Junction 1 Yellow and


YELLOW, RED, RED Red light On, for
standby mode, delay 1
second. Junction 2
Red light On, Yellow
light Off, flashing
condition for
pedestrian.
Binary to Hex = $9C Junction 1 Yellow and
YELLOW, RED, Red light On for
YELLOW (pedestrian), standby mode, delay 1
RED second. Junction 2
Red and Yellow light
On, flashing condition
for pedestrian.

Binary to Hex = $8C Junction 1 Yellow and


YELLOW, RED, RED Red light On, for
standby mode, delay 1
second. Junction 2
Red light On, Yellow
light Off, flashing
condition for
pedestrian.
Binary to Hex = $88 Junction 1 Red light
RED, RED On, car ready to stop,
delay 2 second.
Junction 2 Red light
On, car ready to go,
delay 2 second.

Binary to Hex = $29 Junction 2 Green light


YELLOW (pedestrian), On, 5 second delay,
RED, GREEN car is moving.
Junction 1 Red light
On, car stop, Yellow
light On pedestrian
walk.

Page | 8
LAB 1 : LEB 40503-MICROPROCESSOR

Binary to Hex = $C8 Junction 2 Yellow and


RED, YELLOW, RED Red light On, for
standby mode, delay 1
second. Junction 1
Red light On, Yellow
light Off, flashing
condition for
pedestrian.
Binary to Hex = $C9 Junction 2 Yellow and
YELLOW(pedestrian) , Red light On for
RED, YELLOW, RED standby mode, delay 1
second. Junction 1
Red and Yellow light
On, flashing condition
for pedestrian.

Binary to Hex = $C8 Junction 2 Yellow and


RED, YELLOW, RED Red light On, for
standby mode, delay 1
second. Junction 1
Red light On, Yellow
light Off, flashing
condition for
pedestrian.

Binary to Hex = $C9 Junction 2 Yellow and


YELLOW(pedestrian), Red light On for
RED, YELLOW, RED standby mode, delay 1
second. Junction 1
Red and Yellow light
On, flashing condition
for pedestrian.

Binary to Hex = $C8 Junction 2 Yellow and


RED, YELLOW, RED Red light On, for
standby mode, delay 1
second. Junction 1
Red light On, Yellow
light Off, flashing
condition for
pedestrian.

Binary to Hex = $88 Junction 2 Red light


RED, RED On, car ready to stop,
delay 2 second.
Junction 1 Red light
On, car ready to go,
delay 2 second.

Page | 9
LAB 1 : LEB 40503-MICROPROCESSOR

DISCUSSION

As a discussion, I have studied the basic concept of the programming in EASY68K


software which run by the processor.

The first problem we facing are the cable connect from Motorola 68K board to
computer cannot be detect. After checking, troubleshooting, and installing the socket, finally
the computer detect it and software can compile and execute the program. Second problem
was we confuse to manage the system of the traffic light, condition when pedestrian walk,
condition on car moving and stop and emergency light during standby mode. After discussing
with lecturer and friend, we come out with a table which show the sequence of the traffic light
from starting to the ending of the traffic light system.

Page | 10
LAB 1 : LEB 40503-MICROPROCESSOR

CONCLUSSION

As a conclusion, the objective of task was achieved and has been successfully
presented a functional and low cost microcontroller-based traffic light system for road
intersection control. The traffic light system is designed using of Easy68k program. Besides
that, I learn to control the sequence of lights and how long each sequence is required for the
traffic light. I also understand the programming system, the function of original, initial,
motion, delay and etc. The resulting output is fed as input to the microcontroller system for
traffic light control system on real-time data.

Page | 11

You might also like