How to use a microcontroller to drive and control the touch screen

The touch screen is the simplest, convenient and natural input device for Chinese multimedia information inquiry. It has many advantages such as sturdy and durable, fast response, space saving and easy communication. Touch screen technology is considered to be one of the mainstream directions of human-computer interaction technology in the future, and the application of related industries and their products is becoming a hot spot. However, the traditional touch screen is difficult to apply to a wider range of industrial control equipment because of its high cost. At present, the touch screen design of Wuhan Guxin Technology can solve this problem well, and a human-machine is built by using touch screen, single-chip computer and LCD screen. Interface system.

In the process of controlling TFT6448BS-5.7 with C8051F020, the bus mode is used for control. Because the TFT6448BS-5.7 liquid crystal controller has its own latch function, it does not need to add a latch chip when using the bus mode for control. It only needs to use the P0, P2, and P3 ports of the single chip C8051F020. Before the system is powered on, the typical operating voltage of the C8051F020 is 3.3V, and the working voltage of the TFT6448BS-5.7 is 5V. The driving capability of the corresponding connecting pins of the P0, P2, and P3 ports is extended; according to the control requirements, P0, P2 are passed. The P3 port register configures the pin of the corresponding port as the drain output mode. The P3 port is configured as a data/address output port. When the address is output, it is the lower eight bits of the address bus, and the P2 port provides the upper 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 to the corresponding row, column, control and data registers of TFT6448BS-5.7, the control of TFT6448BS-5.7 can be realized by C8051F020 chip, thereby Realize the display control of color liquid crystal.

The specific working process of the touch screen hardware interface circuit is as follows:

1. Connect the circuit as shown in Figure 2, and connect the power input terminal and the reference voltage reference to the 3.3V DC power supply.

2, combined with software programming to initialize AD0, when the system is in the sleep state, the software is interrupted, the cutoff PNP1, PNP2, NPN1, saturation turn on NPN2;

3. Wait for the touch screen to be touched;

4. If a touch occurs on the touch screen, enter the interrupt service routine, turn off the external interrupt, and make a short delay to eliminate external jitter. It is determined whether the jitter is ended by judging the level change of the interrupt input port P0.0. Through the software cut-off PNP2, NPN2, saturation turn-on PNP1, NPN1, select the analog-to-digital conversion channel AIN0.0, collect the X-direction coordinate value of the touch point, delay waiting for the end of the conversion, remove the conversion result; electrode voltage switching, set by software Cutoff PNP1, NPN1, saturation turn-on PNP2, NPN2, select the analog-to-digital conversion channel AIN0.1, collect the Y-direction coordinate value of the touch point, delay waiting for the end of the conversion, and remove the conversion result;

5. By comparing the collected X and Y coordinate values ​​with the set button boundary values, if the comparison result is true, then switching to the corresponding subpage, otherwise, reopening the interrupt and returning 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.

Correct Electronic Calculator advantage:

14 digits  tax calculator,Check Calculator,We use good quality LCD display screen.fonts are clearly visible.Dual power solar power make life recycling.With the first raw material, fine workmanship and repeated testing, ABS is more durable and firm.


tax check calculator



Correct Electronic Calculator

Correct Electronic Calculator,Correct Calculator,Correct Scientific Calculator,Check Correct Function Calculator

Dongguan City Leya Electronic Technology Co. Ltd , https://www.dgleya.com

This entry was posted in on