Design and implementation of a liquid crystal display based on DSP control

Publisher:皮球Latest update time:2007-01-18 Source: 电子技术应用 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In recent years, with the emergence of low-price, high-performance DSP chips, DSP has been increasingly used in fields such as high-speed signal acquisition, speech processing, image analysis and processing, and has increasingly shown its huge advantages. The LCD screen is used as the display front-end of various portable systems because of its intuitive display and easy operation. Traditional LCD displays are often controlled by microcontrollers. However, when the system has a large amount of high-speed real-time data, the single-chip microcomputer becomes unable to do so due to the limitation of processing speed. In order to solve these problems, this article proposes a design of an LCD screen based on DSP control, which effectively solves the above problems encountered.

1 Introduction to the SED1335 controller

The AT-320240Q1 LCD display is an LCD display with a built-in SED1335 controller produced by Taipei Crystal Technology Co., Ltd. It consists of a 320×240 dot matrix and has the advantages of high resolution (dot pattern is 0.225mm×0.225mm), convenient interface (5V or 3.3V), simple design (embedded controller), low power consumption, and cheap price. , often used in various portable device display front-ends and daily home appliance display modules. The display screen based on 320×240 dot matrix has a variety of extended functions for users to choose from, which greatly facilitates users and improves the integration and practicality of the system.


The SED1335 controller is an LCD display controller produced by the Japanese EPSON company. Compared with similar products, it has the most powerful functions. Its main features include:

an I/O buffer with strong functions;
rich command functions;
four-bit data sent in parallel;
and mixed display of graphics and text.

The instruction set of the SED1335 controller is shown in Table 1. The SED1335 controller has 13 instructions, most of which have parameters. The parameter values ​​can be set by the user according to the characteristics of the controlled LCD module and the display needs.

Table 1 SED1335 controller instruction list

The SED1335 controller is a control chip used between the MPU system and the LCD module. It receives instructions and data from the MPU system and generates corresponding timing and data control module displays. A0 is the selection input of the LCD control register, which gates the command input buffer and the data input buffer respectively, similar to the RS or D/I of the usual character dot matrix LCD module. The MPU writes the instruction code into the instruction input buffer (i.e. A0=1), and the parameter data of the instruction is subsequently written through the data input buffer (A0=0). One of the functions of the instruction code with parameters is to strobe the corresponding parameter register. The execution of any instruction (except SLEEPIN, CSRDIR, CSRR and MREAD) occurs after the input of the auxiliary parameters is completed. The MPU can also write new parameters and effectively combine them with the remaining old parameters to form a new parameter group. It should be noted that when actually using the instruction, if the instruction has multiple parameters, each parameter must be written in order and cannot be omitted at will. Especially when the MPU operates SED1335 and the LCD module it controls, the SYSTEN SET (40H) command must be written first. If there is an error in the setting of this command, the display must be abnormal.

Here we focus on the CPSDIR instruction. The function of this instruction is to specify the direction in which the cursor address pointer automatically moves. The cursor address pointer controlled by SED1335 actually also displays the current address pointer of RAM. After the controller completes the read and write operations, the cursor address pointer will be automatically modified. This command has four parameters: 4C/4D/4E/4FH, which respectively represent the four directions of modification, so it has a strong drawing function, which many LCD controllers do not have. In the design of the AT-320240Q1 LCD display, the order of display is from right to left, that is, an 8×1 dot matrix on the display screen corresponds from left to right to the high bit to the low bit of 1 bit data in the memory unit. Therefore, for conventional fonts, the display will be reversed. This problem can be solved by controlling the movement direction of the cursor address pointer.

2 Design of hardware interface between DSP and LCD display

Since this LCD display is embedded with SED1335 controller and directly leads out the interface circuit, the overall design is greatly simplified for users, and only the differences between the DSP and the interface circuit need to be considered. Just connect.

The following is a design scheme for the interface between DSP and the LCD display hardware, as shown in Figure 1.

