In many single-chip microcomputer application systems, liquid crystal displays (LCDs) are widely used in terminal display human-machine interfaces. Dot-matrix LCDs can display not only characters and numbers, but also graphics, curves and Chinese characters, and can achieve a variety of animation display effects, making the human-machine interface more friendly and the operation more flexible and convenient. MGLS12864 is a common graphic LCD display module with a built-in HD61202 controller on the market. It has the advantages of low power consumption, small size, light weight, simple structure and easy use. SPCE061A is a 16-bit microprocessor launched by Lingyang Technology after SPCE500A. The CPU core uses a 16-bit μ'nSP microprocessor chip, which is more integrated, cost-effective and more flexible and convenient to use than the MCS-51 series single-chip microcomputer.
This article describes the structural characteristics of the dot-matrix LCD MGLS12864 and the instruction system of its controller HD61202, and specifically designs and debugs the hardware interface circuit and software program between MGLS12864 and the single-chip microcomputer SPCE061A. After actual operation, the LCD display module works reliably and meets the design requirements.
1 Working principle of MGLS12864
The MGLS12864 display module has two HD61202 as column drivers and one HD61203 as row driver, which can display 64 KB dot matrix graphics. The number of dot matrix is 64 rows × 128 columns, and each screen can display 4 rows × 8 Chinese characters (16 × 16 dot matrix per Chinese character). It has 64 KB of internal memory, and the display screen is divided into 8 pages.
1.1 Pin characteristics
The pin characteristics of MGLS12864 are shown in Table 1.
From the pin characteristics in Table 1, we can see that the MGLS12864 module has 18 pins. Pins 1 and 2 are two chip select signals. The combination function definition is: CS1, CS2 are forbidden to use when they are 00, select the left area when they are 01, select the right area when they are 10, and not select when they are 11; Pin 3 is the power ground Vss; Pin 4 is the power supply voltage Vdd; Pin 5 is the LCD display drive power supply V0; Pin 6 is the data instruction selection terminal RS; Pin 7 is the read/write selection signal R/W; Pin 8 is the enable signal E; Pins 9 to 16 are the data bus DB0 to DB7, which can be easily connected to the microcontroller; Pins 17 and 18 provide power for the backlight. [page]
1.2 HD61202 Instruction System
MGLS12864 controller HD61202 has a built-in 4096-bit (64×64) display RAM. Each bit of data in the RAM corresponds to the light or dark state of a point on the LCD screen. HD61202 controls the display screen through a series of operation instructions. The HD61202 instruction system is shown in Table 2.
(1) Display switch setting: When D=1, LCD displays the contents in RAM, and when D=0, the display is turned off;
(2) Display start row setting: L0~L5 takes values in the range of 0~3FH (0~63 rows);
(3) Page address setting: P0~P2: Set the page number (0~7), showing that the RAM has 64 rows in total and is divided into 8 pages, with 8 rows per page;
(4) Column address setting: C0~C5: Set the display column address 0~3FH (0~63 rows);
(5) Controller status: When BUSY=1, the internal is working, and when BUSY=0, it is in normal status; when ON/OFF=1, the display is turned off, and when ON/OFF=0, the display is turned on; when REST=1, it is in reset status, and
when REST=0, it is in normal status. In BUSY and REST status, except for the read status instruction, other instructions will not have any effect on HD61202. Before operating HD61202, check the BUSY status to determine whether HD61202 can be operated;
(6) After each read/write operation of the read/write data instruction, the column address will automatically increase by 1. Before the read operation, there must be an empty read operation, followed by a data read operation to read the data in the unit to be read.
2 Hardware interface circuit design of MGLS12864 and SPCE061A
SPCE061A has built-in 2 KB SRAM, 32 KB FLASH, 32 b programmable input and output ports, 7 10 b ADCs and 1 sound analog-to-digital converter, 2 10 b DACs, 2 16 b programmable timers/counters, programmable audio processing, etc. The operating voltage of SPCE061A is 2.6~3.6 V (CPU), 2.6~5.5 V (I/O), and the CPU clock is 0.32~49.152 MHz.
[page]
The hardware interface circuit of MGLS12864 and SPCE061A microcontroller is shown in Figure 1. IOA0~IOA7 of SPCE061A is connected to DB0~DB7 of MGLS12864 as data input and output, and IOB0~IOB4 is connected to CS1, CS2, E, RS, R/W of MGLS12864 as the control end of the microcontroller to the liquid crystal module.3 Display program design
This system program includes the main program and subprogram modules, among which the subprograms include initialization, full screen clearing subprogram, Chinese character display subprogram, and list of individual characters subprogram. The main program completes the control of the liquid crystal module by calling the subprogram. The flow chart of the liquid crystal display program is shown in Figure 2. First, it is determined whether the display controller HD61202 is in the "busy" state. If it is not busy, the display off command is sent to turn off all displays. Then it is still determined to be in the "busy" state. If it is not busy, the display on command is sent to prepare for the display, and then the full screen clearing subprogram and Chinese character display subprogram are called. Finally, the list of individual characters subprogram is called according to the content needs.
4 Conclusion
This article introduces the application of the LCD display MGLS12864 with built-in HD61202 on the Lingyang SPCE061A. In terms of hardware, the rich I/O resources on the SPCE061A are used to drive the LCD module, simplifying the interface circuit design. In terms of software, the Lingyang μ'nsP IDE development environment uses C language to compile and debug the LCD program, which is convenient and reliable. From the debugging effect, the use of MGLS-128G4 improves the visualization of the system and meets the design requirements. SPCE061A not only has the functions of a general controller, but also has its unique voice processing function, which can develop many intelligent products.
Previous article:Introduction to the single chip temperature recording system solution
Next article:LCD1602 control bus mode based on single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 22:49
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
- 【RT-Thread software package application work】Small alarm clock
- High-side current sampling problem
- Qorvo 100 MHz Envelope Tracking Solution for 5G
- 【Beetle ESP32-C3】3. Adjust LED brightness with knob (potentiometer) (Arduino)
- Check in, welcome to communicate
- China's first batch of autonomous driving unmanned commercial licenses issued! Do you dare to sit in an unmanned car? ?
- GDB debugging and DSP
- The IO pin of MSP430 is set as input, but it receives the output signal of the Hall sensor, and the chip-side signal does not switch.
- [Serial] [Starlight Lightning STM32F407 Development Board] Chapter 10 Serial Communication Experiment
- Where do errors in vector network analyzers come from?