Touch screens have many advantages such as durability, fast response, space saving, and easy communication. Compared with keyboard input, touch screen technology is simpler, more intuitive, faster, and has rich and colorful expressive capabilities. When designing a touch screen, the most important issue is to accurately locate the coordinates of the touch point. This article details the practical solution of designing a four-wire resistive touch screen using industrial-grade chips LPC2478 and ADS7843.
1 Hardware Design
1.1 Hardware Selection
The LPC2478 chip integrates an LCD interface, and its operating range is -40 to +80°C. Its wide temperature range is particularly suitable for the industrial field. The ADS7843 chip is a chip designed for touch sampling, with 12-bit programmable accuracy. The external reference voltage range is from 1 V to Vcc, and the maximum Vcc voltage is 5 V. The high speed and low power consumption make the ADS7843 very suitable for handheld devices with resistive touch screens.
1.2 Hardware Circuit
The author designed the hardware interface circuit of ADS7843 (as shown in Figure 1). This circuit uses the GPIO pins of LPC2478 to simulate the SPI timing, and connects DCLK, CS, DIN, BUS-Y, and DOUT to the five GPIO pins of LPC2478. The pins of ADS7843 are connected to the interrupt 1 of LPC2478. The four-wire resistive touch screen is connected to the X+, Y+, X-, and Y- pins of ADS7843 respectively.
1.3 Collection method
ADS7843 has two reference voltage modes: single-ended mode and differential mode. In single-ended mode, the reference input voltage is selected from Vcc and GND. Since the internal switch resistance voltage drop affects the conversion result and causes errors, the low-resistance switch inside the converter has a certain impact on the conversion accuracy. The differential mode reference input is provided by the unselected input channels Y+, Y-, X+, and X- to provide reference power and ground. Regardless of how the internal switch resistance changes, the conversion result is always proportional to the resistance of the touch screen, overcoming the influence of the internal switch resistance, but when the conversion frequency is very high, the power consumption increases, and low-power design needs to be considered. The author uses a differential method in the program for sampling accuracy reasons.
The pin of ADS7843 is a PIN interrupt pin. When the display screen is touched, a low level is generated to trigger the interrupt of LPC2478. The falling edge trigger method is adopted. The level change process of one click on the touch screen is captured in Figure 2. It is not very suitable to collect the level change by interrupt method, and it is impossible to capture the sliding process on the touch screen, so the author uses the cyclic acquisition method.
Cyclic acquisition method: mainly through the LPC2478 timed acquisition of ADS7843, in the author's program, the time interval of the timer is set to 50 ms. This method increases the CPU load, so it is not suitable for the slower MCS51 microcontroller, but it is more suitable for the LPC2478 processor. Each collected data must be compared with the last data to determine whether it is new data.
In this study, LPC2478 and ADS7843 are mainly used for display and external input, without other large-scale calculations and real-time control of the device. Therefore, the advantages and disadvantages of the interrupt method and the loop method are compared. In order to better respond to some sliding actions on the screen, the loop acquisition method is finally adopted.
1.4 ADS7843 acquisition process
The acquisition method of 12-bit differential mode is adopted, and the control words in the program are 0xg0 (x coordinate) and 0xD0 (y coordinate). According to the timing diagram of ADS7843, the workflow of the author's acquisition program is: after the control word is sent after 8 clock cycles, it is read 12 times continuously at the falling edge of DCLK to read the AD sampling value on the touch screen. Due to the cyclic acquisition method adopted by the author, the collected data is not necessarily the data generated by people touching the screen. In the system used by the author, the LPC2478 LCD screen uses the Sharp LQ043T3DX02 LCD screen. If the x-axis data collected is 4 095 (the y-axis data collected is mostly 0, but sometimes it may not be 0). It means that no one touched the screen when the data was collected, and the data can be discarded directly.
In practice, we are not only concerned about the A/D conversion value of the current touch point voltage value by ADS7843, but also the relationship between the touch point and the LCD coordinates. The conversion can be performed through the following conversion formula:
Where: x, y are the coordinates in the LCD coordinates; xAD, yAD are the AD values collected by ADS7843; Tchscr_XMax, Tchscr_XMin, Tchscr_YMax, TchScr_YMin are the ranges of x, y coordinates returned by the touch screen.
2 Conclusion
This article introduces a practical solution for designing a four-wire resistive touch screen using the chip LPC2478 and ADS7843 to achieve specific functions. Practical applications show that the touch screen designed using LPC2478 has strong reliability and environmental adaptability.
Previous article:Design of Constant Temperature Automatic Calorimeter Based on S3C2410
Next article:Design of an Airborne Radio Station Detection Controller Based on ARM
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- About MSP430 Miscellaneous Talks --Precise Delay of delay_cycles
- One article to understand the RF chip industry chain and its domestic status!
- Low-cost DIY nano-level lithography machine! This post-95s boy is popular...
- Type-C interface display solution
- Is there any module similar to Yiweilian?
- How to choose the right operational amplifier
- Maxim Basic Analog IC APP download helps you innovate analog design!
- How is the internal low-pass filter of Bh1415 designed? How is the 150pf connected to pin 3 determined?
- Its automobile inner wheel difference safety warning system
- Motor drive