This paper introduces the design scheme of a widely used LED large screen asynchronous controller. The system uses 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 single screen and multiple windows at any position, making the screen display rich and flexible.

1. Introduction

In the past, the LED asynchronous controller can only display a screen as a complete area, or simply add the time area or swim around the subtitle area, which often lacks enough flexibility for users, especially when the screen is large. In view of the above situation, this paper proposes a design scheme based on 32-bit high-performance ARM processor and UC / OS-II. It makes full use of UC / OS-II’s efficient multi task management function and arm processor’s powerful computing power to realize the display of any position in a single screen and multiple windows, which makes the display content more abundant and the display mode more flexible.

2. Working principle of LED control system

The typical led asynchronous control system is mainly composed of PC application software, communication module, data processing module, scanning control module, driving module and LED screen, as shown in Figure 1.

How to realize the display of multiple windows on LED large screen at any position

First, PC applications convert text or pictures into lattice information with a specific format. Then, the lattice information is sent to the data processing module through the communication module. The data processing module carries out various special effects on these lattice information, and finally displays the picture correctly on the LED screen by scanning control module and driving module.

The LED asynchronous controller in this paper includes communication module, data processing module and scanning control module.

3. Design of controller software

The hardware structure of the controller is shown in Figure 2. The data processing module is composed of MCU, a SRAM and a flash memory. MCU uses Philips LPC2214 processor based on 32-bit ARM core. It has rich peripheral interface resources and powerful computing ability, and is the core of the whole controller. SRAM is used as the buffer of MCU for special effects. Flash memory is used to store lattice information and some necessary parameters.

How to realize the display of multiple windows on LED large screen at any position

The scanning control module is composed of CPLD and video memory. The display memory is a piece of SRAM, which is used to save the current display of a frame lattice information. CPLD is connected with MCU through address bus and 16 bit data bus. It writes 16 bit data received from MCU into video memory according to specified address, and then reads out lattice information from memory according to certain addressing mode for scanning. MCU can only write the video memory by CPLD. The communication module includes Ethernet module and serial communication module, which is 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 single screen and multi window at any position, the software part is designed based on uC / OS-II, which can make full use of the efficient task scheduling algorithm of the operating system, and hand over the display of each window to a single task, which greatly improves the running speed and reliability of the system, and makes the development and expansion of the program more convenient.

Before the specific program design, it is necessary to determine the data organization scheme.

Because a good data organization scheme can achieve twice the result with half the effort for programming.

4.1 data organization scheme of video memory:

For dual color screen, a pixel needs red and green data to describe. In order to facilitate processing, we will horizontally continuous 8 pixels to form a word (2byte) for storage, one byte is red data, one byte is green data. The order of data storage is from left to right and from top to bottom. As shown in Fig. 3, if the screen width is 160 pixels and the starting address of video memory is 0x8300000, then the first eight pixels in the first line of the screen are mapped to the two bytes with addresses of 0x8300000 and 0x8300001 in video memory, and the first eight pixels in the second line are mapped to the two bytes with addresses of 0x8300028 and 0x8300029 in video memory, and so on.

How to realize the display of multiple windows on LED large screen at any position

4.2 lattice information conversion rules:

Because the size of the window can be set arbitrarily, the position of the window can be placed arbitrarily.

So for a single window, its mapping in video memory may not be word aligned. Taking Fig. 4 as an example, a window with coordinates of (20, 16) and size of 86 × 47 is opened on a screen with the size of 160 (width) × 96 (height). Then, the mapping of the first four pixels in the first row of this window in the video memory is the lower four bits of the two bytes with addresses of 0x830008282 and 0x8300083, so the mapping of this window in video memory is not word aligned. Because MCU can only operate the display memory in the unit of word (2byte), when PC software converts the lattice information of the window, if the area 1 (the actual size of the window) is converted and stored directly, there will be a lot of bit operations in the special effects processing of the window, which will greatly reduce the operation efficiency and affect the display of special effects, In this way, it is difficult to meet the user’s requirements for special effects.

How to realize the display of multiple windows on LED large screen at any position

