Implementation of dynamic display and remote monitoring on LED display screen

Publisher:创新脑细胞Latest update time:2009-11-15 Source: 单片机信息网 Keywords:LED Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

LED dot matrix electronic display is a large display system that integrates microelectronics technology, computer technology, and information processing technology. It has become an ideal choice for many display media and outdoor operation displays due to its bright colors, wide dynamic range, high brightness, long life, stable and reliable operation, etc. It can also be widely used in many industries such as military, stations, hotels, sports, news, finance, securities, advertising, and transportation.

At present, most LED dot matrix display systems have built-in fonts. The realization of its display and dynamic effects (mainly the scrolling of display content) mainly relies on hardware scanning drivers. Although this method is relatively convenient, the display can only be carried out according to the pre-designed design. In fact, some special requirements for dynamic display are often encountered, such as the up and down movement of the indicator arrow during elevator operation, the bar display of the amplitude of some intelligent instruments, and the display of the manufacturer's trademark in advertisements. At this time, it is difficult for general display systems to meet the requirements.

In addition, due to the limitations of the memory itself, special characters or patterns are often difficult to display, and the display content cannot be changed at will. This article proposes a communication method for an LED display system controlled by a PC and a single-chip microcomputer. This method can control the display content (including Chinese characters and special icons) in real time, thereby achieving a variety of dynamic display effects such as flashing, scrolling, and typing. This method can also adjust the speed of dynamic display, and users can also preview the display effect on the PC, and the display content can also be modified in real time. In addition, remote control of the display system can be achieved through a standard RS232/485 conversion module.

2. System hardware design

The main hardware design of this system is the display control part of the lower-level microcontroller. The interface between the upper-level computer (PC) and the display control part of the microcontroller is a standard RS232 communication method. If remote monitoring is required, only the RS232/485 conversion module needs to be added. This part has a mature circuit design, so it will not be described in detail.

The specific LED display screen control circuit is shown in Figure 1. The entire circuit consists of a single-chip microcomputer 89C52, a dot matrix data memory 6264, a column drive circuit ULN2803, a row drive circuit TIP122, a shift register 4094 and auxiliary circuits. The electronic screen designed by this circuit can display 10 Chinese characters, requiring 40 8×8 LED dot matrix modules to form a 16×160 rectangular dot matrix. Since AT89C52 has only 8k storage space and the displayed content is controlled by a PC, it is impossible to make the content to be displayed into a dot matrix in advance in the single-chip microcomputer, and the PC can only transmit the dot matrix data to be displayed to the single-chip microcomputer in real time and store it in the buffer 6264.

The display of this circuit adopts progressive scanning. When working, the single chip microcomputer takes out the 20 bytes of dot matrix data to be displayed in the first row from the buffer, and then serially inputs them into the column shift register bit by bit through the column dot matrix data input terminal P1.2. The order of data input is opposite to the order of display content. Then set the row dot matrix selection terminal P1.3 to 1, that is, set the D of the row shift register to a high level, and enable STR (all 4094 OE pins are connected to +5V level), so that the data in the column shift register are output in parallel at the same time to select the row. After a delay period, the next row of dot matrix data is displayed. It should be noted that only one row of data can be selected at a time, that is, the display of Chinese characters or characters must be realized through continuous progressive scanning.

3. Display and control design

In the PC-controlled multi-MCU display system designed by the author, the main functions implemented by the PC include the selection of the MCU display subsystem, the display mode selection (including static, flashing, scrolling, typing, etc.), the scrolling direction selection (including up and down scrolling and left and right scrolling), dynamic display speed adjustment (i.e. text flashing frequency, scrolling speed, typing display speed, etc.), display content input and display preview, etc. The MCU generally receives the display finger sent by the PC through RS232/485 serial and uses the timer interrupt method to perform line scanning. Each interrupt displays a line, and the timer interrupt time is 1.25ms. In this way, the refresh rate of the entire screen is 50Hz, so there is no flickering.

The method to achieve dynamic display speed adjustment is usually to change the interrupt time of the timer, but when the display speed is very slow, this method is easy to reduce the refresh rate of the entire screen, so that the display content flickers. Therefore, this design adopts a "soft timing" method, that is, a variable is named as a "soft timer" in the program 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. To ensure normal display, the setting value of the "soft timer" must be greater than the entire screen display cycle. Since the display screen displays 1.25ms per line and the entire screen display cycle is 20ms, considering the margin, the setting value of the soft timer can be set to greater than 30ms. In this way, the cycle count can be repeated to achieve dynamic display. The setting value of the "soft timer" can be changed through the host PC, which can not only achieve the speed adjustment of the LED dynamic display, but also keep the display content smooth and flicker-free.

[page]

3.1 Single chip microcomputer dynamic display control

