Interface and display design between LCD controller SED1520 and single chip microcomputer mPSD3334D

Publisher:创客1992Latest update time:2013-09-29 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Interface and display design between LCD controller SED1520 and single chip microcomputer mPSD3334D

Previous article:Research on Portable Electrocardiograph Based on Single Chip Microcomputer
Next article:Application of YD-613 in single chip microcomputer and embedded system

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号