Design of LED Display Control System Based on
AT89C52 Single Chip Microcomputer
Institute of Machinery, on 5 February 2004
Maurice Wilkes
ABSTRACT :THIS paper introduces display design process about hardware and software
based on AT89C52 single chip microcomputer. We use a simple external circuit to control the display screen,which size is 32 × 192. The display screen also can display the size of the six 32 × 32 dot matrix Chinese characters by a dynamic scan mode, and can be divided into two small display screens, which can display twenty-four Chinese characters whose size is 16×16. We can modify the code to change the content of the display, subtitles can achieve scrolling function and the scroll speed can be adjusted according to requirements, subtitles can also achieve pause function. The Chinese character code stored in external data memory, the capacity of data memory is expanded according to the requirements of Chinese characters we want to show. This display screen has advantages of small volume, few hardware and simple circuit structure. KEY WORDS: LED, Chinese Character Display, AT89C52
I. INTRODUCTION
LED display has become an important symbol of the city lighting, modernization and informationsociety with continuous improvement and beautification of people’s living environment. LED lights can be seen in the large shopping malls, railway station, docks, underground station, and a variety of management window and so on. LED business has become a fast-growing new industry, a huge market space and bright prospects. The text, pictures, animation and video are displayed by LED’s light, and content can be changed. Some components are the display devices of the modular structure, and which usually consists of a display module, control system and power system. The display module is constituted by the lattice structure which consists of LED, and is responsible for light-emitting display; the screen can display text, pictures, video and so on by control system which can control light or dark of LED in the corresponding region; Power system is responsible for transforming input voltage an d current into voltage and current which the screen needs. LED dot matrix display extracted display character font through PC, and sent to the microcontroller, then displayed in the dot matrix screen, which mainly used for display of indoor and outdoor characters. LED dot matrix display can be divided into graphic display, image display and video display by displayed content. Compared with the image display,the characteristics of graphic display is no difference in gray color whether it is monochrome or color display. Therefore, graphic display also fails to reflect the richness of color, and video display can not only show exercise, clear and full-color images but also show television and computer signals. Although there are some differences between the three, but the most basic principles are similar.
II. System Overall Structure Design
Single Chip Microcomputer (SCM) models were selected according to the target, function,
reliability, cost, accuracy and speed of the control system. According to the actual situation of the subject, the choice of SCM models mainly considered from the following two aspects: First, SCM has strong anti-interference ability; Second, SCM has a higher cost-effective. Due to MCS-51 is widely used in China, has more information and can compatible with the more peripheral chips too, in particular, ATMEL Corporation, introduced a new generation microcontroller in 2003, that is 89S series, and its typical products with high performance and low cost microcontroller is AT89C52. AT89C52 is a low voltage, high-performance CMOS 8-bit microcontroller, the chip includes 8 KB read-only program memory (PEROM) which erase can be repeated, 256byte random access data memory (RAM), devices adopt high-density nonvolatile memory technology to produce, compatible with the standard MCS-51 instruction set and the 8052 products, while the chip built-in general-purpose 8-bit central processing (CPU). Flash storage unit, can be applied to the more complex control applications.
The system was realized by the circuitry which is made up of AT89C52 chip, Clock circuit, reset circuit, column scan driver circuit, line drive circuit and the six 32× 32 LED dot matrix, the overall structure of LED characters display is shown in Fig.1. A display unit is composed of dot matrix and two 74HC154. Line data signal is divided into two parts, which is given by the two 8255A respectively, but the 8255A data are from the P0 port the master controller AT89C52. The column scanning signal of each character was given by the two 74HC154, the 74HC154 12 pieces and was divided into six groups. The input signal of 74HC154 was given by the P1.0 ~P1.3 of AT89C52. External data memory 6264 connected with the AT89C52 the P0 port.
III. SYSTEM HARDWARE CIRCUIT DESIGN
A .Circuit Design of MCU Control System
The size of Chinese characters is 32 × 32, but microcontroller has 32 I/O port, and can’t meet design requirements, so the I/O port must expand, the data port expansion was implemented by two 8255A. The data port expansion is shown in Fig.2, 74HC373 is the address latch, and latch low eight address, the low eight address signals of 6264 provided by it, but the high eight address signals of 6264 provided by P2.0 ~P2.4, Internal port of 8255A was chosen by A0 and A1. 74HC139 is 2-4 decoder, whose input signals are provided by P2.6 and P2.7 of SCM, and provided strobe for the external I / O devices, because the system has more than one external device, make sure that they can not be gated, so that their addresses is the only and do not repeat. The clock circuit of AT89C52 composed of 18, 19feet from the clock side (XTALI and XTAL2), and 12MHz crystal, capacitor C1 and C2.
B .The Circuit Design of Display Memory Unit
The size of Chinese characters is 32×32 in the design, each character composed of four parts which each part composed of four LED matrix which the size is 8 × 8, circuit decomposition map of display unit. In addition because the Chinese character for each display needs 128 bytes storage space, but AT89C52 microcontroller chip is only 256 bytes data memory, it is far less than the design requirements, so we the expanded storage space by 8K × 8 external data memory 6264.
C. The communicate Design of Pc
Inte1 8255A is a universal programmable parallel input/output interface chip. Its function can be set through the software program, and has a strong versatility. It can be directly through the CPU data bus connected to external devices, easy to use and flexible. Inte18255A interface chip has three 8-bit parallel input and output ports, programming methods can be used to set three ports as
input ports or output ports. Chips work have the basic input and output, strobe input/output and bi-directional input / output. When the data were transmitted by data bus of CPU, its can choose to unconditionally transfer, query transmission or interrupt transmission. During Inte18255A chip three-port, the port C can be used as not only the data port, but also the control port. When the port C is taken as a data port, it can be used as not only 8-bit data port, but also separately as two 4-bit data port, and each bit of the port C can be operated, can set a particular bit to input or output, so provide convenient conditions for bits control.
D. Serial Communication Interface Circuit
PC and SCM are linked via a serial communication interface. In order to implement serial communication function between MCU and PC, and serial interface level of SCM will be changed into standard RS-232C level. MCU and PC, taking into account the short distance communication, and microcontroller is mainly responsible for receiving commands and data, so the PC is directly connected with the microcontroller, this is the simplest connection method. the signals which is from Pac’s TXD-side were changed into a current signal through the communication circuit, the infrared light emitting diodes of optocouper have current when a signal occurs, the light signals which is emitted by diode projected onto the and photo transistor, converted to electric signal, then input to the microcontroller RXD side so photoelectric conversion is implemented, and electrical is completely isolated to avoid the feedback and interference which is produced by output side.
IV. SOFTWARE DESIGN
The entire software design mainly composes of display program and communication program. The Chinese characters to be displayed on the screen, character and other data for transmission control and display functions were achieved by dynamic scan. Real time communication parts which communicate with PC receive data information by SCM serial disruption, so real-time data information transmission with PC was implemented. The host computer software was implemented by Visual Basic. In the standard serial communication, MSCOMM which is the power communication control is provided by VB, it can set the serial communication of data sent and received, and the serial communication port.
Status, message formats and protocols are set, directly send data by Pac’s RS-232/RS-485 serial ports. In order to realized to PC reliable communication with SCM, and ensure that both sides have the same data format and baud rate, this design uses RS-232 communications, a 10 bits data format, 9600bit / s baud rate. Software program composed of the beginning, initialization, display program, front, which the main.
Character code stored in the static memory 6264, and the SCM will wait for signal is given, that is, the input signal of SCM pin P3.0. When P3.0 is from low to high, display program begin to be run. First, control words written to 8255A control port, 8255A work in the form of mode 0 in the design. After control word was finished, the data will be displayed which is transferred to the 8255A from the 6264, the display data is output for four times because the line width of the characters screen is 32, a row of data is input and transported from top to bottom each, signal of the first rows which is controlled by SCM is gated after data transmission is over, so the first column data is displayed, then call delay procedures to display the contents of the stable. The next column of data is read after delay procedures is over, and the next row is gated, so that the second column of data is also displayed, and so on, because the serene size is 32 × 192, 192 row are shown, and 192 rows constitute an image. Then, scanning begin from the first column, and the
starting address of display date backward shift on the basis of the original, which has an address overflow issues, it will assign start address to the address pointer when the data address is overflow, the display data content will be constantly repeated. Flow chart of communication with PC and 4 SCM is shown in Figure 10. Real-time communication parts which communicate with PC receive data information by SCM serial disruption, so real-time data information transmission with PC was implemented.
CONCLUSION
LED display system that was designed adopted the host computer and slave structure, the host computer is PC, and communicated with slave computer display system through the serial communication interface, which can implement string modification, display mode settings, time setting and other functions; The slave mainly implement display of LED dot matrix display screen. This was controlled by SCM. Chinese character display is 32×32 dot matrix model, and to achieve real-time screen display changes, and have to display the current time and date functions. The design of LED dot matrix display control system has a simple circuit, stability, low power consumption, long life, easy to display characteristics, and include the LED display basic principles and procedures. As long as the microcontroller I/O interface is expanded, and increase the number of LED dot matrix and related chips, you can design a larger are and more tricks of the LED display. This article has some reference value of theory and practice. As the core control unit of the system, that it AT89C52, has lower frequency, in the future, in order to achieve LED video display in real time, and the display image can be compressed, which will increase the burden on the system. We can take advantage of high-speed DSP as the core control unit, and solve the above mentioned problems.

