The touch screen is currently the simplest, most convenient, natural input device suitable for China's multimedia information inquiry and national conditions. It has many advantages such as durability, fast response speed, 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 products is also becoming a hot spot. However, the traditional touch screen is difficult to apply to a wider range of industrial control equipment due to its high cost. The current touch screen design solution of Wuhan Guxin Technology can solve this problem very well. It uses the touch screen, microcontroller and LCD screen to build a human-machine interface system.
In the process of using C8051F020 to control TFT6448BS-5.7, the bus method is used for control. Because the TFT6448BS-5.7 LCD controller has its own latch function, there is no need to add an external latch chip when using the bus method for control. It only needs to use the P0, P2, and P3 ports of the single-chip computer 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 capabilities of the corresponding connection pins of the P0, P2, and P3 ports are expanded; according to the control requirements, through P0, P2, P3 port register configures the pin of the corresponding port into a drain output mode. Configure port P3 as a data/address output port. When outputting an address, it is the lower eight bits of the address bus. Port P2 provides the high bit 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 to the corresponding row, column, control and data registers of TFT6448BS-5.7, the C8051F020 chip can be used to control the TFT6448BS-5.7, thus Realize display control of color LCD.
The specific working process of the touch screen hardware interface circuit is as follows:
1. For the circuit shown in Figure 2, connect the lines and connect the 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 state, the software turns on interrupts, turns off PNP1, PNP2, and NPN1, and turns on NPN2 in saturation;
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 perform a short delay to eliminate external jitter. Determine whether the dithering ends by judging the level change of the interrupt input port P0.0. Cut off PNP2 and NPN2 through software, turn on PNP1 and NPN1 in saturation, select analog-to-digital conversion channel AIN0.0, collect the X-direction coordinate value of the touch point, wait for the end of conversion, and remove the conversion result; switch the electrode voltage and set it through software , cut off PNP1 and NPN1, saturate and conduct PNP2, NPN2, select the analog-to-digital conversion channel AIN0.1, collect the Y-direction coordinate value of the touch point, wait for the end of the conversion, 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, re-enable 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.
Previous article:UART extension implementation designed for C8051F310
Next article:MAX1166 typical application circuit
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- ODX-based diagnostic application software INTEWORK-OBT
- Share the MSP430F5529 clock UCS programming considerations
- RK3288 Information
- FFT based on C2000 series DSP
- Occupy the posting position, ESP32---WS2812 16*16 dot matrix drawing points, lines and surfaces
- About the pitfalls of ADXL362 accelerometer
- SimpleLink Wi-Fi Devices
- Efficiency Programming of Single Chip Microcomputer Active Buzzer Driver
- TMS320F28335 project development record 9_28335 interrupt system
- About the problem of setting breakpoints in CCS