In the design process of this system, TI's TMS320C5402 chip was selected. Since its internal ROM cannot be written, a 32K 27256 EEPROM is plugged in as an external program area to store programs and external fonts. Considering that the TMS320C5402 chip has an external expansion space of up to 1Mbit, users can change the size of the ROM as needed during actual applications. For the data interface of the LCD display, because both the DSP and the LCD display are powered by 3.3V, the data lines of the two can be directly connected, so that the DSP can directly send the data in the ROM or RAM to the controller's cache for display. . The control signal of the LCD screen is decoded by the 16th and 9th bits of the DSP address line. Therefore, in the design of the program, the instruction port address is 8100H and the data port address is 8000H. Since the read and write pins of the DSP are multiplexed, when the pin is high, the read signal of the LCD screen is strobed with a low level through the NOT gate; when the read pin is low, the read signal of the LCD screen is strobed directly. Write pin.

3 Software design for DSP control of LCD display.

Here, the software design of DSP for controlling LCD display is explained in detail through the initialization process of LCD display and how to display a picture. The picture to be displayed is shown in Figure 2. You can create such a 320×240 black and white bitmap through the drawing tool that comes with WINDOWS. In view of the fact that this display screen displays from right to left, it needs to be flipped vertically symmetrically, and finally the processed image is burned into the external 27256 in the form of a hexadecimal file. The starting address of the picture data file in the DSP external space is: 0C000H.

It can be seen from the flow chart (Figure 3) that after the system hardware is powered on and reset, the software automatically sets various controller command codes and parameters according to the user's needs, thereby completing the parameters of the liquid crystal module (such as the behavior of the liquid crystal). number, column number, scanning frequency, cursor position, etc.) and a series of initialization processes such as display mode. After the system is correctly initialized, the data in the external ROM can be sent directly to the SED1335 display buffer through the DSP, and the controller can control the LCD screen to display the picture required by the user. At the same time, users can also change the form of picture display during the running of the main program according to their own needs. They only need to select the corresponding instruction code and parameters in Table 1.



The method of setting the system command and its parameters is as follows: According to the design of the user's hardware circuit, first send the command code to the command port address of the SED1335 controller; then send the parameters of the command to the data port address in turn, and after the system command and its parameters After setting, the data can be sent to the data port address. The specific syntax is as follows:

