Study on the interface of MGLS-12864 controlled by single chip microcomputer

Publisher:Joyful444LifeLatest update time:2011-10-11 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

MGLS-12864 interface diagram controlled by single chip microcomputer

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

Flowchart of MCU control MGLS-12864 interface program

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.

Keywords:MCU Reference address:Study on the interface of MGLS-12864 controlled by single chip microcomputer

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

About 51 single chip microcomputer two-machine communication
The figure above is a schematic diagram of two-machine communication. The following are the procedures for two-machine communication.   //For the receiver #include #define  uchar  unsigned  char; #define  uint  unsigneed int; uchar a; //For saving the sent data uchar b ={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x8
[Microcontroller]
About 51 single chip microcomputer two-machine communication
High-speed control scheme for large-screen LED display using MCS51 single-chip microcomputer
introduction The basic working principle of LED display screen is dynamic scanning. The display control process is to first read the font data from the data storage, then write the data to the LED dot matrix through the serial port or parallel port of the microcontroller, and then scan it. Compared with th
[Microcontroller]
High-speed control scheme for large-screen LED display using MCS51 single-chip microcomputer
Design of high-precision digital DC current source based on single-chip microcomputer
1 Introduction The DC current source is a widely used electronic instrument. For situations where the output current is required to be adjustable, the simplest and most practical method is to achieve it through software control. Using a single-chip microcomputer as the main control component makes the system design s
[Microcontroller]
Design of high-precision digital DC current source based on single-chip microcomputer
Discussion on low power consumption of PIC microcontroller
1. Sleep Sleep mode is one of the most common ways to reduce power consumption, but the microcontroller cannot do anything during sleep. For those who fall asleep when there is nothing to do and do something when there is something to do, sleep is undoubtedly the lowest power consumption processing method. for exa
[Microcontroller]
Application of 32-bit MCU in servo motor
In the servo system, AC permanent magnet synchronous motor has become the mainstream choice of servo system because of its excellent low-speed performance, weak magnetic high-speed control, wide speed regulation range, high dynamic characteristics and efficiency. At present, permanent magnet synchronous AC servo techno
[Microcontroller]
Application of 32-bit MCU in servo motor
AVR drive LCD via SPI module
  //********************written by ovie.xuan 2010.08.12--------------------- #include avr/io.h #include avr/interrupt.h #include avr/pgmspace.h #include util/delay.h //#include avr/wdt.h #define sce0 PORTC&=0XFd //Chip select #define rst0 PORTC&=0XFb //Reset #define dc0 PORTC&=0XEF //1 write data, 0 write
[Microcontroller]
AVR drive LCD via SPI module
51 MCU-Function Encapsulation
1. Clean code Generally, the reading of single-chip microcomputer programs starts with the main function. The program writing method in the previous lecture is not concise in the main function, which affects the efficiency of reading the code. Sometimes we only need to know what a statement means, so we encapsulate th
[Microcontroller]
51 MCU-Function Encapsulation
The software and hardware design of ultrasonic tooth cleaning machine based on single chip microcomputer
1. Hardware Design The hardware circuit block diagram is shown in Figure 1. The basic working process of the dental cleaning machine is as follows: the TL494 core oscillator circuit generates a push-pull pulse output with controllable duty cycle under the control of the MPU, and the MPU sends data serially
[Microcontroller]
The software and hardware design of ultrasonic tooth cleaning machine based on single chip microcomputer
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号