In order to solve the above problems, region 1 can be expanded horizontally into a region 2 with starting point coordinates of (16,16) and size of 96 × 47. It is easy to see that the mapping of region 2 in video memory is word aligned. In order to avoid the bit operation during operation, PC software can convert the lattice information of area 1 according to area 2, only the data in the extension part of area 1 should be filled in as 1. This process will sacrifice a small part of flash memory space, but it can avoid a lot of bit operation in special effects processing, so it greatly improves the operation efficiency, so it is worth doing.

4.3 organization scheme of cache data:

Because MCU can only write to the video memory, the information of the previous frame is often needed to get the information of the next frame when performing special operation. Therefore, first of all, we need to divide a block in the cache, which is equal to the size of video memory, and the address is one-to-one. Screen is used to save the previous frame information of the whole screen.

How to realize the display of multiple windows on LED large screen at any position

Because MCU can only perform word operation on video memory, and there may be area overlap between multiple windows, if the special operation of each window is carried out directly on the screen area, the information of window overlap may be confused. Therefore, as shown in Fig. 5, it is also necessary to divide a block of memory space (area 1, area 2) for each window in the cache. … area n), which is used to save the information of the previous frame displayed in this window. In this way, in the stunt operation, the data of each window should be calculated in the area area to get the next frame information of each window. Then the data in the area area should be written to the corresponding address of the window in the screen area to save the latest frame information of the whole screen. Finally, the corresponding data in the screen should 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 initialization is carried out first, and then the screen parameters are read from the flash for parameter initialization. Then the task control is established. Taskcontrol has higher priority than each window display task. It is mainly used for real-time management of each window display task. Every once in a while, taskcontrol will query the reset flag. If reset = 1, it will delete the original window display task, then read the number of new windows from flash, and then create a new task. The display of each window will be controlled by a single window display task.

How to realize the display of multiple windows on LED large screen at any position

The following is a program demonstration of task taskcontrol:

void TaskControl(void *pdata){

uint8 taskNum;

pdata=pdata;

RESET:

Reset = 0; / / reset flag reset

For (tasknum = 3; tasknum 18; tasknum + +) {/ / delete the original window task

Ostask del (tasknum); / / the window displays the task priority starting 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 according to the number of windows

OSTaskCreate(task0,(void*)0,&task0Stk[TaskStkLength- 1],3);

if(taskNum》1)

OSTaskCreate(task1,(void*)0,&task1Stk[TaskStkLength- 1],4);

。 ..

When (1) {if (reset) goto reset; / / reset flag is 1, the program is reset

OSTimeDlyHMSM(0,0,1,0);}

}

The window display task is used to display the contents of each window. It performs the operation of the next frame data in its corresponding area area according to the different display modes of each window, and then calls areaToScreen () and screenToCpld () to display. After the display of a frame of data is completed, the current task is put into the waiting state by calling ostimedlyhsm() once, and a task scheduling is carried out at the same time. The system control right is handed over to the window in the ready state to display the task with the highest priority, thus completing the switching between the window display tasks. We can also change the time interval between two adjacent frames of each window by adjusting the parameters of ostimedlyhsm(), so as to adjust the effect of special effects of each window, such as the moving speed of moving display. Here is a demo of one of the window display tasks:

void Task0(void *pdata){

Pdata = pdata; window parameter initialization; while (1) {uint16i;

For (I = 0; I total frames; I + +) {next frame data operation; / / in the area area

Areatoscreen(); / / read and write data from area to screen

Screentocpld(); / / write the corresponding data in screen to the video memory to display a frame of data ostimedlyhsm (0, 0, 0, displayspeed * 20); / / task scheduling

}

}

}

Conclusion

Taking full advantage of the high performance of 32-bit microprocessor and the efficient task scheduling algorithm of real-time operating system, the display of any position in single screen and multi window is realized. It makes the screen display more flexible, and makes the single asynchronous controller be used instead of synchronous controller or multiple asynchronous controllers in the past, so as to reduce the cost of the system.

In this paper, the author’s innovation point: it realizes the display of multiple windows at any position on a single LED screen, and can realize the display effects of overlapping multiple windows and “picture in picture”.

Responsible editor

Leave a Reply

Your email address will not be published. Required fields are marked *