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

ARM HOW-TO GUIDE

Interfacing Traffic
Light with LPC2148
Contents at a Glance
ARM7 LPC2148 Primer Board ...........................................3
Traffic Light Control .........................................................3
About the colors of Traffic Light Control ...........................4
Interfacing Traffic Light with LPC2148 ..............................5
Pin Assignment with LPC2148 ..........................................5
Circuit Diagram to Interface Traffic Light with LPC2148 ....6
Source Code ....................................................................6
Testing the Traffic Light Controller with LPC2148 .............7
General Information ........................................................8

Join the Technical Community Today!


http://www.pantechsolutions.net
ARM7 LPC2148 Primer Board

The ARM7 LPC2148 Primer board is specifically


designed to help students to master the required skills in
the area of embedded systems. The kit is designed in such
way that all the possible features of the microcontroller will
be easily used by the students. The kit supports in system
programming (ISP) which is done through serial port.

NXP’s ARM7 (LPC2148), ARM Primer Kit is proposed to


smooth the progress of developing and debugging of
various designs encompassing of High speed 32-bit
Microcontrollers.

Traffic Light Control

Traffic lights, which may also be known as stoplights,


traffic lamps, traffic signals, signal lights, robots or
semaphore, are signaling devices positioned at road
intersections, pedestrian crossings and other locations to
control competing flows of traffic.

Join the Technical Community Today!


http://www.pantechsolutions.net
About the colors of Traffic Light Control

Traffic lights alternate the right of way of road users by


displaying lights of a standard color (red, yellow/amber, and
green), using a universal color code (and a precise sequence
to enable comprehension by those who are color blind).

In the typical sequence of colored lights:

Illumination of the green light allows traffic to


proceed in the direction denoted,

Illumination of the yellow/amber light denoting, if


safe to do so, prepare to stop short of the intersection, and

Illumination of the red signal prohibits any traffic


from proceeding.

Usually, the red light contains some orange in its hue,


and the green light contains some blue, for the benefit of
people with red-green color blindness, and "green" lights in
many areas are in fact blue lenses on a yellow light (which
together appear green).

Join the Technical Community Today!


http://www.pantechsolutions.net
Interfacing Traffic Light with LPC2148

The Traffic light controller section consists of 12 Nos.


point leds are arranged by 4Lanes in LPC2148 Primer Board.
Each lane has Go(Green), Listen(Yellow) and Stop(Red) LED
is being placed.

Pin Assignment with LPC2148


LAN
LPC2148 Lines LED’s Traffic Light Controller
Direction

NORTH P0.4 D11-Go

330E
P0.5 D12-Listen
GO
P0.6 D13-Stop
LISTEN
330E
WEST P0.7 D14-Go
STOP 330E

P0.8 D15-Listen

P0.9 D16-Stop LANE

NORTH Make high to - LED On


SOUTH P0.10 D17-Go
LANE Make low
LANE to – LED Off
P0.11 D18-Listen
WEST EAST

P0.12 D19-Stop LANE SW30

SOUTH
GLCD
EAST P0.13 D20-Go
Traffic
P0.14 D21-Listen

P0.15 D22-Stop

Join the Technical Community Today!


http://www.pantechsolutions.net
Circuit Diagram to Interface Traffic Light with LPC2148
D18
1 2

3.3V D17
1 LED 2

LED
D16
63
51
43
23
7
U16 1 2
37
VDD1
VDD2
VDD3
VDDA
VREF

P0.11 D15 R49


1 LED
C
6 2 9
18 VSS1 35 8
25 VSS2 P0.10 D14 7
42 VSS3 34 1 LED 2 6
50 VSS4 P0.9 5
59 VSS5 33 4
VSSA P0.8 LED 3
31 D13 2 1
LPC2148
P0.7 1 2
30 220E-SIL
P0.6 D12
29 1 LED 2
P0.5
27 D11
P0.4 1 LED 2

LED

D22
1 2

45 D21
P0.15 1 LED 2 R50
C
41 9
P0.14 D20 8
39 1 LED 2 7
XTAL2

XTAL1

P0.13 6
38 5
P0.12 LED 4
D19 3
61

62

1 2 2 1
12MHz

LED 220EK-SIL
C66 X28 C67
TRAFFIC LIGHT CONTROLLER
22pf 22pf

Source Code

The Interfacing Traffic Light Control with LPC2148


program is very simple and straight forward, which controls
Traffic Light in certain time period. The C program is written
in Keil software.

Join the Technical Community Today!


http://www.pantechsolutions.net
To compile the C code, you must need the KEIL
software. They must be properly set up and a project with
correct settings must be created in order to compile the
code. To compile the C code, the C file must be added to
the project.

In Keil, you want to develop or debug the project


without any hardware setup. You must compile the code for
generating HEX file. In debugging Mode, you want to check
the port output without LPC2148 Primer Board.

The Flash Magic software is used to download the hex


file into your microcontroller IC LPC2148 through UART0.

Testing the Traffic Light Controller with LPC2148

Give +3.3V power supply to LPC2148 Primer Board; the


LED is connected with LPC2148 Primer Board. When the
program is downloading into LPC2148 in Primer Board, the
LED output is working that some LED is ON and some LED is
OFF in the Traffic Light format.

Join the Technical Community Today!


http://www.pantechsolutions.net
If you not reading any output from LED, then you just
check the jumper connections & check the LED is working.
Otherwise you just check it with debugging mode in Keil. If
you want to see more details about debugging just see the
videos in below link.

 How to Create & Debug a Project in Keil.

General Information

For proper working use the components of exact values


as shown in Circuit file. Wherever possible use new
components.
Solder everything in a clean way. A major problem
arises due to improper soldering, solder jumps and
loose joints.
Use the exact value crystal shown in schematic.
More instructions are available in following articles,

 User Manual of LPC2148 Primer Board.


 Tutorial of how to create & Debug a project in Keil.

Join the Technical Community Today!


http://www.pantechsolutions.net
Did you enjoy the read?
Pantech solutions creates information packed technical
documents like this one every month. And our website is a rich
and trusted resource used by a vibrant online community of
more than 1,00,000 members from organization of all shapes
and sizes.

Join the Technical Community Today!


http://www.pantechsolutions.net
What do we sell?
Our products range from Various Microcontroller
development boards, DSP Boards, FPGA/CPLD boards,
Communication Kits, Power electronics, Basic electronics,
Robotics, Sensors, Electronic components and much more . Our
goal is to make finding the parts and information you need
easier and affordable so you can create awesome projects and
training from Basic to Cutting edge technology.

Join the Technical Community Today!


http://www.pantechsolutions.net

You might also like