The four display modes mentioned above, namely static, flashing, scrolling and typing, are actually different ways of performing line scanning processing by the microcontroller timer interrupt program. The following will explain how to implement these four display modes respectively.

For static display, you only need to call in a corresponding row of display data from the display buffer in the timer interrupt handler, and then select the row to display it. Repeat this cycle to display the entire content. Flashing display is similar, except that it requires a "soft timer" timing interval. When scanning the row, the D end of the row shift register is all 0, which can make the entire screen invisible, ensuring that the black screen time is equal to the display time, thereby realizing the flashing display of Chinese characters or icons.

Scrolling display requires that the content to be displayed is moved one column in the specified direction (from right to left in this example) at regular intervals, so that the display can display more content. To this end, the content of the display buffer needs to be changed before the next movement display, so as to complete the shift operation of the corresponding dot matrix data. The specific operation method is:

Set up a display buffer (as shown in Figure 2), which should include two parts: one part is used to save the dot matrix data of the 10 Chinese characters currently displayed on the LED display screen; the other part is the dot matrix data pre-loading area, which is used to save the dot matrix data of the 1 Chinese character that is about to enter the LED display screen. The scroll pointer always points to the rightmost origin of the display screen. When the scroll pointer moves to the first address of the first Chinese character in the dot matrix data storage area to be displayed, the LED display area of ​​the display buffer is blank, and the pre-loading area has saved the dot matrix data of the first Chinese character to be displayed. When scrolling display is required, the corresponding row dot matrix data of the display buffer can be shifted left by one position in each row scan interrupt handler of the next scan cycle, and the content of the display buffer is changed at the same time. (It should be noted that it is necessary to ensure that this operation can be completed within the interrupt time of 1.25ms. Here, 89C52 uses a 22MHz crystal oscillator, and experiments have proved that this operation can be achieved). In this way, after a scan cycle, the entire Chinese character will be shifted left by one column, and the content of the display buffer will also be changed at the same time. Since the preload area stores one Chinese character dot matrix data, i.e. 16×16 dot matrix, the content of the current display buffer can only be moved by 16 columns. When the next scroll comes, the scroll pointer will move to the first address of the next Chinese character in the dot matrix data storage area, and store the dot matrix data of the Chinese character in the preload area. Then repeat the above operation to realize scrolling display. The display of special characters or graphics is similar to this, so I will not repeat it here.

Typing display requires Chinese characters to appear one by one on the display screen from left to right, just like the effect of typing. The following method can be used in design: first, clear the display buffer corresponding to the LED display screen, that is, the LED display is blank, and then add a Chinese character dot matrix data to the display buffer in turn and scan and display it every time the dynamic display time set by the "soft timer" is exceeded, so that the effect of typing display can be achieved.

3.2 PC control program

a. Realization of communication function

In Windows environment, the communication between PC and MCU can be realized by using Windows communication API function or VC++ (or other languages) standard communication function _inp, _outp. However, the above two methods are cumbersome, and it is very convenient to use ActiveX control MSComm32. This control simplifies the programming of serial port operation by event, and can set the data sending and receiving of serial communication, as well as the serial port status and the information format and protocol of serial communication. Its initialization program is as follows:


[page]

In general, PC needs to communicate with multiple MCU 89C51 systems in a master-slave manner. In order to distinguish the MCU systems, 89C51 can use serial port working mode 3, that is, 11-bit asynchronous receiving/transmitting mode. The valid data of this mode is 9 bits, of which the 9th bit is the flag bit of address/data information, which enables the slave to judge whether the data sent is an address, thereby realizing multi-machine operation. However, now the MSCOMM control is used to realize the communication between PC and MCU, which is a standard 10-bit serial port communication mode, that is, 8-bit standard data bits and 1 bit each for the start bit and stop bit of the data. Therefore, the formats of the two do not match, so it is difficult to use the above solution. Therefore, it can be considered to set the MCU serial port to working mode 1, that is, to change to 10-bit asynchronous receiving/transmitting mode to solve the problem. The communication process is as follows:

First, the communication start flag is sent, followed by the address of the microcontroller system to be operated, and then the display work command word is sent. The command includes 2 bytes, the first byte is used to set the display mode and scroll direction, and the second byte is used to set the display speed. Next is the dot matrix data of the display content, and finally the data is verified. This communication protocol is very simple and can solve the above problems well, thereby realizing the master-slave communication between the PC and multiple microcontrollers and the control of the display.

It should be noted that when the display content needs to be changed, in order to avoid garbled characters on the display screen when the microcontroller serial interrupt receives data, the display screen should be temporarily undisplayed (in a "black screen" state) until the data is fully received and the serial interrupt processing is completed.

