Taking the graphic dot matrix liquid crystal module TM320240E used by the author in an instrument design as an example, the interface design scheme of 320×240 graphic dot matrix liquid crystal and 51 single chip microcomputer is introduced. one. Introduction to TM320240E and its driver chip It is a monochrome graphic dot matrix liquid crystal display module introduced by Tianma Company. It can display 320×240 dot matrix graphics, and can also display 20×15 Chinese characters (16×16 dot matrix). The driver chip is SED1335 . SED1335 is a liquid crystal display controller produced by EPSON Corporation of Japan. It has strong functions in similar products: I/O buffer with strong functions; rich command functions; four-bit data transmission in parallel; mixed display of graphics and text. The application of SED1335 is very extensive. Most of the current 320×240 graphic dot matrix liquid crystal modules on the market use this driver chip. two. SED1335 instruction set There are 13 instructions, most of which have parameters, as shown in Table 1. The parameter values ​​are set by the user according to the characteristics of the liquid crystal display module being controlled and the needs of the display. After receiving the instructions and data from the MPU system, corresponding timing and data are generated to control the display of the liquid crystal module. Except for SLEEP IN, CSRDIR, CSRR, and MREAD, the execution of any instruction occurs after the completion of the dependent parameter input. The MPU can write a new instruction code to end the writing of the previous instruction parameter. The MPU can effectively combine the new parameters with the remaining old parameters into new parameters, but the order of the written parameters cannot be changed or omitted. three. Hardware interface circuit The hardware interface circuit with 51 single chip microcomputer is shown as in Fig. 1. SEL1 (18-pin) is the microprocessor interface selection terminal. When connected to the high level, it is the MC68000 microcontroller interface timing. The low level is the 51 series MCU interface timing; A0 (4 pins) is the command/data selection end, and 1 is the command. 0 is the data; V0 (3 feet) is the contrast voltage input. In this system, in order to prevent other components in the system from causing damage to the LCD caused by large voltage pulses on the bus, an 8-bit bidirectional bus driver chip 74ALS245 is used to isolate the LCD data bus from the system bus, which can be to some extent Protect the LCD module. In addition, regarding the generation of liquid crystal contrast adjustment voltage, the TM320240E module has its own negative voltage output (VEE, 17-pin), but some 320240 modules do not have this voltage. In this case, the circuit shown in Figure 2 can be used to generate a negative using a MAX749. Pressure, this circuit has been applied in the previous design of the author, and the effect is better. Negative voltage generating circuit four. Interface programming The interface program design with 51 MCU is very simple and convenient. After the hardware system is powered on, the MCU sets the parameters of each command according to the parameters of the liquid crystal module (such as the number of rows of liquid crystals, the number of columns, the scanning frequency, etc.) and the required display mode, etc., to initialize the system, and then the microcontroller can The data is sent directly to the display buffer of the SED1335, and the SED1335 can control the LCD display. If you need to change the displayed graphic or text later, just change the parameters of the corresponding instruction according to the instructions in Table 1, and then re-enter the data. The method of setting system command parameters or sending data to the display buffer is: first send the instruction code to the command port address of SED1335, and then send the parameter of the instruction to the data port address to send the data to the data port address. 3 Pin Automotive Connector Housing Wenzhou Langrun Electric Co.,Ltd , https://www.langrunele.com
Figure 1 Hardware interface circuit diagram of TM320240E and 51 single chip microcomputer
Interface Programming of SED1335 and 51 Single Chip Microcomputer
In the embedded application with MCU as the core, the friendly human-computer interaction interface plays an important role. A typical display device is an LED digital tube that is high in brightness and suitable for most applications. The disadvantage is that the interface circuit is complicated and the power consumption is high. The liquid crystal display device is fabricated by utilizing the electro-optic effect of the liquid crystal, and has the advantages of low power consumption, convenient interface control, etc., and the module interface signal and operation instruction have wide compatibility, and can directly interface with the single chip, and it also has a dedicated instruction. It is convenient to implement a variety of different operations. The same display area LCD consumes hundreds of LEDs, so it is particularly suitable for direct matching with COMS circuits. With the advancement of liquid crystal display technology, high quality liquid crystal display modules have been increasingly used in various embedded systems.