The touch screen is currently the simplest, most convenient, natural and suitable input device for China's multimedia information query. It has many advantages such as durability, fast response, space saving, and easy communication. Touch screen technology is considered to be one of the mainstream directions of future human-computer interaction technology, and the application of related industries and products is also becoming a hot spot. However, traditional touch screens are difficult to apply to a wider range of industrial control equipment due to their high cost. At present, Wuhan Guxin Technology's touch screen design solution can solve this problem well, using touch screens, single-chip microcomputers and LCD screens to build a human-computer interface system.
In the process of using C8051F020 to control TFT6448BS-5.7, bus control is adopted. Because the TFT6448BS-5.7 liquid crystal controller has a latch function, there is no need for an external latch chip when using bus control. It can be realized by using the P0, P2, and P3 ports of the single-chip C8051F020. Before the system is powered on, since the typical operating voltage of C8051F020 is 3.3V and the operating voltage of TFT6448BS-5.7 is 5V, the driving capacity of the corresponding connection pins of the P0, P2, and P3 ports is expanded; according to the control requirements, the pins of the corresponding ports are configured as drain output mode through the P0, P2, and P3 port registers. The P3 port is configured as a data/address output port. When outputting the address, it is the lower eight bits of the address bus, and the P2 port provides the high address; when transmitting data, it is an 8-bit data bus port. After the system is powered on, the chip select signal /CS of TFT6448BS-5.7 is valid. By writing data into the corresponding row, column, control and data registers of TFT6448BS-5.7, the C8051F020 chip can be used to control TFT6448BS-5.7, thereby realizing the display control of color LCD.
The specific working process of the touch screen hardware interface circuit is as follows:
1. As shown in Figure 2, connect the circuit and connect a 3.3V DC power supply to the power input terminal and the reference voltage terminal;
2. Combine software programming to initialize AD0. When the system is in sleep mode, the software turns on interrupts, cuts off PNP 1, PNP2, and NPN 1, and saturates and turns on NPN2;
3. Wait for the touch screen to be touched;
4. If a touch occurs on the touch screen, enter the interrupt service program, turn off the external interrupt, and perform a short delay to eliminate external jitter. Determine whether the jitter has ended by judging the level change of the interrupt input port P0.0. Cut off PNP2 and NPN2 through software, saturate and conduct PNP1 and NPN1, select the analog-to-digital conversion channel AIN0.0, collect the X-direction coordinate value of the touch point, delay and wait for the conversion to end, and remove the conversion result; switch the electrode voltage, set it through software, cut off PNP1 and NPN1, saturate and conduct PNP2 and NPN2, select the analog-to-digital conversion channel AIN0.1, collect the Y-direction coordinate value of the touch point, delay and wait for the conversion to end, and remove the conversion result;
5. By comparing the collected X and Y coordinate values with the set key boundary values, if the comparison result is true, switch to the corresponding sub-page, otherwise, reopen the interrupt and return to the main program;
6. The touch screen hardware interface circuit operation process returns to step 3 and continues to wait for the next touch.
Previous article:51 MCU C Language Tutorial (I) Create the first project
Next article:Intelligent control system for medical infusion device based on Anxin No.1
Recommended ReadingLatest update time:2024-11-22 22:10
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Dear hardware engineers, can you solve differential equations?
- Temperature Problem Solved for You (V) Efficient Cold Chain Management through Scalable Temperature Sensors
- Field Programmable Gate Array is...? ?
- [Analog Electronics Course Selection Test] Choose, Study, and Score
- PIC16C712 functions, features, and application areas
- "DSP Principles and C Programming Development Technology" related sample files
- Desktop Assistant Based on GD32F350——Supplementary Video
- ARM CORTEX-M3 core architecture understanding summary
- Introduction to TI's three-phase Vienna PFC solution
- OBD output data