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.
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
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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
- C6678: How does the malloc function do byte alignment
- Detailed explanation of ADC of MSP430 microcontroller
- Realization of various wavelet transforms based on FPGA
- The world's first integrated 5G baseband processor Kirin 990 5G was released today
- Area Occupancy Detection Reference Design for mmWave Sensors
- Multi-axis drone airbag
- I bought an old power supply, and this method of cleaning dust is the most effective
- MSP430 MCU Development Record (27)
- Comparison of three RC oscillator circuits
- EEWORLD University ---- Live Replay: Keysight Oscilloscope Basic Training