Interface Design of LCD Touch Screen Based on ARM Microprocessor

Publisher:渤海湾Latest update time:2012-05-04 Source: 梁明亮 张慧敏 徐冰 Keywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

There are many types of human-computer interaction interfaces, such as keyboards, digital tube displays, liquid crystal displays, and touch screens. The main factors that determine the human-computer interaction interface mode are cost and practical application needs. In the past decade, LCD touch screens have been widely used in electronic devices, especially handheld electronic products, with technical characteristics such as low power consumption, light weight, high precision and good human-computer interface. As long as the coordinate position of the touch point can be measured, the toucher's intention can be known based on the display content or icon of the corresponding coordinate point on the screen. The microprocessor processes information such as sound, image, text and touch input control, making it an integrated system that can access, input and output information. The hardware interface design and software programming based on microcontrollers and liquid crystal modules have important application value in intelligent system design. ARM microprocessors are currently more popular embedded controllers with fast computing speed, rich resources and high cost performance. This article introduces a 3.2-inch LCD touch screen based on the ARM7 microprocessor LPC2148 interface. It has the characteristics of high precision, realistic color display, and flexible application. It can be used as a window for displaying characters and images and human-computer dialogue in mid-to-high-end electronic products.

1 Overall design plan

The overall design of the system is shown in Figure 1. The LCD touch screen system consists of a 312-inch TFT LCD module, a touch screen and an ARM microprocessor control board.

The touch screen consists of a touch sensor component and a touch screen controller ADS7843. The touch sensor component is installed in front of the LCD screen to detect the user's touch position. The user's touch information is sent to the ADS7843 controller and converted into touch point coordinates and sent to the ARM7 control board. The LPC2148 microprocessor is connected to the LCD and touch module. According to the received touch information, it performs signal calculation and processing, outputs control signals such as buzzers, and controls the LCD screen to display user images and data.

Figure 1 Overall design of LCD touch screen system

2 Circuit and Principle

2.1 LCD touch screen principle and ADS7843 touch control circuit

The principle is shown in Figure 2.

U1 is a 3.2-inch TFT LCD module, powered by +3.3V; built-in SSD1289 LCD controller; LCD screen resolution is 240×320 pixels; screen color is 260,000 colors; screen size is 57mm×79mm, effective display area is 51mm×65mm. SSD1289 LCD controller consists of 16-bit parallel data interface, internal controller and LCD driver. The LCD data transmission mode is 16-bit parallel mode. The 16 I/O lines of LPC2148 are connected to DB0~DB15 of the LCD module respectively. PWM is the brightness drive control input, which is amplified by 9013 transistor as LCD backlight. [page]

The touch screen part consists of a touch sensor component and a touch screen controller ADS7843 (U2).

Figure 2 LCD module and touch circuit principle

The touch sensing component is a four-wire resistive screen with four wires drawn out from the screen, two for each of the X and Y axes. When measuring the X direction, add a reference voltage Vref between X+ and X-, disconnect Y-, and use Y+ as the A/D input to obtain the voltage in the X direction; similarly, when measuring the Y direction, add a reference voltage Vref between Y+ and Y-, disconnect X-, and use X+ as the A/D input to perform A/D conversion to obtain the voltage in the Y direction, and then complete the conversion between voltage and coordinates. The whole process is similar to a potentiometer, and different voltages are obtained when touching different positions.

The reference voltage, A/D conversion and other tasks required above are directly completed by the touch screen controller ADS7843. The microprocessor only needs to transmit the corresponding control command to ADS7843 to obtain the corresponding voltage data.

ADS7843 is a four-wire resistive touch screen conversion interface chip produced by TI. It is a 12-bit sampling analog-to-digital converter with a synchronous serial interface. At a throughput rate of 125kHz and a voltage of 2.7V, the power consumption is 750LW. In the off mode, the power consumption is only 0.5LW. Due to its low power consumption and high speed, it is widely used in small battery-powered handheld devices.

The connection between ADS7843 and LPC2148 is shown in Figure 3. The operating voltage of ADS7843 is + 3.3V, and the analog input of the converter (X+, Y+, X-, Y-) is a 4-channel multiplexer; DCLK (pin 4) is the external clock input pin; CS (pin 3) is the chip select input, which is valid at low level; DIN (pin 2) is the serial input, and the control data is input through this pin; DOUT (pin 16) is the serial data output, which is used to output the converted touch position data, with a maximum value of 4095 in binary; PENIRQ (pin 15) is the PEN interrupt, which is used to trigger an interrupt after touching the display screen.

