Share this

Design of Touchscreen Interaction Module in Embedded Systems

2026-04-06 07:36:56 · · #1
Abstract: This paper uses the S3C2410 chip with ARM920T core and GX development board as the hardware platform, and adopts the Windows CE operating system to design an embedded system touch screen interactive function module. Related technical issues are analyzed and discussed. Keywords: Embedded system; Windows CE; Interaction design 1 Introduction Embedded systems have brought humans and computers closer together, creating a harmonious working and living environment. From a certain perspective, the touch screen, as an integrated input/output device in embedded computer systems, is widely used in manufacturing, process control, communication, instrumentation, automobiles, ships, aviation, aerospace, military equipment, and consumer products, impacting all aspects of human work and life and showing great application potential. The programming of its interactive function with the embedded system is crucial to the entire system design. This paper describes the design process and provides detailed explanations of the technical issues involved. The functional design is based on the S3C2410 chip with ARM920T core, using the GX development board as the hardware platform, and is a graphical and textual interactive interface module implemented using Windows CE as the operating system. 2 System Interaction Function Design 2.1 System Architecture The architecture of an embedded system can generally be divided into four parts: processor, memory, input/output (I/O), and software. Since the application software and operating system of most embedded devices are tightly integrated, we will not distinguish between them here. This is also the biggest difference between embedded systems and general-purpose PC systems. See Figure 1 for the embedded touchscreen design block diagram. 2.2 Main Functions of Windows CE It is a newly developed modular graphical user interface multitasking operating system. It is a high-performance, high-efficiency real-time operating system that supports multiple CPUs and has good communication capabilities. OEMs can add any modules they need or remove unnecessary ones. A failure in one application will not cause the entire system to fail. Figure 1: Embedded Touchscreen Design Block Diagram 2.3 Operating System Support for Touchscreens The operating system's support for touchscreens is based on a layered approach. First, there is the application layer, where the written application calls the touchscreen/mouse event API (related API functions are available in the traction layer); second, there are touchscreen drivers in the driver layer. The final device control is achieved by calling the touchscreen device driver of the operating system kernel through a unified interface. The actual coordinate values ​​of the touchscreen are extracted and recorded in the initialization program. When an application needs to call the touchscreen driver again, the touchscreen driver will check the initialization program, read the correction values, and return the corrected and mapped relative coordinate values ​​to the application. 2.4 Touchscreen Circuit The GX development board is a hardware platform with an onboard SHARP 3.5" TFT LCD screen LQ035Q7DB02, 320×240, 262,144 colors, White LED backlight, and a touchscreen. The SHARP LCD has a built-in four-wire resistive touchscreen, which can be directly connected to the 2410 touchscreen driver circuit. The touch position is directly sampled by the CPU's built-in ADC circuit. Figure 2 shows the onboard touchscreen circuit. 2.5 The touchscreen control circuit utilizes the FM7843 chip. The FM7843 is a 4-wire resistive touchscreen conversion interface chip. It is a 12-bit sampling analog-to-digital converter with a synchronous serial interface. Its power consumption is 750μW at a throughput of 125kHz and a voltage of 2.7V, while in shutdown mode it is only 0.5μW. Therefore, the FM7843, with its low power consumption and high speed, is widely used in small, battery-powered handheld devices. The FM7843 is packaged in an SSOP-16 pinout and has a temperature range of -40 to 85℃. To complete the electrode voltage switching and A/D conversion, it is necessary to first connect to the FM7843 via a serial port. The FM 7843 sends control words, and after conversion, the voltage conversion value is read out via the serial port. A standard conversion requires 24 clock cycles. Since the serial port supports bidirectional simultaneous transmission and overlaps between readings and control word transmissions, the conversion rate can be increased to 16 clock cycles per cycle. If conditions permit, and the CPU can generate 15 CLKs (e.g., in FPGAs and ASICs), the conversion rate can be further increased to 15 clock cycles per cycle. The FM 7843 communicates with the ARM via a synchronous serial port. Data can be sent to the FM 7843 using the SendSIOData() function (uhal.c), and read from the FM 7843 using the ReadSIOData() function (uhal.c). Setting bit 6 of port F to 0 or 1 enables or disables the FM 7843. The data register for port F is PDATF (44b.h). External interrupt 5 can be used to determine if there is a touch action; this can be checked using the macro TCHSCR_IsPenNotDown() ( tchscr.h ). Several Key Issues in the Design 3.1 Customizing the Windows CE Platform Windows CE is a multi-platform, customizable 32-bit embedded operating system. It is suitable for embedded control modules in industrial equipment as well as the development of consumer electronics products. Various modules are added to its kernel for different target device hardware environments, thus forming a customized embedded operating system. It includes everything required by the customized device, such as networking capabilities, real-time performance, low memory footprint, multimedia and web browsing functions, etc. 3.2 Windows CE Driver Models Windows CE device driver models have two forms: Stream Interface Driver and Native Device Driver. From an implementation perspective, both types of drivers can be implemented in single-layer or layered ways. In multi-layered device drivers, the code is divided into two layers: MDD (Model Device Driver) and PDD (Platform Dependent Driver). The MDD layer provides DDI (Device Driver) to the GWES module. The Device Driver Interface (MDD) function interface implements common functions for drivers of the same type of devices, while the PDD implements code specific to the platform's hardware devices. The MDD accesses the hardware by calling special PDD functions. 3.3 Touchscreen and Display Coordination Algorithm The X and Y values ​​sent back to the controller by the FM 7843 are merely A/D conversion values ​​of the current touch point's voltage; they have no practical value. The magnitude of this value depends not only on the touchscreen's resolution but also on the adhesion between the touchscreen and the LCD. Furthermore, the LCD resolution and touchscreen resolution are generally different, and their coordinates are also different. Therefore, to obtain the touchscreen position representing the LCD coordinates, a conversion is required in the program. The conversion formulas are as follows: x = (x - TchScr_Xmin) * LCDWIDTH / (TchScr_Xmax - TchScr_Xmin) y = (y - TchScr_Ymin) * LCDHEIGHT / (TchScr_Ymax - TchScr_Ymin) Where TchScr_Xmax, TchScr_Xmin, TchScr_Ymax, and TchScr_Ymin are the ranges of the touchscreen's returned voltage values ​​along the x and y axes, respectively, and LCDWIDTH and LCDHEIGHT are the width and height of the LCD screen. 3.4 Operating System Support for Touchscreens The operating system's support for touchscreens is layered. First, there's the application layer, where applications call the touchscreen/mouse event API (related API functions exist in the traction layer); second, there's the driver layer, which supports touchscreen drivers. The final device control is achieved by calling the operating system kernel's touchscreen device driver through a unified interface. The actual coordinate values ​​of the touchscreen are extracted and recorded in the initialization program. When an application needs to call the touchscreen driver again, the touchscreen driver checks the initialization program, reads the correction value, and returns the corrected, mapped relative coordinate values ​​to the application. 3.5 Confirmation of Touchscreen Coordinates The coordinates acquired in the above method are relative to the touchscreen and need to be converted to LCD coordinates. Before this process, two coordinate systems need to be calibrated; here, the average value method is used. First, obtain two maximum values ​​and two minimum values ​​from the four corners of the touchscreen, denoted as x_min, y_min and x_max, y_max, respectively. The X and Y directions are determined as shown in Table 1. Table 1: Determination of X and Y Directions. When the system is in sleep mode, Q1, Q3, and Q4 are off, and Q2 is on. When the touchscreen is pressed, MOSFETs Q1 and Q4 are turned on first, and +3.3V power is applied to the X+ and X- circuits. At the same time, MOSFETs Q2 and Q3 are turned off, Y+ and Y- are disconnected, and the processor's A/D conversion channel 1 (AIN1) is started. The circuit resistance and the resistance output voltage generated by the touchscreen being pressed are digitized by the A/D converter to calculate the X-axis coordinates. Then, MOSFETs Q2 and Q3 are turned on first, and +3.3V power is applied to the Y+ and Y- circuits. At the same time, MOSFETs Q1, Q3, and Q4 are turned on, and +3.3V power is applied to the Y+ and Y- circuits. When transistors Q1 and Q4 are turned off, X+ and X- are disconnected, and the processor's A/D conversion channel 0 (AIN0) is activated. The circuit resistors and the voltage component generated by the touchscreen being pressed are used to digitize the voltage value and calculate the Y-axis coordinate. After the system reads the coordinate value, Q1, Q3, and Q4 are turned off, Q2 is turned on, and the system returns to its initial state, waiting for the next touch. After determining the X and Y directions, the formulas for calculating the coordinate values ​​are as follows: X = (x_max - Xa) × 320 / (x_max - x_min) Y = (y_max - Ya) × 240 / (y_max - y_min) Where: Xa = (X1 + X2 + ... + Xn) / n Ya = (Y1 + Y2 + ... + Yn) / n Generally, touchscreens send the X and Y voltage values ​​at the time of touch to the A/D conversion interface. The X and Y values ​​after A/D conversion are only the A/D of the voltage value of the current touch point. The conversion value has no practical value. The size of this value is not only related to the resolution of the touch screen, but also to the situation of the touch screen and the LCD being attached. If you want to get the touch screen position that reflects the LCD coordinates, you need to convert it in the program. 4 Conclusions PDAs of embedded systems increasingly use touch screens as input and output devices. This paper uses the S3C2410 chip GX development board with ARM920T core as the hardware platform to design the embedded system touch screen interactive function module, which has been used many times in the products and works of the National Undergraduate Embedded System Competition. The key technical issues in the design are analyzed and discussed in detail in this paper. The software design flowchart, source code and other auxiliary programs are introduced in another article due to space limitations. The innovations of this paper are: 1. The embedded system touch screen interactive function module was designed in the S3C2410 chip GX development environment. 2. The embedded system touch screen interactive function module program and auxiliary interface program were compiled and the relevant technical issues were analyzed. References [1] Li Zhongqi, Zhang Dongbo, Luo Wenjun. Research and implementation of touch screen control in embedded Linux system [J]. Industrial Control Computer 2005.02 [2] Liu Hong, Qin Guanghua, Wang Daohui. Solution for Chinese character display based on graphic LCD module without character library [J]. Microcomputer Information. 2004.12 pp.71-72 [3] Zhang Xiaoming, Design of PC interface driver for ultrasonic touch screen [J]. Computer Applications. 2004.05 [4] Eugene Olafsen et al. Translated by Wang Jianhua. Visual C++ Technical Insights 6.0 (5th Edition) [M]. Beijing Hope Press. 2002
Read next

CATDOLL Maruko Soft Silicone Head

You can choose the skin tone, eye color, and wig, or upgrade to implanted hair. Soft silicone heads come with a functio...

Articles 2026-02-22