How to use a single chip microcomputer to drive and control the touch screen

Publisher:RoboPilotLatest update time:2014-02-14 Source: dqjswKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
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 well solve this problem.
A human-machine interface system was built using a touch screen, a single-chip microcomputer and an LCD screen.
In the process of using C8051F020 to control TFT6448BS-5.7, bus control was adopted. Because the TFT6448BS-5.7 liquid crystal controller has a latch function, no external latch chip is required when using bus control. It can be achieved by using the P0, P2, and P3 ports of the single-chip microcomputer 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. Configure the P3 port 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 higher 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 enabled. 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. Initialize AD0 in combination with software programming. When the system is in sleep mode, the software opens an interrupt, cuts off PN P1, PNP2, and N PN 1, and saturates and conducts N PN 2;
3. Wait for the touch screen to be touched;
4. If the touch screen is touched, enter the interrupt service program, turn off the external interrupt, and perform a short delay to eliminate external jitter. By judging the level change of the interrupt input port P0.0, determine whether the jitter has ended. Through software, PN P2 and N PN2 are cut off, PN P1 and N PN 1 are saturated, and the analog-to-digital conversion channel A IN 0.0 is selected to collect the X-direction coordinate value of the touch point, delay and wait for the conversion to end, and remove the conversion result; electrode voltage switching, through software setting, PN P1 and N PN 1 are cut off, PN P2 and N PN 2 are saturated, and the analog-to-digital conversion channel A IN 0.1 is selected to 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 working process of the touch screen hardware interface circuit returns to step 3 and continues to wait for the next touch.
Baidu Button BEGIN
Keywords:MCU Reference address:How to use a single chip microcomputer to drive and control the touch screen

Previous article:Design of Direct Frequency Digital Synthesizer Based on Single Chip Microcomputer
Next article:Matrix keyboard scanning principle

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

Automotive infotainment system solution based on Freescale MCU
Description of the program: Keeping pace with the rapid development of portable electronic products while focusing on their own stringent quality standards and vehicle life cycle requirements is a challenge faced by automakers and in-vehicle infotainment system suppliers. Freescale provides mature automotive infotai
[Automotive Electronics]
Automotive infotainment system solution based on Freescale MCU
Using MCS-51 single chip microcomputer to realize CPFSK modulation
In telemetry and telecontrol systems, data modulation and demodulation are often encountered problems. Some self-reporting stations do not receive remote control commands from a distance, but only collect parameters at regular intervals or when parameters change, and automatically send the collected parameters to th
[Microcontroller]
Using MCS-51 single chip microcomputer to realize CPFSK modulation
What are the stages in the development of microcontrollers?
Development history of single chip microcomputer Microcontrollers were born in 1971. Early SCM microcontrollers were all 8-bit or 4-bit. The most successful one is INTEL's 8051. Since then, the MCS51 series MCU system has been developed on 8051. Microcontroller systems based on this system are still widely used today.
[Microcontroller]
Key points of AVR microcontroller timer
  5 types of work   Normal mode WGM1 = 0 is similar to the normal mode of 51, with TOV1 overflow interrupt flag, which occurs when MAX (0xFFFF)   1. Use the internal counting clock for ICP capture input occasions - measure pulse width/infrared decoding (the capture input function can work in multiple modes, not ju
[Microcontroller]
Design of LED outline display controller based on single chip microcomputer
LED guardrail tube, also known as Lide tube, is an advanced LED decorative lighting product. With red, green and blue LED as the light source, it uses microelectronics and digital technology, can perform color chasing, color transition gradient, grayscale change and seven-color change, and can produce a very rich co
[Microcontroller]
Design of LED outline display controller based on single chip microcomputer
Several basic skills in single chip microcomputer development
In the development of single-chip microcomputer applications, problems such as code efficiency, single-chip microcomputer anti-interference and reliability are still troubling. Here are some basic skills that should be mastered in single-chip microcomputer development.   1. How to reduce bugs in the program. To reduce
[Microcontroller]
Design of infrared remote control circuit based on single chip microcomputer
1 Introduction Infrared remote control has been widely used in various types of home appliances, and its appearance provides a lot of convenience for the use of home appliances. The infrared remote control system is generally composed of two parts: an infrared transmitter and an infrared receiver. The infrared trans
[Microcontroller]
Design of infrared remote control circuit based on single chip microcomputer
What do microcontroller engineers need to master? Where can I get training on microcontroller programming?
Generally speaking, those who know about microcontrollers are interested in microcontrollers and want to make some cool intelligent control products. Or they think that the employment prospects of microcontrollers are good and this technology will not become obsolete. Only children make choices, adults all have to.
[Microcontroller]
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号