Interface application between LCD controller SED1330 and DSP

Publisher:HarmoniousDreamLatest update time:2006-12-12 Source: 电子元器件应用Keywords:Graphics  CA320240B Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction

At present, SED1330, as one of the most powerful controllers among similar graphic LCD modules, has been widely used in various dot matrix display modules. This article uses the CA320240B graphic model produced by Shenzhen Songshan Electronic Technology Co., Ltd. The LCD module is a 320×240 dot matrix display module based on SED1330, which can effectively solve the display problem.

Performance characteristics of SED1330 controller

SED1330 has a powerful I/O buffer and rich instructions, which can realize text and graphics display in various ways; its data part uses parallel four-bit transmission, and can drive a maximum of 640256 dot matrix LCD display .

The powerful UO buffer of SED1330 is mainly reflected in the following two aspects:

(1) The interface between SED1330 and MPU has a high-performance buffer. Its function is to be ready to accept access from the MPU at any time and to immediately send instructions from the MPU. Parameters or data are in place within the controller's internal timing cycle. This function makes it unnecessary to judge the status bit BF when operating the SED1330.

(2) SED1330 is not only suitable for 8080 series MPU interfaces, but also for M6800 series MPU interfaces.

SED1330 has two display characteristics: text and graphics. In these two display modes, each byte of data in its display RAM (VRAM) corresponds to different display content.

When displaying Chinese characters in this mode, a custom character device CGRAM needs to be established in the VRAM of SED1330, that is, the character code of the Chinese character to be displayed is written in the corresponding display unit. The character code can be implemented as part of the character generator address. Addressing the character generator, after obtaining the corresponding character font data, it is sent to the liquid crystal display drive system for display. The basic character block of SED1330 can correspond to the character block set to 8×8 or 8×16 dot matrix. When set to 8×8 dot matrix, a Chinese character with 16×16 dot matrix requires four basic character blocks of 8×8 dot matrix. Character block combination display. Therefore, when establishing a Chinese character CGRAM at this time, four character codes are needed to manage a Chinese character. Generally, codes are allocated according to the upper left, lower left, upper right and lower right parts.

When it displays Chinese characters in graphic mode, its Chinese character library is established in the system program area, and the program can write to the corresponding units in the graphic display area byte by byte (generally, 16×16 dot matrix Chinese characters are divided into left and right Partial writing, if it is a 24×24 dot matrix, the writing is divided into three parts: left, middle and right). The data in the graphic display area unit is considered to be the 8-point display data, which can be directly sent to the LCD drive system to display the corresponding Chinese characters, the biggest advantage of using graphics to display Chinese characters is that the font size is variable.

Hardware interface between DSP and SED1330

Level conversion between DSP and SED1330 The

