Design of Multi-window Display of Asynchronous Controller for LED Display Screen

Publisher:SereneSpiritLatest update time:2011-11-06 Source: OFweek半导体照明网Keywords:LED Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:LED Reference address:Design of Multi-window Display of Asynchronous Controller for LED Display Screen

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

Analysis of the main dimming technologies and development trends of LED lamps
According to the control of the LED drive current output end, it can be classified into three dimming methods. The control circuit can also be divided into analog control and PWM control. The control circuit is usually implemented by a microcontroller.    1. Main dimming technologies of LED lamps   The first dimm
[Power Management]
LED dot matrix display principle and procedure
The LED dot matrix display introduced in this article can be used to display parameters such as safety days, time, temperature, etc. The program of this article is written using the real-time operating system RTOS. It is introduced as follows. 1. Hardware composition and working principle (1) CPU control b
[Power Management]
LED dot matrix display principle and procedure
Problems encountered when mini2440 key interrupt control LED lights
Platform: xp system, ARM mini2440 Program name: Key interrupt control LED light Main learning content, S3C2440 external interrupt Encounter problems 1. When the HyperTerminal was downloading a program, after I pressed d, it jumped back to the download interface without waiting for me to download the program. Solut
[Microcontroller]
Application of single chip microcomputer in LED display hardware design
  The design uses the 8-bit single-chip microcomputer STC12C5A60S2 of Hongjing Technology as the central controller, and combines the NAND flash memory chip K9F4008 to store the 8×128 dot matrix LED digital screen of the Chinese character library. The dot matrix LED digital screen has the function of offline display a
[Microcontroller]
Application of single chip microcomputer in LED display hardware design
Design technology of LED indoor lighting power supply based on BP3309
In recent years, LED indoor lighting technology has developed rapidly, and LED indoor lighting has become a consumer electronic product with massive demand. More and more upstream, midstream and downstream enterprises in the LED industry chain have joined the development, design and production of indoor LED lamps, form
[Power Management]
Design technology of LED indoor lighting power supply based on BP3309
Play with 51 microcontroller (1): light up the LED light
01 New project and lighting of small LED lights. LED lights are light-emitting diodes. They have unidirectional conductivity. For light-emitting diodes, it is necessary to select a suitable current-limiting resistor based on its voltage drop and rated current. Open the Keil4 software. Select Project, New uVision Proje
[Microcontroller]
Play with 51 microcontroller (1): light up the LED light
9. Learn ARM Cortex-A9 LED assembly and C language driver programming from scratch
0. Introduction Generally, when we buy a development board, the manufacturer will provide the corresponding circuit diagram file, and we can find the corresponding peripherals by searching the corresponding name. For driver engineers, we only need to know some data lines and signal lines for the interaction between th
[Microcontroller]
9. Learn ARM Cortex-A9 LED assembly and C language driver programming from scratch
Light distribution design of LED motorcycle signal light
This paper proposes a new method based on the mathematical model of the light intensity distribution of the curved LED array. On the basis of the derivation of the mathematical model of the light intensity distribution of the curved LED array, it is applied to the light distribution design of the LED motorcycle
[Power Management]
Light distribution design of LED motorcycle signal light
Latest Power Management 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号