The extraction of Chinese character fonts is very critical. The font data in this article is taken from the font file HZK16 under UCDOS. There are many introductions to this aspect. Reference [2] gives a more specific solution for extracting Chinese character fonts under VC, which will not be repeated here. For the extraction of special characters or graphic dot matrix data, a simple method is to first make a BMP file and then use some model extraction software (such as font extraction v2.1) to obtain it. For the convenience of display, the format of the dot matrix data should be n×(16×8), and if it is less than the requirement, it should be supplemented with 0 data.

b. Dynamic effect simulation display.

In order to facilitate the adjustment of the LED display effect, the author designed a simulated display of the LED display on the control interface of the PC, which is exactly the same as the actual display effect. The user can set the display mode and adjust the display speed, and then preview the display effect on the interface. At the same time, the parameters can be modified and set at any time, which is very convenient and simple.

To this end, a virtual LED display screen can be drawn on the interface first. Since the actual display screen is a 160×16 dot matrix, the same area must be set on the interface.

The methods for achieving dynamic display effects are similar to the above methods. Here we take scrolling display as an example. For text that needs to be scrolled, you can set it to a bitmap format, temporarily store it in memory, and then use the bitmap copy function BitBlt provided by VC to copy the bitmap to the display position. For special characters or graphics, you can directly use the BitBlt function to call the display position. Then call this function in the OnTimer function of the CLEDDlg class to achieve scrolling display of text. In addition, you can also change the scrolling speed of the text by setting different response time intervals.

4. Conclusion

The solution proposed in this paper to realize dynamic display and control of LED dot matrix display screen has been successfully applied to the actual system. If the system is connected to the computer network, the remote control of the display screen can also be realized.

Keywords:LED Reference address:Implementation of dynamic display and remote monitoring on LED display screen

Previous article:The existing public security video surveillance system has three major flaws
Next article:On the application and technical realization of civil network cameras

Recommended ReadingLatest update time:2024-11-16 22:49

BOE stops LCD production line and will focus on OLED and mini LED in the future
According to foreign media reports, semiconductor display technology company BOE announced that it will stop investing in LCD production capacity and turn to OLED and Mini LED. In the past two years, BOE has surpassed LG Display to become the world's largest LCD panel manufacturer.  In mid-November this year, foreig
[Embedded]
BOE stops LCD production line and will focus on OLED and mini LED in the future
LED drive mode selection and design
  The arrangement of LEDs and the specifications of LED light sources determine the basic driver requirements. The main function of an LED driver is to limit the current flowing through the LED under a certain range of operating conditions, regardless of how the input and output voltages change. The basic operating ci
[Power Management]
LED drive mode selection and design
Large-size LED backlight applications are accelerating, and chip manufacturers are responding with multiple solutions
2010 is an important year for the development of large-size LED backlights. The advantages of LED backlights, such as ultra-thinness, energy conservation and environmental protection, and high color quality, have become a strong driving force for the development of backlights. According to the forecast data of res
[Home Electronics]
Large-size LED backlight applications are accelerating, and chip manufacturers are responding with multiple solutions
Using buck structure to realize LED driving
The buck-based structure can be well matched with many loop control structures without considering the stability limitation. Hysteresis control is suitable for applications where the switching frequency changes quickly and the input range is small. This characteristic just meets the requirements of LED for power sup
[Power Management]
Using buck structure to realize LED driving
Yuchuang Semiconductor received tens of millions of yuan in A+ round financing and has laid out plans in the fields of Micro-LED and GaN
Recently, Yuchuang Semiconductor announced that it has completed a round of A+ financing of tens of millions of yuan, and the investor is Junsheng Investment. According to 36Kr, the funds from this round of financing will be mainly used for new product development and team expansion. Previously, the company also rec
[Mobile phone portable]
LED Driver Design for High Power LED Bulb Replacement Applications
This article introduces an LED driver reference design for high-power LED bulb replacement applications. This driver can provide the required power for LED replacement lamps for 100W A19 incandescent bulbs. It is a non-isolated, high-efficiency (about 93%), high power factor (PF) LED driver that fits neatly into the A
[Analog Electronics]
LED Driver Design for High Power LED Bulb Replacement Applications
Candela, the basic unit of LED luminous intensity
The basic unit of luminous intensity - Candela The basic unit of luminous intensity, Candela, is one of the basic units of the International System of Units. This article describes its definition and its historical evolution in detail, and briefly introduces the reproduction principle, method and e
[Power Management]
LED lighting design analysis
To design a product, we must first determine whose LED package structure to use; then consider how to adapt to these packages; We have few opportunities to choose, and the optical structure is built on these packages; many of our ideas cannot be fully utilized. 1. Problems in semiconductor lighting applications
[Power Management]
Latest Security Electronics 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号