I/O working voltage of new generation DSP chips such as TMS320LF240xA is generally 3.3V, and its I/O level is also a 3.3V logic level. Since the working voltage of the liquid crystal is 5V, when using a 3.3V DSP to drive a 5V liquid crystal, level conversion is required. As shown in Figure 1, the lowest voltage VOH of the high-level output of the DSP is 2.4V, and The lowest voltage VIH of a 5V LCD screen when inputting a high level is 3.5V. In this way, even if the DSP output reaches 3.3V, it still cannot meet the minimum value required by the liquid crystal high level. Therefore, a 3.3V DSP cannot directly drive a 5V liquid crystal. screen, therefore when designing the interface between DSP and LCD, a specialized level conversion device (such as TI's SN74LVCZ16245A) should be used. In fact, some chips use dual voltage power supply, one side is 3.3V and the other side is 5V, which can solve the level conversion problem well.

Interface design between DSP and LCD module SED1330

TMS320LF2407A has two ways of accessing the SED1330 interface control board: direct access and indirect access. The direct access method is to directly connect the read and write signal lines of the DSP to the read and write signal lines derived from the SED1330 interface control board. The timing is controlled by the internal read and write logic of the DSP. However, since the liquid crystal display module is a slow peripheral of the DSP, it must To make the speeds of the two match, a certain waiting state must be added to meet the requirements. Considering that the waiting period that can be inserted by the internal waiting state generator of the DSP is very limited (only one waiting state can be inserted into the specified storage space), in Without adding additional hardware equipment, it is difficult to meet the requirements of the equipment, so only indirect access is used in the design, that is, the I/O port of the DSP is used to control the SEED1330, and the interface timing of the SED1330 is simulated through software programming.

In this design, the main frequency of DSP is generally 30MHz, and the LCD module interface control timing adopts M8080 timing. The interface circuit between it and the DSP is shown in Figure 2, in which IOPB0-IOPB7 of TMS320LF2407 are used as data interfaces, and The data lines DB0-DB7 of the liquid crystal display module are connected to complete data transmission with SED1330. When IOPA6 is connected to WR, it can be set low when writing SED1330. When IOPA7 is connected to RD, it can be set low when reading SED1330; CS is grounded to enable the clock of SED1330. IOPA5 is connected to A0 to determine whether it is data (A0=0) or instruction (A0=1). The backlight voltage is provided by the inverter, and the contrast of the LCD display can be adjusted by adjusting the potentiometer.

Software interface design between DSP and SED1330

In order to make the LCD screen work properly, a hardware driver must be written. The key to software design is the initialization of the LCD module and the matching of the interface timing between the DSP and SED1330.

Initialization of the LCD module

The main task of the initialization program is to write appropriate commands and parameters based on the characteristics of the controlled LCD module and the user's display requirements, usually in the form of a parameter table. These commands and parameters must first be written If there is an error in the command setting, the display must be abnormal. Figure 3 shows the initialization process of SED1330. The parameters are: SYSTEM SET (30H, 87H, 07H, 28H, 42H, 0F0H, 28H, 00H), SCROLL (00H, 00H, 0F0H, 80H, 25H, 0F0H, 00H, 4BH, 00H, 00H), HDOT SCR (00H), OVLAY (1CH), CSRFORM (5DH, 07H), CSRW (02H, 00H), CSRDIR (command 4CH), DISP ON (command 59H). The drive system structure of SYSTEM SET is set to a single screen, an external character generator is selected, the character format is 8×8, the character code is 80H-9FH, the internal CGRAM is valid, the display character width and height are both 8, and each line of the LCD requires The number of bytes is 40, the number of dot lines is 240, the operating frequency of the LCD is 70Hz, and the number of units allocated to one display line in the display memory is 40 bytes.

If you need to display text and graphics mixedly, you can only set it to dual composite display, while triple composite display can only be used in graphics mode. Under the dual-screen structure, when the four display areas participate in the dual composite display at the same time, the first and second display areas are located in the upper half of the screen, and the third and fourth display areas are located in the lower half of the screen. At this time, the first and third display areas are combined into the first half of the screen. layer, the second and fourth display areas are combined into the second layer.

The read and write timing of SED1330.

Since the liquid crystal display in this design does not use the data line of the DSP, but uses the IO port of the DSP to simulate the timing of the liquid crystal controller, therefore, in the design, the IO port is used to simulate the read and write timing of the SED1330. It is the top priority.

There are two types of read and write timings for SED1330: M8080 and M6800. This design uses the M8080 timing. The timing is shown in Figure 4, and the time limits are listed in Table 1.


 

Since the processing speed of DSP is much faster than the display speed of SED1330, every time the data to be displayed is sent to SED1330, DSP should generate a certain delay to wait for the response to the display of SED1330. Therefore, in the read and write subroutine, software must be used. Only by generating the above timing can the LCD be operated correctly, otherwise the LCD will not be able to display in time and cause errors. During the design process, the DSP read and write timing is simulated using software instead of relying on the DSP pins R/W, RD, WE and address. The data lines are fixed to ensure the timing. This should be paid special attention to in the design. The following is the author's abbreviated reading and writing subroutine during the design process:

WR_COMMAND:; the entry parameter is COMMAND
LDP #MCRA>>7
LACL PADATDIR; configure IOPA5 --A0=1
OR #0E020H
SACL PADATDIR
LDP #4H
LACL COMMAND
OR #0FF00H
SACL PBDATDIR
; IOPA6--/WR=0 (write enable)
LDP #MCRA>>7
LACL PADATDIR
OR #0E000H
AND #0E0B0H
SACL PADATDIR
RPT #10
NOP
; IOPA6--/WR=1 (write is not enabled)
LACL PADATDIR
OR #0E40H
SACL PADATDIR
LDP #4H
SPLK #100, YANSHI1
CALL DELAYS1; delay 100us
RET
WR_DATA: The entry parameter is DATA
LDP #MCRA>> 7
LACL PADATDIR; configure IOPA5--A0=0
OR #0E000H
AND #0E0D0H
SACL PADATDIR
LDP #4H
LACL DATA1
OR #0FF00H
LDP #MCRA>>7
SACL PBDATDIR
; IOPA6--/WR=0 (write enable)
LACL PADATDIR
OR #0E000H
AND #0E0B0H
SACL PADATDIR
RPT #10
NOP
; IOPA6--/WR=1 (write is not enabled)
LACL PADATDIR
OR #0E40H
SACL PADATDIR
LDP #4H
SPLK #100, YANSHI1
CALL DELAYS1; delay 100us
RET
RD_DATA;
LDP #MCRA>>7
LACL PADATDIR; configure IOPA5--A0=1
OR #0E020H
SACL PADATDIR
; IOPA7--/RD=0 (read enable)
LACL PADATDIR
OR #0E000H
AND #0E070H
SACL PADATDIR
LACL PBDATDIR
LDP #4H
SACL DATA2
RPT #10
NOP
; IOPA7--/RD=1 (reading is not enabled)
LDP #MCRA>>7
LACL PADATDIR
OR #0E80H
SACL PADATDIR
LDP #4H
SPLK #100, YANSHI1
CALL DELAYSI; delay 100us
RET
RD_BUSY:
LDP #MCRA>>7
LACL PADATDIR; configure IOPA5--A0=0
OR #0E000H
AND #0E0D0H
SACL PADATDIR
; IOPA7--/RD=0 (read enable)
LACL PADATDIR
OR #0E000H
AND #0E070H
SACL PADATDIR
LACL PBDATDIR
LDP # 4H
SACL DATA3
; IOPA7--/RD=1 (read enable)
LDP #MCRA>>7
LACL PADATDIR
OR #0E80H
SACL PADATDIR
LDP #4H
SPLK #100.YANSHI1
CALL DELAYS1; Delay 100us
; Determine whether it is busy
LDP #4H
BIT DATA2, 9
BCND RD_BUSY, TC
RET

Show software design process flow

The graphic display mode can display numbers, Chinese characters, and various graphics that can be drawn, but the corresponding dot matrix files must be generated in advance. In fact, displaying characters, Chinese characters, and graphics all write corresponding data to specific areas on the LCD screen. , there is essentially no difference. These data are stored in the program, and are written into the display RAM when they are to be displayed. However, when displaying Chinese characters, the fonts that need to be displayed can be extracted and stored, and then directly displayed. The call is even simpler. When you want to display a picture, you can use the drawing tool provided with Windows to create a 320×240 pixel black and white bitmap, and first invert the bitmap, and then convert the processed picture to 16 The form of the copy file is burned into the external 24LC256 together with the program. Note: the bitmap should be stored at a starting address. The method of setting up the three-layer graphic overlay display is the same. Figure 5 shows a software design program flow chart. It should be noted that when the DSP is powered on, the SED1330 must be reset correctly, otherwise it will not display correctly.

Conclusion

The SED1330 controller has a large-capacity buffer area of ​​64KB, which can be applied to displays of various specifications. Its internal solidified character generator can produce 160 types of fonts and can be expanded externally. By changing the command parameters, the image can be flickered, Flip, move, etc. In terms of overall performance, SED1330 is much stronger than other controllers of the same type, and is very suitable for the design needs of various LCD control systems.

The liquid crystal display solution composed of this controller introduced in this article has successfully passed debugging. Compared with other graphic dot matrix liquid crystal display modules of the same type, its hardware circuit structure is simple and its display function is powerful. At the same time, it is suitable for other models. Interface chips also have good reference value.

Keywords:Graphics  CA320240B Reference address:Interface application between LCD controller SED1330 and DSP

Previous article:Design of LCD display system based on ARM9 processor S3C2410
Next article:Utilize microcontroller I/O port to directly drive LCD

Latest Power Management Articles
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号