Introduction:
The dot matrix liquid crystal display has the advantages of being able to display complex text and graphics, and the display area is varied. It has a wide range of application prospects in industrial and civil fields such as intelligent instruments and electronic equipment.
ST's mPSD series of microcontrollers have been gradually applied to control fields with high functional requirements due to their powerful interface functions, large storage capacity and convenient system development. The rich peripheral interfaces of its programmable logic and the use of large-capacity memory must be configured through PSDsoft Express software, which is different from the development of traditional 51 series microcontrollers. This article focuses on the characteristics of mPSD3334D and its interface with the liquid crystal module GXM12232-1 with built-in SED1520 liquid crystal controller through the application of mPSD3334D in actual projects, and gives the pin configuration of mPSD3334D and the display control flow chart of GXM12232-1.
Introduction to mPSD3334D and SED1520
mPSD3334D MCU
The mPSD33xx series MCU is a high-performance embedded controller that integrates an 8051 microcontroller, a flexible memory structure, programmable logic and a wealth of peripheral interfaces. The chip consists of two modules: MCU and PSD. The differences between different types of MCUs in this series are mainly reflected in the size of the memory space and the power supply voltage of the MCU module and the PSD module. The mPSD3334D has a storage space of 256KB Flash and 8KB SRAM. The MCU module is powered by 3.3V and the PSD module is powered by 5.5V.
Compared with traditional 8032 MCUs, in addition to the clock characteristics and controllable instruction prefetch and jump cache characteristics, the other differences are mainly reflected in the following aspects:
1. Flexible expansion of peripheral interface functions. PA, PB, PC, and PD ports are multi-function multiplexed ports. Through the setting of the corresponding registers, the functions can be flexibly switched according to system needs. The difference between the port power supply voltage and the MCU module voltage can facilitate the interface with peripheral devices with different power supply voltages and reduce the design of system voltage conversion.
2. High-performance JTAG debugging and downloading functions facilitate product development and production.
SED1520 driver
SED1520 is a dot-matrix LCD driver that can be directly connected to an 8-bit CPU and is easy to use. SED1520 usually integrates a column driver and a controller. As a built-in controller, it is widely used in the display of small-scale LCD modules. The
main features of the SED1520 driver are:
1. The internal display RAM capacity is 2560b. Each bit of data controls the on and off state of a point on the LCD screen. "1" means bright, and "0" means dark.
2. It has 16 row drivers and 61 column drivers, which can be easily matched with SED1521 for single column expansion.
3. The bus speed can reach 10M, and the display duty cycle is 1/16 or 1/32.
For LCD modules using SED1520 as the driver, SED1520 and SED1521 have different combinations of rows and columns depending on the size of the LCD screen. For example, the LCD module with a screen size of 141×16 and a duty cycle of 1/16 uses SED1521 to expand the columns. When the number of LCD rows exceeds the row drive capability of a single SED1520, a master-slave SED1520 can be used for row expansion. As shown in
Figure 1. The internal system block diagram of the SED1520 driver used in the GXM12232-1 LCD module introduced in this article is shown in Figure 1. The two SED1520s using the master-slave structure control the left and right half of the display screen respectively.
Figure 1. SED1520 instruction and display RAM structure are extended by master-slave SED1520.
The SED1520 instruction system is relatively simple, with 13 instructions in total. Except for the read status instruction and the read display RAM data instruction, all other instructions are write operations, and the read and write instructions are single-byte instructions. When sending each instruction, the controller status must be detected. The meaning of the status byte is as follows:
D7: 1/0, module busy/ready;
D5: 1/0, module display off/on;
D4: 1/0, module reset/normal;
D3-D0: not used
in the use of instructions. The key is to distinguish the relationship between display row, column setting and display page setting. A single SED1520 can drive a 61×16 LCD screen. Its internal display RAM is a display page for every 8 lines relative to COM0, so the module used in this article can display 4 pages. [page] Hardware interface and configuration
of LCD module and mPSD3334D The SED1520 driver is designed with two interface timings: 80-CPU and 68-CPU. When the GXM12232-1 module uses different control timings, the pin connection functions are different. This design uses the 68-CPU control timing when using this module. The PA port is connected to the LCD module data line, PB4 and PB3 are connected to the LCD module pins E1 and E2 respectively, PB2 is connected to the module RW, and PB1 is connected to the module data command control pin A0. PSD module PA and PB port pin definition The PA of the mPSD3334D microcontroller is a multi-function multiplexed port, and the PB port has a programmable logic output function. In this article, in order to facilitate program transplantation and interface timing requirements, the PA port is set to peripheral device mode; PB4 and PB3 are set to CPLD output external chip select, high level effective mode, named LCD_E2 and LCD_E1; PB2 and PB1 are set to CPLD output Combinatorial mode, named LCD_RW and LCD_A0. The pin definition of the peripheral device mode of the PA port must be completed using the PSDsoft_Express software, and the pin working mode cannot be changed when the program is running. PSD module logic function settings According to the requirements of the interface timing, set the corresponding logic functions for the PA and PB ports. The logic functions closely related to this article are mainly PSEL and PB[4:1] pin signals. PSEL, PB4 and PB3 are chip select logic settings, and PB2 and PB1 are I/O logic function settings. When setting the chip select logic function, it must be ensured that it does not conflict with the address distribution of the Flash and SRAM storage areas in the mPSD3334D. The above logic function settings must be completed in the design assistant window of the PSDsoft Express software. When the PA port works in the peripheral I/O mode, the PSEL chip select logic address is the peripheral I/O address space of the PA port. In the PA port peripheral I/O mode, any of them can be set. The main program must initialize the VM register to enable the PA port peripheral I/O mode. Set the PB4 and PB3 logic, and enable the LCD_E1 and LCD_E2 signals to select the Master and Slave controllers of the LCD module. When the I/O address range is between Hex Start and Hex End, and the read or write signal is valid, the LCD_E1 and LCD_E2 pin signals are selected. LCD_RW is used to distinguish the read and write of commands or data, and LCD_A0 is used to distinguish commands or data. In the I/O logic function setting, according to the setting of the chip select signal, LCD_RW is connected to the address signal a0, LCD_A0 is connected to the address signal a1, LCD_A0=0 indicates command, and LCD_A0=1 indicates data. According to the above settings, it can be seen that the address signal a2 is used to distinguish the selection of Master and Slave drivers, and the combination of a1a0 realizes the read and write control of commands and data. The corresponding command and data control addresses of the Master and Slave drivers of the GXM12232-1 module are shown in Table 1.
The control command of the SED1520 controller is a single-byte instruction. When controlling in the GXM12232-1 module, the corresponding data and command bytes are sent according to the data and command addresses of the Master and Slave modules. However, a busy state detection
must be performed every time data or commands are read or written. The relevant command words are specifically introduced in the previous and related data manuals. Figure 2 shows the control command word flow chart.
Figure 2 Control command flow chart
The normal operation of the SED1520 controller must be configured, including display switch, static or dynamic display, duty cycle, etc. This process is mainly a write command control process, which is completed by calling OutMasterCom(unsigned char i) and OutSlaveCom(unsigned char i) multiple times. Taking the Master controller of the GXM12232-1 module as an example, its command control code is as follows. For the Slave controller, just change the corresponding address. [page]
void OutMasterCom( unsigned char i ) // write master command
{
while ((rm_status & 0x80)); //rm_status the command read address of master
wm_command = i; //wm_command the command write address of master
}
Taking the Master controller of the GXM12232-1 module as an example, its write data code is as follows.
void OutMasterDat( unsigned char i ) //write master data
{
while ((rm_status & 0x80));
wm_data = i; //wm_data the data write address of master
}
The data display process of the LCD screen is mainly divided into two steps: setting the display address command and sending the display data. The GXM12232-1 module consists of two controllers, Master and Slave. When the display column address is set to be greater than 60, the display window switches to Slave, that is, the right half of the screen. In the application, the display data adopts the vertical modulus method. When displaying characters and graphics in the GXM12232-1 module, attention must be paid to the range of the display window and PAGE. The program flow is shown in Figure 3. Because the size of the page occupied by different display objects is different, the detection range must be determined according to the object size when detecting the page range.
Figure 3 Character and graphic display flow chart
Conclusion
This article introduces the connection between the PA port of the mPSD series microcontroller and the GXM12232-1 module in the peripheral device I/O mode and the corresponding display program design. The program design of the GXM12232-1 module uses the C51 hardware language, which is highly portable and helps other modules with built-in SED1520 LCD controllers.
Previous article:Research on Portable Electrocardiograph Based on Single Chip Microcomputer
Next article:Application of YD-613 in single chip microcomputer and embedded system
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
- PCB Design
- Why can't I see the bluetooth function when running micropython on EPS32?
- Does anyone know how this kind of colored PCB is made? ?
- [MM32 eMiniBoard Review] In-depth understanding of HID-2
- New version of WEBENCH user guide
- [FS-IR02 + D1CS-D54] - 5: Linking with MCU (D1CS-D54)
- Please tell me how to draw the differential line of this USB
- How is the burning of OTP chip carried out after SMD?
- MSP430FR2355 Mixed-Signal Microcontroller
- Timing Analysis 1 Static Analysis Basics