1 Introduction
LED display is a flat display screen composed of light-emitting diode dot matrix modules or pixel units, mainly used for information release in public places. It has the advantages of high luminous efficiency, long service life, flexible configuration, rich colors and strong adaptability to indoor and outdoor environments. This paper proposes a design scheme for a display controller based on a 32-bit high-performance ARM processor and μC/OS-II. It makes full use of the efficient multi-task management function of μC/OS-II and the powerful computing power of the ARM processor to realize the display of multiple windows on a single screen at any position, making the screen display content richer and the display mode more flexible. This makes the controller synchronized.
2. Overall structure design of controller hardware
The hardware structure block diagram of this controller is shown in Figure 1. The data processing module consists of an MCU, an SRAM and a FLASH memory. The MCU uses the 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 the displayed dot matrix information and some necessary parameters. The scanning control module consists of a CPLD and a video memory. The video memory is a SRAM, which is used to save a frame of data currently being displayed. The communication module includes an Ethernet module and a serial communication module, which can realize RS232, RS485 and industrial Ethernet communication between the PC and the controller.
Figure 1 Hardware block diagram of the controller
3 Detailed design of controller hardware
1. RTC circuit. LPC2214 integrates RTC function module, but because its clock source is VPB clock, it cannot be used when the chip is powered off, so it is not suitable for battery-powered systems. Therefore, we use an external RTC chip here - HT1381, a low-power serial real-time clock chip produced by HOLTEK. HT1381 uses serial transmission to interface with the microprocessor, and only three leads are needed to realize the microprocessor's access control to HT1381. The schematic diagram of the RTC circuit is shown in Figure 2. In the figure, C1, C2, G1 and the oscillators inside X1 and X2 form the clock generation circuit of HT1381. D1, D2, D3 and 3V rechargeable battery, +3.3V power supply form the power supply circuit of HT1381. When the system uses external power supply, D3 and D2 are turned on, D1 is turned off, and the external power supply supplies power to the chip on the one hand and charges the rechargeable battery on the other hand. When the system power supply stops, D3 is turned off, D1 is turned on, and the chip is powered by the battery.
Figure 2 RTC circuit
2. Temperature sensor circuit. DS18B20 is a single bus digital temperature sensor. DS18B20 uses a 3-pin package, and only one I/O line is required to read or write data from DS18B20. And data communication is carried out with the microcontroller in the form of serial communication. The device integrates semiconductor temperature-sensitive devices, A/D converters, memory, etc. on a very small circuit chip, and the sensor directly outputs the digital value of the temperature signal. The signal transmission adopts a single bus structure composed of two-core (or three-core) cables. Several digital temperature sensors can be connected to a single bus cable, and each sensor has a unique address code. The microcontroller can read the temperature value of a certain sensor by addressing the device, thereby simplifying the circuit structure of the signal acquisition system. The connection line of the acquisition port is reduced by 50 times, which not only saves the cost, but also brings great convenience to the on-site construction.
3. Serial interface circuit. Although Ethernet communication is now very popular, serial communication still has a wide range of applications in data acquisition and control systems due to its low wiring and low cost. The main difference between RS232 and RS485 is related to the use of balanced and unbalanced signals. RS232 uses unbalanced signals, while RS485 uses balanced signals. Which one to use depends mainly on two factors: transmission distance and electrical noise. When the transmission distance is less than 30 meters and the environmental electrical noise is small, it is best to use unbalanced RS232. When the transmission distance is longer but less than 300 meters, or when the impact of environmental electrical noise must be considered, it is best to use RS485. In addition, the two-wire communication method of RS485 can realize true multi-point two-way communication.
4. Automatic brightness adjustment circuit. When the ambient light is weak, the brightness of the LED screen should be reduced accordingly, otherwise it will be dazzling. When the ambient light is strong, the brightness of the LED screen should also be increased accordingly, otherwise the content displayed on the screen will not be clear. Therefore, the controller needs to automatically adjust the measurement according to the brightness of the surrounding light. In order to achieve the above functions, the system uses a photoresistor, which is connected in series with a certain value resistor. When the external ambient light changes, the resistance of the photoresistor changes, and the voltage divided by R2 also changes accordingly. Then the screen brightness is adjusted according to this voltage value. The specific circuit is shown in Figure 3. LPC2214 has an 8-channel 10-bit ADC converter with a reference voltage of 3.3V. The accuracy of the reference voltage will affect the conversion result of the ADC. R1 is an I/O port protection resistor, which is used to ensure that the circuit does not produce a short circuit fault.
Figure 3 Automatic brightness adjustment circuit [page]
5. LED display screen scanning drive circuit. The scanning logic of the LED display screen is implemented by CPLD, and the CPLD uses Altera's EPM1270. EPM1270 belongs to Altera's MAX II series. MAX II is the lowest cost CPLD device launched by Altera so far.
3 LED scanning logic design
LED scanning logic is implemented by CPLD, which has good combinational logic and timing logic functions, and can complete the scanning control signal required for LED display. The CPLD design block diagram is shown in Figure 4. It mainly includes the following modules: ⑴ Clock process: generates clocks of various frequencies; ⑵ FIFO: the interface between CPLD and MCU, used as data buffer, which enables MCU to perform full-speed write operations on the video memory; ⑶ Write address and data generator: generates addresses and data for writing to the video memory; ⑷ Read address generator: different scanning modes have different addressing modes when reading data from the video memory. The read address generator can generate different read video memory addresses according to different scanning modes, thereby completing 1/16, 1/8, 1/4 and other scanning modes; ⑸ Scan control circuit: under different scanning modes, generates corresponding scan control signals according to the data read from the video memory; ⑹ Read-write switching circuit: switches the read and write status of the video memory.
Figure 4 CPLD design block diagram
4 Software Design Based on μc/OS-II Controller
In order to realize the display of single screen and multiple windows at any position, we design the software based on μc/OS-II, so that we 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. The structure of the program is shown in Figure 5. 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 is used to manage the display tasks of each window in real time. It has a higher priority than the display tasks of each window. It queries the reset flag every 1s. If reset=1, the previously established window display tasks are deleted, and then the new number of windows is read from FLASH, and then a new task is established accordingly, and the display of each window is controlled by a single task.
Figure 5 System program structure diagram
1. Cluster communication protocol of RS485 bus. The specific process is as follows: First, the PC sends an address frame to the controller, and the address frame uses MARK verification. It includes 6 bytes. The first byte is the address code. After the controller receives this byte, it first determines whether it is the same as its own address. If it is the same, it continues to receive the next byte, otherwise it exits the interrupt. The address of each controller can be set through the DIP switch on the controller. The next three bytes are screen parameters, which mainly include the horizontal and vertical dots of the screen and the color of the display screen (single or double color). After receiving these parameters, the controller first compares them with its own parameters. If the parameters are not the same, it exits the interrupt, otherwise it continues to receive the next byte. The next byte sent is the operation code, which mainly tells the controller what kind of operation is to be performed below. These operations include loading screen parameters, system reset, loading data, power on and off, etc. The controller will operate the Flash according to the operation code.
2. Design of GUI interface. GUI is the abbreviation of Graphic User Interface. It is a product based on computer graphics. It can be used to improve the friendliness of human-computer interaction. We can use it to achieve many unexpected effects on LED screens. Here we provide the most basic functions of drawing points, lines, circles, etc. on LED screens.
(1) Point drawing function. All graphics are composed of points, which are the most basic elements of graphics. When describing a point, its coordinate value (X, Y) and color are needed. For a two-color LED screen, the color value 0 represents green, 1 represents red, and 2 represents yellow. When drawing a point, first convert the coordinate value of the specified point into the corresponding byte on the video memory, and then perform color processing on the corresponding byte. Then write this byte to the video memory to complete the display of the point. (2) Line drawing function. For the drawing of straight lines, there are three drawing methods: horizontal line, vertical line and general straight line. In fact, general straight lines include horizontal lines and vertical lines, but because these two types of straight lines are more special, the drawing operation does not require as many operations as other straight lines, so separating them is beneficial to increase the drawing speed.
The author's innovation
This paper mainly introduces a design scheme of display screen controller based on 32-bit high-performance ARM processor and μC/OS-II. This system makes full use of the efficient multi-task management function of μC/OS-II and the powerful computing power of ARM processor to realize the display of multiple windows in any position on a single screen, making the screen display content richer, the display mode more flexible, and the controller synchronized.
References:
[1] Gong Zhaogang. Embedded controller of LED variable information board based on ARM processor[J]. Modern Display. 2006, (06)
[2] Zhang Shumeng. Research and implementation of embedded systems and FPGA in LED display screens[J]. Wuhan University of Technology. 2005
[3] Jean. Labrosse著,邵贝贝等译.嵌入式操作系统μC/OS-II(第二版)[M].北京航空航天大学出版社.2005年
[4] Song Hui, Gao Xiaoming. Porting of embedded operating system μC/OS-II based on ARM[J]. Microcomputer Information, 2006,2-2: 135-136
Previous article:Design and Implementation of EmJTAG Protocol Converter
Next article:Design of Embedded Wireless Video Monitoring System
Recommended ReadingLatest update time:2024-11-16 16:19
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- NXP Rapid IoT Review] +⑥NXP Rapid IoT self-exploration program, review summary and impressions
- RF Circuit PCB Design Processing Techniques
- RSL10-002GEVB Plant Manager Node Design
- Development environment preparation
- Random notes small total small picture signal reflection picture
- Basic knowledge of radome structure
- (Repost) Getting Started with Bluetooth Development
- [Shanghai Hangxin ACM32F070 development board evaluation] 5. Run the watchdog
- The rules for adding core points have been adjusted, and new products have been added to the core redemption mall!
- How does a magnetostrictive sensor work? What is the working principle of a magnetostrictive sensor?