How to Interface Touch Panel with LPC2148

Touchscreen Interfacing With ARM7 Friendly

Tags: ARM7 LPC2148 Evaluation Board, Interfacing Touch panel, Interfacing Touch panel to Microcontroller, Schematics to Interface Touch panel with LPC2148, Circuit Diagram to Interface Touch panel with LPC2148, Touch Screen Module with LPC2148,
Overall rating
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.

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

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
















Circuit Diagram to Interface Touch panel with LPC2148


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.

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.

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.

General Information

Join the World's Largest Technical Community

we respect your privacy.