Instruction setting statement:
STM #XXH, AR0; XXH is the instruction code
PORTW AR0, #8100H; 8100H is the command port address
parameter setting statement:
STM #XXH, AR0; XXH is the instruction parameter
PORTW AR0, #8000H; 8000H is the data port address
...
Data input statement:
STM #XXH, AR0; XXH is user data
PORTW AR0, #8000H; 8000H is the data port address
...
The initialization procedure of the LCD display is as follows:
INIT:
STM # 40H, AR0; System setting command, command code: 40H
PORTW WR0, #8100H
STM #10H, AR0; Standard setting
PORTW AR0, #8000H
STM #87H, AR0; Set cursor width to 8
PORTW AR0, #8000H
STM #07H, AR0; Set the cursor height to 8
PORTW AR0, #8000H
STM #27H, AR0; Set the number of bytes required for each line of the LCD,
PORTW AR0, #8000H 320 points per line, the number of lines is 320/8=40
STM #36H , AR0; Set the scanning frequency of the LCD to about 70Hz
PORTW AR0, #8000H
STM #0F0H, AR0; Set the number of dot lines of the LCD to 240
PORTW AR0, #8000H
STM #28H, AR0; Set the display buffer occupied by one line of the display Number of bytes
PORTW AR0, #8000H
STM #00H, AR0
PORTW AR0, #8000H
STM #44H, AR0; SCROLL instruction, instruction code: 44H
PORTW AR0, #8100H
STM #00H, AR0; Determine the first address of the first display area
PORTW AR0, #8000H
STM #00H, AR0
PORTW AR0, #8000H
STM #240D, AR0; Set the number of rows in the first display area
PORTW AR0, #8000H
STM #00H, AR0; Determine the first address of the second display area
PORTW AR0 , #8000H
STM #40H, AR0
PORTW AR0, #8000H
STM #0F0H, AR0; Set the number of lines in the second display area
PORTW AR0, #8000H
STM #00H, AR0; Determine the first address of the third display area
PORTW AR0, # 8000H
STM #80H, AR0
PORTW AR0, #8000H
STM #4CH, AR0; Set the cursor to automatically move from left to right
PORTW AR0, #8100H
STM #5BH, AR0; Set the display screen to two-layer overlay display
PORTW AR0, #8100H
STM #0DH, AR0
PORTW AR0, #8000H
…………
STM #42H, AR0; LCD display buffer instruction
PORTW AR0, #8100H
LD #240D, A; Clear screen program
LOOP1: LD #40D, B
LOOP2: STM #00H, AR0
PORTW AR0, #8000H
SUB #1H, B
BC LOOP2, BNEQ
SUB #1H, A
BC LOOP1, ANEQ
RET;
The main program to display the picture after initialization is as follows:
AMIN: STM #800H, SP
CALL INIT; Call the LCD screen initialization program
STM #0C03EH, AR1; Bitmap data relative to the address of the BMP file header
STM #42H, AR0
PORTW AR0, #8100H; Send the LCD screen buffering instruction
LD # 240, A
CMP: LD #40, B
CMP1: PORTW AR1+, #8000H; write the 320×240 bitmap data to the buffer area
SUB #1, B
BC CMP1, BNEQ
SUB #1, A
BC CMP, ANEQ
B in sequence $; End of main program.

The above is the software design of the system. Due to limited space, the settings of some control instructions are omitted here, and users can add settings according to actual needs. In actual software design, the data loss caused by the delay during the execution of DSP assembly language can be solved by appropriately adding a null instruction (NOP). At the same time, the example of using picture display in this program is only used to illustrate the use of the controller, which seems a bit wasteful and has poor flexibility. For those systems with limited storage space and high efficiency requirements, font templates can be made and stored in external ROM for multiple calls.

When displaying text, you only need to calculate the display address and then call the font entry address.

The basic DSP-controlled LCD screen proposed in this article has been successfully used in practical applications as an oscilloscope display front-end. The SED1335 controller with a 64K large-capacity buffer area is selected in this system, which is suitable for display screens with various dot matrix specifications. In addition, its internal solidified character generator can produce 160 kinds of fonts, and it can be realized by changing the command parameters. The characteristics of image flickering, flipping, moving, etc., make it much stronger than other controllers of the same type in terms of overall performance, and is very suitable for the design of display front-ends for various portable systems.
Reference address:Design and implementation of a liquid crystal display based on DSP control

Previous article:Interface design between ADSP2181 and LCD module SMC1602B
Next article:Design of intelligent lighting controller based on LPC2104

Recommended ReadingLatest update time:2024-11-17 05:39

CECEN will showcase its diverse embedded computing solutions at Embedded World 2022
June 15, 2022 - Rugged embedded computer brand – Cincoze, will make a grand debut at Embedded World 2022 in Germany from June 21 to June 23, 2022, with the theme of "All-round edge computing solutions for smart manufacturing". Three exhibition areas are planned on site, "Rugged Embedded Fanless Computers" edge comp
[Embedded]
CECEN will showcase its diverse embedded computing solutions at Embedded World 2022
Design of battery status detection and control software based on Qt/Embedded
1 Introduction The state parameter detection in the battery production process is the key to ensure the quality of the battery. However, at present, the state detection of domestic batteries mainly relies on instruments such as battery voltage patrol meter, battery conductivity tester and internal resistan
[Automotive Electronics]
Design of battery status detection and control software based on Qt/Embedded
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号