As traditional digital displays can no longer express complex information, liquid crystal displays (LCDs) are gradually being widely used in the fields of single-chip-controlled intelligent instruments and industrial control due to their advantages of light weight, low voltage, low power consumption, and rich display content.
The flameproof feeder switch for mines is a key device in the power distribution system of coal mines. Its performance directly affects the production safety and production efficiency of coal mines. At present, the display of most mine feeder switch protectors is usually a light-emitting diode or LED digital display, and most of them use lights to display faults.
In order to improve the display function of the feed switch, a display system with Chinese character display function was designed using the single-chip computer 8031 and a liquid crystal display. The system can display the switch's working parameters (voltage, current, etc.), working status, power supply line fault causes, and the time when the fault occurred in real time through the liquid crystal display, and can store the fault status, which greatly facilitates the maintenance of the line.
1 System hardware composition
In order to complete the various displays of the feed switch, the 8031 single-chip microcomputer is used to control the MGLS-12864 LCD display module. The feed switch protector requires the display of the switch's working status, working parameters (voltage, current, power factor, etc.), fault cause, fault status, and gas alarm.
1.1 Dot matrix LCD display module MGLS-12864
MGLS-12864 is a dot-matrix LCD display module produced by Hong Kong Truly Corporation. The dot matrix is 64 rows x 128 columns. Each screen can display 4 rows x 8 Chinese characters (16 x 16 dot matrix per Chinese character). The display module has 2 HD61202 as column drivers and 1 HD61203 as row driver, which can display 64K dot-matrix graphics. Its main features are that it can directly interface with 80 series microprocessors, can display graphics, characters, and mixed graphics and characters in three ways, and has 64K internal memory. The display screen is divided into 8 pages. The display data format and the distribution of pages, rows and columns of the display screen are shown in Table 1.
This table combined with the timing diagram is very helpful for understanding the seven display instructions of the HD61202 LCD controller. The functions of these seven instructions are shown in Table 2, and the read and write timing diagram of the HD61202 is shown in Figure 1.
1.2 Hardware Interface
There are two ways to connect the 8031 microcontroller and the LCD display module MGLS-12864: direct access and indirect control. This design uses the indirect control method. The system hardware interface diagram is shown in Figure 2.
In Figure 2, according to the read-write timing requirements of Figure 1, P1.2 of 8031 is used as the RS control signal of the LCD display module to determine whether the single-chip microcomputer performs data selection or instruction selection. RS=1, data operation; RS=0, write instruction or read status operation; P1.3 is connected to the R/W selection signal to determine whether the single-chip microcomputer performs read strobe or write strobe on the display module; P1.4 is connected to the enable signal E to determine whether the data is latched and written or read out: P1.1 and P1.0 are connected to CS1 and CS2 to determine the chip selection according to the written data: P0 port is connected to DB0~DB7 of MGLS-12864 for data transmission between the two; the real-time data and status of the switch are sent to the display system for display through the serial communication method between the host computer and 8031. [page]
2 System Software Design
The system program mainly consists of the main program, subprograms and interrupt service programs. The main program flow chart is shown in Figure 3. In the main program, first determine whether the display controller HD61202 is in the "busy" state. If it is not busy, send the display off command to turn off all displays. Then still determine the "busy" state. If it is not busy, send the display on command to prepare for the display, then call the full screen clear subprogram and the Chinese character display subprogram, and finally call the single character subprogram according to the content needs. The Chinese character display subprogram is shown in Figure 4. In the initialization, first set several parameters: which word is displayed, the page address, and the column address Firstcolum. Then select the chip according to the input column. The left and right screen Chinese character display programs are the same, and the write instruction subprogram is called first and then the write program subprogram. Write in a loop in sequence, and finally determine whether the word is written. Other subprograms such as: initialization subprogram, write instruction subprogram, write data subprogram, and clear display subprogram are omitted due to limited space. In the Chinese character display subroutine, the first 16 bytes read are the upper 16x8 dot matrix font data, and the next 16 bytes read are the lower 16x8 dot matrix font data.
3 Problems encountered during debugging
1) Since the MGLS-12864 LCD display module does not have a character library, first use the font extraction software - zimo0221 to extract the Chinese characters, numbers, letters, etc. to be displayed. Set the extraction mode to C51 to obtain the 16x16 dot matrix data of a Chinese character.
2) In NGLS-12864, the ADCs of the two HD61202s are both connected to a high level, and RST is also connected to a high level. In this way, there is no need to consider the functions of these two pins when using NGLS-12864.
3) Each byte (8 bits) in the RAM corresponds to a column in a row on the LCD screen, and one bit in a byte corresponds to a dot on the LCD screen ("0" is off and "1" is on). When clearing a column, write "00H" at the position of the column to be cleared. This method can be used to clear an area or the entire screen.
4) It is very important to meet the timing in the experiment. If the timing is wrong, normal display will not be possible.
4 Conclusion
Through practice, the display system has completed the display of Chinese characters, numbers and letters, as well as cursor flashing and real-time data display. This design can not only be used for the display of intelligent integrated protectors of underground coal mine feeder switches, but also for occasions where display is required, such as intelligent instruments and meters.
Previous article:Hardware structure design of temperature and humidity acquisition system based on single chip microcomputer
Next article:Design of temperature measurement system based on single chip microcomputer and PC serial communication
Recommended ReadingLatest update time:2024-11-16 20:43
- 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
- Key wireless technologies for 5G systems
- [NXP Rapid IoT Review] + Rapid IoT App Running Error
- How to Design an RF Power Amplifier: The Basics
- What is the principle of touch switch?
- What is jitter and phase noise?
- [Shanghai Hangxin ACM32F070 development board + touch function evaluation board evaluation] + OLED screen display driver
- Tailing Micro B91 Development Kit Burning Pitfalls Record
- Antai Testing - Sharing of Maintenance Experience of Tektronix AFG3021 Arbitrary Signal Generator
- Interrupt vectors for ARM (Cortex-M3)
- July 28 live broadcast review: TI DLP technology innovation and new applications in automobiles (including video and text Q&A)