1. Introduction Security Network LED dot matrix electronic display is a large display system integrating microelectronic technology, computer technology and information processing technology. It is an ideal choice for many display media and outdoor work displays due to its bright colors, wide dynamic range, high brightness, long life and stable operation. It can also be widely used in many industries such as military, station, hotel, sports, news, finance, securities, advertising and transportation.
At present, most LED dot matrix display systems have their own fonts. The implementation of its display and dynamic effects (mainly the scrolling of the display content) mainly relies on the hardware scan driver. Although this method is convenient, the display can only be performed according to the pre-design. In fact, it often encounters some dynamic display of special requirements, such as the up and down movement of the indicator arrow in the elevator running, the bar display of the amplitude of some smart meters, and the trademark display of the manufacturer in the advertisement. At this time, the general display system is difficult to meet the requirements.
In addition, due to the limitations of the memory itself, its special characters or patterns are often difficult to display, and the display content cannot be changed at will. This paper proposes a communication method of LED display system controlled by PC and single chip microcomputer. The method can control the display content (including Chinese characters and special icons) in real time, thereby realizing various dynamic display effects such as flashing, scrolling, and typing. The method can also adjust the speed of the dynamic display, and the user can also preview the display effect on the PC, and the display content can be modified in real time. In addition, remote control of the display system is also possible via the standard RS232/485 conversion module.
2, system hardware design The main hardware design of this system is the display control part of the lower computer. The interface between the host computer (PC) and the display control part of the MCU is the standard RS232 communication mode. If you need to achieve remote monitoring, you only need to add RS232/485 conversion module. This part has mature circuit design, so it will not be described in detail.
The specific LED display control circuit is shown in Figure 1. The whole circuit is composed of a single chip microcomputer 89C52, a dot matrix data memory 6264, a column driving circuit ULN2803, a row driving circuit TIP122, a shift register 4094, and an auxiliary circuit. The electronic screen designed by this circuit can display 10 Chinese characters, and requires 40 88LED dot matrix modules to form a rectangular lattice of 16160. Since the AT89C52 has only 8k storage space, and the displayed content is controlled by the PC, it is impossible to pre-set the content to be displayed in the single-chip microcomputer, and the dot matrix data to be displayed can be instantly displayed by the PC. It is passed to the microcontroller and stored in the buffer 6264.
[img]/uploadpic/news/2012052110483912.jpg.png>
The display of this circuit uses progressive scanning. When working, the MCU takes out the 20-byte dot matrix data that needs to be displayed in the first line from the buffer, and then serially inputs the data into the column shift register by the column data input terminal P1.2. The order is the reverse of the order in which the content is displayed. Then set the dot strobe P1.3 to 1, that is, the D of the shift register is high, and the STR is enabled (all 409 pins of the 4094 are connected to +5V level), thereby making the column shift register The data is simultaneously output in parallel to gate the line. After a delay, the display of the next row of dot matrix data is performed. It should be noted that only one line of data can be strobed at a time, that is, the display of Chinese characters or characters is realized by continuous progressive scanning.
3, display and control design In the PC control multi-microcontroller display system designed by the author, the main functions realized by PC include the selection of single-chip display subsystem, display mode selection (including static, flashing, scrolling, typing, etc.) , scroll direction selection (including up and down scrolling and left and right scrolling), dynamic display speed adjustment (ie text flashing frequency, scrolling speed, typing display speed, etc.), display content input and display preview. The MCU generally uses the RS232/485 serial receiving PC to display the display. The timer interrupt mode is used for line scanning. Each time the interrupt is displayed, the timing interrupt time is 1.25ms, so the refresh rate of the whole screen is 50Hz, so there is no flicker. sense.
The method of realizing the dynamic display speed adjustment is usually to change the interrupt time of the timer, but when the display speed is very slow, the method tends to lower the refresh rate of the entire screen, thereby causing the display content to flicker. Therefore, this design uses a soft timing method, in which a variable is named in the program as a soft timer to set the time interval between two dynamic displays. When counting the timer interrupt call, if the number of calls reaches the set value, the display content is changed. In order to ensure normal display, the set value of the soft timer must be greater than the full screen display period. Since the display shows 1.25ms per line and the display period of the whole screen is 20ms, the setting of the soft timer can be set to be greater than 30ms in consideration of the margin. This cycle counts to achieve dynamic display. The setting value of the soft timer can be changed by the PC of the host computer, which can realize the speed adjustment of the dynamic display of the LED, and maintain the smooth and flicker-free display content.
3.1 MCU dynamic display control The above-mentioned four display modes of static, flashing, scrolling and typing are actually different methods for the line scan processing of the MCU timer interrupt program. The following will explain how to implement these four display modes.
The static display only needs to transfer the corresponding line of display data from the display buffer in the timer interrupt handler, and then select the line to realize the display of the line. In this cycle, the entire content can be displayed. The flashing display is similar to this. The difference is that the timing of a soft timer is to be separated. When the line is scanned, the D-bit of the row shift register is all 0, so that the entire screen is not displayed to ensure the black screen time. It is equal to the display time, so that the flashing display of Chinese characters or icons is realized.
The scroll display requires that the content to be displayed be moved to a specified direction (here, from right to left as an example) at a certain time so that the display can display more content. To do this, it is necessary to change the content of the display buffer before moving the display next time, thereby completing the shift operation of the corresponding dot data. The specific method of operation is:
[img]/uploadpic/news/2012052110483913.jpg.png>
Set a display buffer (as shown in Figure 2), this area should include two parts: one part is used to save the 10 Chinese character dot matrix data displayed on the current LED display; the other part is the dot matrix data preloading area, To save the dot matrix data of a Chinese character that is about to enter the LED display. The scroll pointer always points to the rightmost origin of the display. When the scroll pointer moves to the first address of the first Chinese character of the dot matrix data storage area to be displayed, the display buffer LED display area is blank, and the preloaded area has saved the dot matrix data of the first Chinese character to be displayed. . When scroll display is required, the corresponding row dot matrix data of the display buffer is shifted to the left by one bit in each row scan interrupt handler of the next scan cycle, and the content of the display buffer is changed. (It is important to note that this operation can be completed within 1.25ms of interrupt time. Here the 89C52 uses a 22MHz crystal, which has been shown to work.) Thus, after one scan cycle, the entire Chinese character will be shifted to the left by one column, and the contents of the display buffer will also be changed at the same time. Since the preloading area holds 1 Chinese character dot matrix data, that is, 1616 dot matrix, the content of the current display buffer can only move 16 columns. When the next scroll arrives, the scroll pointer will move to the first address of the next Chinese character in the dot matrix data storage area, and the dot matrix data of the Chinese character will be stored in the preload area. Then repeat the above operations to achieve scroll display. The display of special characters or graphics is similar, and will not be described here.
The typing display requires that the Chinese characters appear one by one in the order from left to right on the display screen, just like the effect of typing. The following methods can be used in design: firstly, the display buffer corresponding to the LED display is completely cleared, that is, the LED display is blank, and then the dynamic display time set by a soft timer is separated, and the display buffer sequentially adds a Chinese character dot matrix data. And scan display, so that the effect of typing can be achieved.
3.2 PC control program a. Communication function implementation In the Windows environment, the communication between PC and MCU can be realized by using the communication API function of Windows or using the standard communication functions _inp and _outp of VC++ (or other languages). However, the above two methods are cumbersome, and it is very convenient to implement the ActiveX control MSComm32. The control simplifies the programming of the serial port operation by means of events, and can set the data transmission and reception of serial communication, and also can set the information format and protocol of the serial port status and serial communication. Its initialization procedure is as follows:
[img]/uploadpic/news/2012052110483914.jpg.jpg[/img]
Under normal circumstances, the PC should communicate with multiple MCU 89C51 systems in master-slave mode. In order to distinguish each MCU system, the 89C51 can use the serial port working mode 3, that is, the 11-bit asynchronous receiving/transmitting mode. The valid data of this mode is 9 bits. The ninth bit is a flag bit of the address/data information, and its role is to enable the slave to judge whether the transmitted data is an address, thereby implementing multi-machine operation. But now because of the MSCOMM control used to achieve communication between the PC and the microcontroller, this is a standard 10-bit serial communication method, that is, 8-bit standard data bits and 1 bit of the start and stop bits of the data. . Therefore, the format of the two does not match, so it is difficult to use the above scheme. Therefore, it can be considered to set the serial port of the single chip to work mode 1, that is, to change to the 10-bit asynchronous receiving/sending mode. The communication flow is as follows: first send the communication start flag, then send the address of the single-chip system to be operated, and then send the display work command. Word, the command consists of 2 bytes, the first byte is used to set the display mode and scroll direction, and the last byte is used to set the display speed. Further down is the dot matrix data that conveys the display content, and finally the data is verified. The communication protocol is very simple, and can better solve the above problems, thereby realizing master-slave communication and display control between the PC and the multi-chip microcomputer.
It should be noted that when the display content needs to be changed, in order to avoid garbled characters on the display when the serial interrupt is received by the MCU, the display should not be displayed temporarily (in the black screen state) until the data reception is complete, serial interrupt processing Display again at the end.
The extraction of Chinese character fonts is very important. The font data in this paper is taken from the font file HZK16 under UCDOS. There are many introductions in this respect. The literature [2] gives a more specific scheme for extracting Chinese character fonts under VC, which will not be described here. For the extraction of special characters or graphic dot matrix data, a simple method can be done first to make a BMP file, and then use some modulo software (such as font extraction v2.1) to obtain. For the convenience of display, the format of the dot matrix data should be n (168), and if it is insufficient, it should be supplemented with 0 data.
b. Dynamic effect simulation display.
In order to adjust the display effect of the LED, the author designed the analog display of the LED display on the control interface of the PC, which is exactly the same as the actual display. The user can set the display mode and adjust the display speed, then preview the display effect on the interface, and also modify and set the parameters at any time, which is very convenient and simple.
To do this, you can first draw a virtual LED display on the interface. Since the actual display is 16016 dot matrix, the same area must be set on the interface.
The method of realizing the dynamic display effect is basically similar to the above, and the scroll display is taken as an example here. For text that needs to be scrolled, you can set it to bitmap format, temporarily store it in memory, and then copy the bitmap to the display position using the bitmap copy function BitBlt provided by VC. For special characters or graphics, you can directly use the BitBlt function to call to the display position. This function is then called in the OnTimer function of class CLEDDlg to implement scrolling of the text. In addition, you can change the scrolling speed of the text by setting different response time intervals.
4. Conclusion The solution proposed in this paper to realize the dynamic display and control of LED dot matrix display has been successfully applied to practical systems. Remote control of the display can also be achieved by linking the system to a computer network.
Aluminum die castings box,aluminum enclosure box,aluminum enclosure,aluminum enclosure waterproof
wybox inc. , https://www.wybox.com