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.
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
- Popular Resources
- Popular amplifiers
- Mir T527 series core board, high-performance vehicle video surveillance, departmental standard all-in-one solution
- Akamai Expands Control Over Media Platforms with New Video Workflow Capabilities
- Tsinghua Unigroup launches the world's first open architecture security chip E450R, which has obtained the National Security Level 2 Certification
- Pickering exhibits a variety of modular signal switches and simulation solutions at the Defense Electronics Show
- Parker Hannifin Launches Service Master COMPACT Measuring Device for Field Monitoring and Diagnostics
- Connection and distance: A new trend in security cameras - Wi-Fi HaLow brings longer transmission distance and lower power consumption
- Smartway made a strong appearance at the 2023 CPSE Expo with a number of blockbuster products
- Dual-wheel drive, Intellifusion launches 12TOPS edge vision SoC
- Toyota receives Japanese administrative guidance due to information leakage case involving 2.41 million pieces of user data
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Qinheng Trial] Experience of CH549 capacitive touch function
- Raspberry Pi PICO low-resolution thermal imager
- Why does the power consumption of stm32L0 increase after it enters STOP mode again after being woken up by an external interrupt in STOP mode?
- [TI millimeter wave radar evaluation]_4_boost board evaluation encountered problems 2
- Using registers to do STM8 UART1 error request help
- BearPi-HM Nano Development Board Review 0 Unboxing and Development Environment Setup
- Let's discuss how many people you think should be invited.
- Qinheng CH37X series interface chip application reference example
- I found another DK IOT STUDIO online IDE that runs RAPID IOT. I guess they are the same but distributed on different websites.
- ECG-based heart rate monitoring using the LaunchPad Value Line development kit for the MSP430G2452 microcontroller