You are on page 1of 10

ARM HOW-TO GUIDE

Interfacing Touch
Panel with LPC2148
Contents at a Glance
ARM7 LPC2148 Evaluation Board .....................................3
Touch Panel .....................................................................3
Interfacing Touch panel ...................................................4
Interfacing Touch panel with LPC2148 ..............................5
Pin Assignment with LPC2148 ..........................................5
Circuit Diagram to Interface Touch panel with LPC2148 ....6
Source Code ....................................................................6
Testing the Touch Screen Module with LPC2148...............7
General Information ........................................................8

Join the Technical Community Today!


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

The ARM7 LPC2148 Evaluation 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 Evaluation Kit is proposed


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

Touch Panel

A touch screen is an electronic visual display that can


detect the presence and location of a touch within the
display area. The term generally refers to touching the
display of the device with a finger or hand. Touch screens
can also sense other passive objects, such as a stylus.

Join the Technical Community Today!


http://www.pantechsolutions.net
Interfacing Touch panel

Fig. 1 shows how to interface the touch panel into


microcontroller. To read the position of the touch, we have
to first read touch position sequentially i.e. first read X
position and then read the Y position. To do this, connect X1
and Y2 pins of touch screen to ADC multiplexed GPIO pins
of the controller. And connect X2 and Y1 pins of touch
screen to simple GPIO pins of the microcontroller.

Fig. 1 Interfacing Touch panel to Microcontroller

Join the Technical Community Today!


http://www.pantechsolutions.net
Interfacing Touch panel with LPC2148

To Interface touch screen with a microcontroller, we


will need a two or more channels of Analog-to-Digital
converter. This is needed because, the touch screen will
provide data in terms of an analog voltage on two different
pins, using which, we have to determine position of the
touch. Also, ADC input pins of the microcontroller should be
configurable as General Purpose I/O (GPIO).

The ARM7 LPC2148 Evaluation board has four numbers


of Touch panel connections, connected with I/O Port lines
(P1.20 – P1.21 && P0.29 – P0.30) to make touch panel
output.

Pin Assignment with LPC2148


LPC2148 TOUCH PANEL

P0 P0.29 BOTTOM
P0.30 LEFT
P1 P1.20 DRIVE-A
P1.21 DRIVE-B

Join the Technical Community Today!


http://www.pantechsolutions.net
Circuit Diagram to Interface Touch panel with LPC2148

P0.31
P0.28
P0.25

P1.16
P1.17
P1.23
P1.24
P1.25
P1.26
P1.27
P1.28
P1.29
P1.30
+3.3V +3.3V
D+
D-

1
2 BC556 2 BC556 RIGHT
11
10

63
51
43
23

17
13

16
12
32
28
24
64
60
56
52
20
7

9
U8 Q1 Q2
D+
D-

P0.31
P0.28
P0.25

P1.16
P1.17
P1.24
P1.25
P1.26
P1.27
P1.28
P1.29
P1.30
P1.31
VDD1
VDD2
VDD3
VDDA
VREF

3
R41 TOP R40 RIGHT
6 1K 1K LEFT
18 VSS1 8 +5V
25 VSS2 P1.18 4 R34
1K
42 VSS3 P1.19 40 TOP
50 VSS4 P1.22 46

1
59 VSS5 P0.16 47
VSSA P0.17 53 R44 1K 2 Q4 BOT
P0.18 54 BC546
P0.19

3
55
49 P0.20 1
VBAT VBAT P0.21 2
LPC2148 TOUCH PANEL
57 P0.22 58
RST RESET P0.23 36 +3.3V
P1.23
3
RTXC1 RTXC1
5 48 R27
RTXC2 RTXC2 P1.20
1K LEFT
44 P0.30

1
P1.21
15 R33 1K 2
P0.30 Q3 R39 C25
P0.30 BC546 47K
XTAL2

XTAL1

3
14
P0.15
P0.14
P0.13
P0.12
P0.11
P0.10

100n
P0.9
P0.8

P0.7
P0.6
P0.5
P0.4
P0.3
P0.2
P0.1
P0.0

P0.29 P0.29 +3.3V


61

62

45
41
39
38
37
35
34
33

31
30
29
27
26
22
21
19

12MHz
R38
1K BOT
P0.29

1
P0.15
P0.14
P0.13
P0.12
P0.11
P0.10
P0.9
P0.8

P0.7
P0.6
P0.5
P0.4
P0.3
P0.2
P0.1
P0.0

C23 X8 C22 R42 1K 2 Q5 R43 C26


22pf 22pf BC546 47K
3
100n

Source Code

The Interfacing touch panel with LPC2148 program is


very simple and straight forward, that display a text in 128 X
64 GLCD module when touch the touch panel. Some delay is
occurring when a single command / data is executed.

Join the Technical Community Today!


http://www.pantechsolutions.net
To compile the above C code you 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 above 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 microcontroller Board.

The Flash Magic software is used to download the hex


file into your microcontroller through UART0.

Testing the Touch Screen Module with LPC2148

Give +3.3V power supply to LPC2148 Evaluation Board;


the Touch screen is connected with microcontroller
LPC2148 Board. When the program is downloading into
LPC2148 in Evaluation Board, the screen should wait for a
touch. When you are touch the screen, the output is
enabled.

Join the Technical Community Today!


http://www.pantechsolutions.net
If you not getting any reactions from Touch screen,
then you just check the jumper connections & adjust the
trim pot level. 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 Evaluation 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