Display principle of liquid crystal module based on DSP

1, the design of the hardware circuit interface

Figure 1 shows the hardware circuit interface design block diagram of the liquid crystal display module. The system uses TI's TMS320F206 chip (hereinafter referred to as F206), which has 4KB of FLASH memory inside, and can be used as an external program storage area according to the system needs external plug-in EEPROM.

The SEDl335 controller is a liquid crystal display controller manufactured by EPSON Corporation of Japan, which is the most powerful compared with similar products. The main features are:

I/O buffer with strong function;

The instruction is rich in functions;

Four bits of data are sent in parallel;

Mixed display of graphics and text.

The input end of the programmable controller chip GAL16V8 is connected to the DSP, and the output provides the required chip selection and enable signals for the hardware Chinese character library, the liquid crystal controller, and the keyboard scanning circuit. The chip programming is easy to implement, and its logic relationship can be modified at any time, which improves the versatility of development to a certain extent. The chip select signal of the hardware Chinese character library is CE=A15+PS, and the external program space start address of F206 is 08000H. Since the F206 program addressing range can reach 64KB, to address 256KB of program space, you need to expand the external program space. To this end, the 100~2 of F206 is connected with the upper three bits of the address of the hardware Chinese character library AT27C020A to achieve the purpose of extended program addressing. When displaying Chinese characters, paging management can be realized, which is divided into 8 pages, each page is 32 KB, which occupies 8000 to FFFFH of the program space of the DSP system.

To ensure that F206 and SED1335 can communicate normally, the data bus (D0~D7) of SED1335 is directly connected to the low byte data bus (D0-D7) of F206. The SED1335 chip select signal is determined by A15 (the most significant address line), A14, and IS (I/O space select signal) of F206. The logical relationship is CE=A15+A14+IS, and A0 of SED1335 is connected to A0 of F206. (lowest address line).

2. Production of hardware Chinese character library

The hardware Chinese character library uses AT27C020A, which is a 256KB FLASH ROM produced by ATMEL. Pay attention to the pin definition and logic relationship in the specific circuit design, and select the corresponding model when programming. This design uses HZK16 dot matrix file in UCDOS software, the font size is 16x16. In this file, all Chinese characters in the national standard area code are stored in order from small to large in Chinese character area code. Each Chinese character occupies 32 bytes, each The district is 94 Chinese characters. If you display its properties, you can see that its size is 262KB. When writing AT27C020A, more than 256KB can be truncated. In fact, in the Chinese character dot matrix font, the second-level Chinese characters are ranked in the 87th district, starting from the 88th district is blank, so the removal of the redundant part will not affect the production of the hardware Chinese character library in the actual operation, and the ordinary program. The programming of the memory is no different. Therefore, the font after the 87 area is cut off, and the ASCII code matrix data of 8 & TImes; 16 is added. During the programming process, the general-purpose programmer spectrum-48 is used for writing. When the HZK16 file is loaded, it must be opened in binary mode. After programming and verification is successful, the memory can be removed for use. In this way, a hardware Chinese character library is created.

For different applications, large-capacity memory or even serial data memory can be used to extend the use of hardware Chinese character libraries. Here, a memory with a capacity of 512 KB is used, in addition to storing all the national standard Chinese characters, it is also possible to store 8&TImes; 16 ASCII code dot matrix data and Chinese character sentence code data, which is very convenient to use.

3. Software design and implementation of DSP controlled liquid crystal display

The design idea of ​​the DSP control liquid crystal display is specifically explained by initializing the liquid crystal display and calling the hardware Chinese character library to display continuous Chinese characters. Considering the portability and versatility of the program, the C language is used to design and implement the software module.

The write port address of the LCD controller instruction is C001H, the write parameter and the display data port address are C000H, and the definition form is as follows:

Extern ioport uint poac000; / / data write address

Extern ioport uint poac001; / / instruction write address

#define LCDCMD poac001// instruction write port address

#define LCDDATA portc000//Write parameters and display data address

After the system hardware power-on reset, first complete the initialization of the DSP, and then set the command codes and parameters of the controller according to the needs of the user system to complete the parameters of the liquid crystal module (such as the number of rows, columns, and scans of the liquid crystal) Initialization of a series of processes such as frequency, position of the cursor, etc., and display mode. When the MPU operates the SED1335 and its controlled liquid crystal display module, the SYSTEM SET 40H instruction must be written first. If an error occurs in this command setting, the display must be abnormal. The flow chart of the liquid crystal module software initialization design is shown in Figure 2.

The F206 initialization procedure is as follows:

Asm("clrc cnf");

Asm("ldp #Oh");

Abm("setc INTM");

The procedure for setting the system command and parameters of the LCD controller is as follows:

Typedef unsigned int uint;

Uint SYSTAB[8]={0x30,0x87,0x07,0x27,0x42,0xf0,0x28,0x00); //System setting instruction parameters

Uint SCROLLTAB[10]={0,0,Oxf0,0xb0,0x04,0xf0}; //SCROLL instruction parameters

Void command(uint m)


LCDCMD=m; //Write the instruction code to 1335


Void data(uint n)


LCDDATA=n; //Write data and instruction parameters to 1335


/ / Clear the display area data

Void cleardata(uint csfi,uint csrh,uint datal)


Uint i,j;

Command(0x46); //write cursor address instruction

Data (csd); / / the lower 8 bits of the cursor address

Data(csrh); //The upper 8 bits of the cursor address

Command(0x4c); //cursor right shift instruction

Command(0x42); //Data Write Command




Data (datal); / / write data to the LCD display area



- Multiple Function Power Strip contribute you colorful and joyful experience while working or living with electronics.

 Power Strip with LED lamp, Extension Cord with Bluetooth Speakers, Electric Outlet Ultrasonic Mosquito Repellent, all our unique and patent design.

- Advanced flame-resisting materials. So it is safe and reliable with CE, ROHS and ETL certified. It brings more convenience in your life by stable circular base, you can charge your device more freely.

Multiple Power Strip

Multiple Power Strip, Multi-Outlet Power Strip, Extension Cord with Bluetooth Speakers, Multiple Function Power Strip, Electric Outlet Ultrasonic Mosquito Repellent

ZhongShan JITONGLONG Plastic Hardware Co. Ltd. , https://www.toukoo-electronics.com