Design of Touch Screen Interface for Embedded Microprocessor ARM7202

Publisher:chwwdchLatest update time:2012-04-10 Source: 微计算机信息Keywords:ARM7202 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

Touch screens are increasingly being used in embedded systems. The design methods for touch screens vary in different application fields. Generally, there are three types: (1) Using a touch screen module. The touch screen module provides a standard hardware interface to connect to the application system (usually a PC or an industrial computer with an X86 architecture). It can work after installing the driver, and basically no development is required; (2) Expanding the touch screen controller. This is a common method for designing touch screens in embedded systems. Commonly used touch screen control chips include ADS7843, ADS7846, etc. These chips integrate A/D converters and touch screen drive circuits, and certain software must be designed; (3) Similar to the previous method (2), some processors integrate A/D converters, and the touch screen control can also be achieved by simulating the touch screen drive signal through the IO port.

With the development of chip technology, the resources integrated inside the processor are becoming more and more abundant. Some chips have integrated touch screen controllers. For example, the 32-bit ARM processor ARM7202 (HMS30C7202) chip of Hyundai Semiconductor Co., Ltd. in South Korea has integrated a resistive touch screen controller. ARM7202 integrates the ARM7TDMI CPU core, memory management unit (MMU), 8KB high-speed cache memory (Cache), and has a main frequency of 70MHz. It is a high-performance embedded processor. In addition to the touch screen controller, it also contains other rich resources, such as LCD controller, SDRAM controller, interrupt controller, DMA controller, etc. [1]. The interface between ARM7202 and the touch screen is somewhat different from the previous three in terms of software/hardware design.

2 Hardware Design

2.1 Principle of resistive touch screen

The resistive touch screen is a multi-layer composite film, with a layer of glass or organic glass as the base layer, a transparent conductive layer coated on the surface, and a plastic layer on top. Its inner surface is also coated with a transparent conductive layer. There are many tiny transparent isolation points between the two conductive layers to separate and insulate them, as shown in Figure 1. When a finger touches the screen, the two normally insulated conductive layers have a contact at the touch point. After the controller detects this contact, one of the conductive layers is connected to the 5V uniform voltage field in the Y-axis direction, and the other conductive layer leads the voltage of the contact point to the controller for A/D conversion. After obtaining the voltage value, it is compared with 5V to obtain the Y-axis coordinate of the touch point, as shown in Figure 2. Similarly, the X-axis coordinate is obtained. This is the common basic principle of all resistive touch screens.

Embedded microprocessor ARM7202 touch screen interface design V2

2.2 Interface between ARM7202 and touch screen

The on-chip resources of ARM7202 include a touch screen controller for controlling a 4-wire resistive touch screen. Among the 5 A/D conversion channels, A0 and A1 are used for touch screen coordinate acquisition. At the same time, the chip provides four scan lines, ATSXP, ATSXN, ATSYP and ATSYN, to scan the X and Y directions respectively. When ATSXP and ATSXN apply a positive voltage in the X direction, the corresponding value of the X coordinate is detected in the Y direction; similarly, when ATSYP and ATSYN apply a positive voltage in the Y direction, the corresponding value of the Y coordinate is detected in the X direction, which is collected by A0 and A1 respectively. In order to reduce system power consumption and the CPU resources occupied by the touch screen, the touch screen controller starts scanning only when a pen is placed, and the corresponding value of the coordinate is obtained through A/D conversion. Therefore, a pen-place detection circuit needs to be designed externally, as shown in Figure 3. In the figure, IRLML6302 and IRLML2402 are PMOSFET and NMOSFET respectively, which are used as switch tubes to control the scan output in the X and Y directions. PB7 is connected to a pull-up resistor to detect the pen-down interrupt. When the pen is down, PB7 detects a low level and triggers an interrupt. PB6 is the enable signal of the interrupt detection circuit. When PB6 is high, the interrupt is valid and the touch screen scan is invalid; otherwise, the interrupt is invalid and the touch screen scan is valid. [page]

Embedded microprocessor ARM7202 touch screen interface design V2
Embedded microprocessor ARM7202 touch screen interface design V2

3 Touch screen control program mechanism

The application of touch screens under different operating systems is different, but they all include basic modules such as device initialization, device reading and writing, and interrupt response. The driver of the touch screen involves two interrupts: pen down interrupt and touch screen A/D conversion interrupt. The program modules included are: touch screen initialization, pen down interrupt service program, A/D interrupt service program, filter program, and coordinate conversion program. Here we focus on the two interrupts of the touch screen.

The touch screen initialization program completes the interrupt setting of the external circuit and the setting of the sampling rate, and turns off the A/D interrupt and A/D converter power of the touch screen to make the external circuit interrupt effective.

When a pen is dropped, the external interrupt is triggered and the pen drop interrupt service routine is entered. In the pen drop interrupt service routine, the interrupt source is cleared, the external interrupt is turned off, the external interrupt circuit is invalidated, and the touch screen interrupt and the AD converter power supply are turned on. At this time, the touch screen circuit starts to scan the touch screen. After the touch screen A/D conversion is completed, an A/D interrupt is generated and the A/D interrupt service routine is entered. In the touch screen A/D interrupt service routine, the A/D interrupt is cleared, the touch screen A/D interrupt is turned off, and the A/D conversion value is read. At this time, it is also necessary to determine whether the pen continues to drop. If there is no pen drop, the external circuit interrupt is turned on, the external interrupt circuit is enabled, the A/D interrupt and the A/D converter power supply are turned off, and the energy saving mode is entered, as shown in Figure 4(a); if there is still a pen drop, the touch screen A/D interrupt must continue to be turned on, the external interrupt circuit is invalidated, and the touch screen A/D conversion continues, as shown in Figure 4(b).

Embedded microprocessor ARM7202 touch screen interface design V2
Figure 4 Touch screen program flow chart [page]

The values ​​obtained by A/D conversion are the X and Y coordinates of the touch point on the touch screen, which need to be converted into coordinates on the display screen through a certain method. Due to space limitations, this is omitted here. The principle and implementation method can be found in reference [2]. During A/D conversion, 4 sets of conversion values ​​are obtained from the A/D conversion register each time. A filtering program can be designed to improve detection accuracy.

4 Programming

The application modules of the touch screen include: touch screen initialization, pen down interrupt service program, A/D interrupt service program, filter program and coordinate conversion program. The initialization program, filter program and coordinate conversion program are general routine programs. The core of the touch screen driver is the pen down interrupt and A/D conversion interrupt service programs. The following are two interrupt service programs of the touch screen driver under the uc/OS operating system. For detailed description, see the notes.

Embedded microprocessor ARM7202 touch screen interface design V2

5 Conclusion

Based on the above analysis of the working mechanism of the touch screen, the touch screen driver written by the author under the real-time embedded operating system uc/OS is applied to the intelligent controller based on ARM7202. Practice has proved that the system is stable and reliable, and meets the requirements of fast response of the touch screen in a complex real-time multi-tasking environment.

References

[1]Hynix Semiconductor, HMS30C7202_datasheet_ver1.3_A13, 2003.
[2]Carlos E. Vidales, An algorithm for calibrating the point-to-point correspondence between touch screens and displays.

Keywords:ARM7202 Reference address:Design of Touch Screen Interface for Embedded Microprocessor ARM7202

Previous article:Long-distance portable wireless transmission system based on ARM
Next article:Design and implementation of remote wireless monitoring system 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号