2.2 Microprocessor Control Circuit

The principle is shown in Figure 3.

Figure 3 Schematic diagram of microprocessor control circuit

(1) LPC2148 microprocessor

ARM processors have a high market share and are characterized by high performance, low cost, and low energy consumption. The LPC2148 (U3) in Figure 3 is a 32-bit embedded ARM7 microprocessor based on the ARM7TDMI-S core launched by PHILIPS Semiconductor that supports real-time simulation and embedded tracing. The processor has built-in wide-range serial communication interfaces, 14-channel 10-bit ADCs, 1-channel 10-bit DACs, 45 high-speed GPIO lines, and up to 9 edge- or level-triggered external interrupt pins. The processor integrates 40kB of on-chip SRAM, 512kB of embedded high-speed Flash memory, a 128-bit wide memory interface, and a unique acceleration structure that enables 32-bit code to run at the maximum clock rate, providing large-scale buffers and powerful processing capabilities for applications such as communication gateways, protocol converters, software modems, voice recognition, and low-end imaging, and is suitable for color LCD image processing and data storage. [page]

(2) Reset and crystal oscillator circuit

The 57th pin of LPC2148 is the reset signal input terminal, which uses low-level reset. The reset circuit composed of C3, R9, R10, and K1 provides power-on reset and forced reset functions for the system. K1 is the system forced reset button. The crystal oscillator circuit is composed of X1 (12MH z), C7, and C8, which supports the internal PLL and ISP functions of the microcontroller chip; X2 (321 768KH z), C9, and C10 provide the reference clock for the RTC (real-time clock).

(3) Resource allocation

P0.8~P0.23 of LPC2148 are used as 16-bit data lines (D0~D15), connected to DB0~DB15 of LCD module through JP1 socket; P0.0, P0.26, P0.28~P0.31 are used as control lines of LCD module, connected to PWM, CS, RESET, RS, RD and WR of LCD module respectively through JP1; P0.27, P1.16~P1.20 are used for touch screen control, connected to BUSY, 7843-CS (CS), DCLK, DIN, INT (PENIRQ) and DOUT pins of ADS7843 respectively through JP1 connection.

P1.26~P1.31 are used as JTAG function, and JP2 is the microprocessor JTAG program debugging and downloading port.

P0.25 is used as the buzzer control line. The buzzer circuit is used to make a buzzing sound when the LCD is touched or displayed, as an auxiliary function for human-computer dialogue. The buzzer is driven by PNP transistor 8550 (Q2), which has a high amplification factor (hFE = 300) and a base bias resistor R8 of 1k. When the input is low, Q1 is deeply saturated and turned on, which can provide sufficient current for the buzzer.

(4) Power supply circuit

LPC2148 is powered by a single power supply, and the CPU operating voltage is 3.0~3.6V.

The circuit is powered by +3.3V. After the external +5V DC power supply is stabilized by the AMS1117 (U4) regulator, it outputs +3.3V voltage to power the LCD module and ADS7843. The characteristics of AMS1117 are large output current (800mA), output voltage accuracy within 1%, current limiting and thermal protection functions, and good stability. C4, C5, and C6 are all power filter capacitors.

3 Software Programming

3.1 C Programming for LCD Screen

The software design of the LCD screen adopts C language programming. It includes LCD screen initialization, writing LCD control words, writing LCD data subroutines, reading LCD data, full screen display monochrome, displaying Chinese characters and characters at specified positions, displaying pictures at specified positions, clearing the screen and other subroutines.

The subroutine for writing LCD data is:

3.2 C Programming for Touch Screen

The programming of the touch screen is mainly to determine the correspondence between its position coordinates and the position coordinates on the LCD screen, and to convert the touch information of the touch screen into the position coordinates on the LCD screen through a certain algorithm. The LCD screen has 240×320 pixels, and the X value received from the touch screen does not change in the range of 0~320, and the Y value does not change in the range of 0~240. In the edge area of ​​the touch screen, the output data in the X and Y directions changes greatly, which is a nonlinear relationship. The coordinate values ​​are basically linear in most of the middle range. In order to perform coordinate conversion more accurately, a combination of linear evaluation and table lookup can be used for coordinate conversion.

