This paper introduces a design scheme of a widely used LED large screen asynchronous controller . The system uses a high-performance 32-bit ARM microprocessor as its control core, and the software design is based on uc/OS-II. It can realize the display of multiple windows at any position on a single screen , making the screen display rich and flexible.
1. Introduction
In the past, LED asynchronous controllers could only display a screen as a complete area, or simply add a time area or a moving subtitle area, which often lacked sufficient flexibility for users, especially when the screen was large. In view of the above situation, this paper proposed a design based on a 32-bit high-performance ARM processor and uc/OS-II. It fully utilized the efficient multi-task management function of uc/OS-II and the powerful computing power of the ARM processor, and realized the display of multiple windows on a single screen at any position, making the display content richer and the display mode more flexible.
2. Working principle of LED control system
A typical LED asynchronous control system mainly consists of PC application software, communication module, data processing module, scanning control module, driver module and LED screen, as shown in Figure 1.
First, the PC application software converts the text or image into dot matrix information with a specific format. Then, the dot matrix information is sent to the data processing module through the communication module. The data processing module performs various special effects on the dot matrix information, and finally displays the picture correctly on the LED screen through the scanning control module and the driver module.
The LED asynchronous controller referred to in this article includes three parts: communication module, data processing module and scanning control module.
3. Design of controller software
The hardware structure of this controller is shown in Figure 2. The data processing module consists of an MCU , an SRAM and a FLASH memory. The MCU uses the PHILIPS LPC2214 processor based on the 32-bit ARM core. It has rich peripheral interface resources and powerful computing power and is the core of the entire controller. The SRAM is used as a cache for the MCU to perform special effects processing. The FLASH memory is used to store dot matrix information and some necessary parameters.
The scanning control module consists of CPLD and video memory. The video memory is a piece of SRAM, which is used to store the dot matrix information of the current display. CPLD is connected to MCU through address bus and 16-bit data bus. It writes the 16-bit data received from MCU into the video memory according to the specified address, and then reads the dot matrix information from the video memory for scanning according to a certain addressing method. MCU can only write to the video memory in words (2 bytes) through CPLD. The communication module includes Ethernet module and serial communication module, which are used to realize RS232, RS485 and industrial Ethernet communication between PC and controller.
4. Design of controller software
In order to realize the display of multiple windows at any position on a single screen, we designed the software based on uc/OS-II, which can make full use of the efficient task scheduling algorithm of the operating system and assign the display of each window to a single task, thereby greatly improving the operating speed and reliability of the system and making the development and expansion of the program more convenient.
Before carrying out specific program design, we must first determine the data organization scheme.
Because a good data organization plan can often achieve twice the result with half the effort in programming.
4.1 Video memory data organization scheme:
For a two-color screen, one pixel needs two bits of data, red and green, to describe it. For ease of processing, we store eight consecutive pixels in a word (2 bytes), one byte for red data and one byte for green data. The data is stored from left to right and from top to bottom. As shown in Figure 3, if the screen width is 160 pixels and the starting address of the video memory is 0x83000000, the first eight pixels in the first row of the screen are mapped to two bytes in the video memory at addresses 0x83000000 and 0x83000001, the first eight pixels in the second row are mapped to two bytes in the video memory at addresses 0x83000028 and 0x83000029, and so on.
4.2 Dot matrix information conversion rules:
Since the window size can be set arbitrarily, the window position can be placed arbitrarily.
Therefore, for a single window, its mapping in the video memory may not be word-aligned (2 bytes). Taking Figure 4 as an example, a window with the coordinates of the upper left corner (20, 16) and the size of 86×47 is opened on a screen with a size of 160 (width) × 96 (height). The first 4 pixels of the first row of this window are mapped in the video memory as the lower 4 bits of two bytes with addresses 0x83000282 and 0x83000283, so the mapping of this window in the video memory is not word-aligned. Since the MCU can only operate the video memory in units of words (2 bytes), when the PC software converts the dot matrix information of the window, if it directly converts and stores area 1 (the actual size of the window), there will be a lot of bit operations when the special effects are processed on the window, which will greatly reduce the operation efficiency, thereby affecting the display of special effects, so it is difficult to meet the user's requirements for special effects display effects.
In order to solve the above problem, area 1 can be expanded horizontally into area 2 with a starting point coordinate of (16, 16) and a size of 96×47. It is easy to know that the mapping of area 2 in the video memory is word-aligned. In order to avoid bit operations during calculation, when the PC software converts the dot matrix information of area 1, it can be carried out according to area 2, but the data of the extended part of area 1 needs to be filled with 1. This processing will sacrifice a small part of the FLASH memory space, but it can avoid a large number of bit operations during special effects processing, thereby greatly improving the calculation efficiency, so it is worth doing so.
4.3 Organization of cached data:
Since the MCU can only write to the video memory, and when performing special effects, the previous frame information is often required to obtain the next frame information. Therefore, first, a region with the same size as the video memory and one-to-one address correspondence needs to be allocated in the cache to save the previous frame information of the entire screen.
Since the MCU can only perform word operations on the video memory, and there may be overlapped areas between multiple windows, if the special effects operations of each window are directly performed on the screen area, the information of the overlapping parts of the windows may be confused. Therefore, as shown in Figure 5, it is also necessary to allocate a memory space (area 1, area 2, ..., area n) for each window in the cache to save the previous frame information displayed in this window. In this way, when performing special effects operations, the data of each window must first be operated in the area area to obtain the next frame information of each window, and then the data in the area area must be written to the corresponding address of the window in the screen area to save the latest frame information of the entire screen, and finally the corresponding data in the screen must be written into the video memory to complete the display.
4.4 Software Design:
Based on the above scheme, the design of MCU program becomes very simple. The program structure is shown in Figure 6. After the controller is powered on, the system is initialized first, and then the screen parameters are read from FLASH to initialize the parameters. Then the task TaskCONtrol is established. TaskControl has a higher priority than each window display task. It is mainly used to manage each window display task in real time. TaskControl will query the reset flag once every period of time. If reset=1, it will delete the previously established window display tasks, and then read the new window number from FLASH, and establish a new task accordingly, and the display of each window will be controlled by a single window display task.
The following is a program demonstration of the TaskControl task:
void TaskControl(void *pdata){
uint8 taskNum;
pdata=pdata;
RESET:
reset=0; // reset flag clear
for(taskNum=3;taskNum<18;taskNum++){ // Delete the previously created window task
OSTaskDel(taskNum); // The window display task priority starts from 3 }// A maximum of 16 windows are allowed
taskNum=flashReadWord(AREA_NUM_ADDR); // Read the number of screen windows from FLASH
if(taskNum>0) //Create a window display task based on the number of windows
OSTaskCreate(task0, (void*)0, &task0Stk[TaskStkLength- 1], 3);
if(taskNum>1)
OSTaskCreate(task1, (void*)0, &task1Stk[TaskStkLength- 1], 4);
...
while(1){if(reset) goto RESET; //reset flag is 1, program reset
OSTimeDlyHMSM(0, 0, 1, 0);}
}
The window display task is used to display the contents of each window. It calculates the next frame of data in the corresponding area according to the different display modes of each window, and then calls areaToScreen() and screenToCpld() to display it. After displaying a frame of data, OSTimeDlyHMSM() is called once to put the current task into a waiting state and perform a task scheduling, giving the system control to the window display task with the highest priority in the ready state, thereby completing the switching between window display tasks. We can also change the time interval between the display information of two adjacent frames of each window by adjusting the parameters of OSTimeDlyHMSM(), so as to adjust the special display effects of each window, such as the moving speed of the moving display. The following is a program demonstration of one of the window display tasks:
void Task0(void *pdata){
pdata=pdata; window parameter initialization; while(1){uint16 i;
for(i=0;i
areaToScreen(); // Read data from area and write it to screen
screenToCpld(); // Write the corresponding data in the screen to the video memory to complete the display of one frame of data OSTimeDlyHMSM(0, 0, 0, displaySpeed*20); // Task scheduling
}
}
}
5 Conclusion
Taking full advantage of the high performance of the 32-bit microprocessor and the efficient task scheduling algorithm of the real-time operating system, the display of multiple windows on a single screen at any position is realized. The screen display becomes richer and more flexible, and many occasions that could only use synchronous controllers or multiple asynchronous controllers in the past can be replaced by a single asynchronous controller, thereby reducing the cost of the system.
The author's innovation point is: it realizes the display of multiple windows at any position on a single LED large screen, and can realize multi-window overlapping display and "picture-in-picture" and other display effects.
Previous article:Design of LED display screen based on ARM S3C44B0X
Next article:Grayscale display scheme design for high-density LED display
Recommended ReadingLatest update time:2024-11-16 16:21
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- 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
- First day of work in 2021
- TL335x-EVM development board processor, FLASH, RAM, FRAM
- DSP2812 CMD detailed configuration example
- 【ESP32-Korvo Review】 01 Unboxing Experience
- Exposed! Another unfinished semiconductor project: defrauding state-owned land and refusing to return it! Using the name of chips to engage in real estate?
- How to configure C2000 to enter low power mode
- Basic concepts of amplifier circuits and three basic connections
- Does the material of the transformer determine the operating frequency of the transformer?
- CV2880 simple datasheet
- Washing machine problems