The C programming of the touch screen mainly includes the touch screen initialization subfunction, the A/D conversion value reading subfunction, the coordinate original value subfunction and the coordinate conversion subfunction. [page]

The C program preprocessing of the pins related to ADS7843 is:

Read A/D conversion value sub-function:

4 Conclusion

In embedded intelligent devices, LCD touch screens replace traditional human-computer interaction components such as buttons and LEDs, which has the advantages of simple operation, friendly interface and strong functions. With the further decline in the price of LCD screens, LCD touch screens have a wider application market. The technical development based on ARM microprocessors and LCD touch screens has practical significance and social and economic value. This system uses ARM7 processor LPC2148 as the main controller. Compared with traditional single-chip microcomputers, it has a larger data storage capacity and faster image processing speed; the LCD screen has a touch function, which greatly enhances the interactive ability of human-computer dialogue; the programming method based on C language has strong real-time performance. The designed LCD touch screen is applied to the ARM embedded innovation training system and the portable railway leveling device fault detector. The touch key is sensitive and the interface circuit with the ARM7 processor operates reliably, which verifies the feasibility of the system design and has high practical application value.

Keywords:ARM Reference address:Interface Design of LCD Touch Screen Based on ARM Microprocessor

Previous article:Design of intelligent apartment security measurement and control system based on ARM
Next article:Design of GIS real-time monitoring system for coal mine safety based on ARM

Recommended ReadingLatest update time:2024-11-16 15:39

Cortex product series worth paying attention to after ARM11
ARM changed the name of its products after the classic processor ARM11 to Cortex, and divided them into three categories: A, R and M, aiming to serve various markets. The Cortex series belongs to the ARMv7 architecture, which is the latest instruction set architecture of ARM as of 2010. The ARMv7 architecture defines
[Microcontroller]
Cortex product series worth paying attention to after ARM11
Design of vehicle detection system control unit based on ARM
introduction Due to the increasing demand for traffic, more and more circular induction coil detectors are used for traffic detection. These coils buried under the road surface can detect electromagnetic changes when vehicles pass by and accurately calculate traffic flow. Traffic flow is the basic data for traf
[Microcontroller]
Design of vehicle detection system control unit based on ARM
Modify the shell prompt under Linux (ARM)
1): Create a global variable file: /etc/profile        Add the following content:        PS1='Andy--#'        export PS1        Note: The variables defined in /etc/profile are global, that is, they are valid for all logged-in Linux users. In ordinary scripts, export is only valid in the current script and child pro
[Microcontroller]
What are the ARM instructions adr adrl ldr mov? What is the difference between ldr and adr?
ARM instructions: what are adr adrl ldr mov? ADR is a pseudo instruction for reading addresses in a small range, which reads the address value based on the relative offset of PC into the target register. Format: ADR register, exper. When compiling the source program, the assembler first calculates the distance fro
[Microcontroller]
Design of LCD controller based on ARM and FPGA
With the continuous development of display technology, true color LCD screens have gradually occupied an important position in embedded display systems with their advantages such as high resolution, high contrast and high definition. At present, there are two main ways to implement LCD display control technology bas
[Microcontroller]
Design of LCD controller based on ARM and FPGA
ARM7 Getting Started 13, Timer Control LED Flashing
Main program: /******************************************************************************* *File: Main.c *Function: Use timer 0 to implement 1s timing, turn on IRQ interrupt, and control LED flashing * At the same time, use timer 1 to implement compare match output ****************************************
[Microcontroller]
ARM7 Getting Started 13, Timer Control LED Flashing
Design of inverter power supply based on ARM Cortex-M3 and DSP
introduction   Today, with the development of electrical intelligence everywhere, countless power consumption occasions cannot do without the Inverted Power Supply System (IPS) to provide stable and high-quality power for field equipment, especially in places such as communication rooms, server workstations, transpor
[Power Management]
Design of inverter power supply based on ARM Cortex-M3 and DSP
Design of obstacle monitoring and early warning system for loaders based on ARM
1 Introduction With the development of informatization, intelligence and networking, embedded system technology has gained a broad space for development. The field of industrial control is also undergoing a huge transformation. Real-time embedded software and hardware technology based on 32-bit high-end process
[Microcontroller]
Design of obstacle monitoring and early warning system for loaders based on ARM
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号