introduction
LED display screen has the advantages of low cost, long life, low power consumption, wide operating temperature range, etc., and is widely used in the display of text and image information. The whole system is generally divided into three parts: host computer, display screen control circuit and LED array and its driver.
The design of the display screen control circuit widely uses two types of devices as its control core, one is the single-chip control system, and the other is a programmable logic device. This design adopts a control scheme based on a single-chip microcomputer, as shown in Figure 1. A PC is connected to multiple controllers through an RS485 bus. Each controller is expanded with a temperature sensor, a real-time clock and other peripheral devices to control the display of the LED screen.
The control scheme of single chip microcomputer is adopted, which has simple structure, flexible application and easy expansion.
1 System Hardware Design
The system hardware block diagram is shown in Figure 2. The host PC uses special software to edit the information to be displayed, sends it to the microcontroller through the serial port, stores it in the Flash, and the microcontroller then drives the circuit to display the character code in the form of an LED dot matrix.
The LED dot matrix is a dual-color screen that can display three colors: red, green, and yellow. The core of the controller uses the STC89LE516 microcontroller, with an expanded 32KSRAM as the display buffer, and 512KFlash is used to store the displayed dot matrix information and some necessary parameters.
The DIP switch selects the physical address of this screen. The controller also expands a temperature sensor to collect temperature data and a clock chip to read and write real-time time.
1.1 Memory Expansion Circuit
STC89LE516 is a high-speed, low-power single-chip microcomputer with strong anti-interference, enhanced 51 core, integrated watchdog circuit, 64K bytes of Flash memory, 512 bytes of RAM, online programming, remote upgrade, and low price.
In order to improve the response speed, the system expands 32KSRAMIS61LV256 as the display buffer area to save the currently displayed frame data and some special effects processing data. The interface with the microcontroller is shown in Figure 3. The highest address line A14 of the SRAM is controlled separately by P3.2 of the microcontroller to facilitate the storage of the data of the red and green LED dot matrix in blocks. When the output of P3.2 is 0, the RAM address 0x0000~0x3fff is selected as the data area of the red LED; when the output of P3.2 is 1, the RAM address 0x4000~0x7fff is selected as the data area of the green LED.
Flash is used to store code, display data information and fonts. The Chinese characters and English dot matrix data to be displayed can be called by table lookup. Using 64K bytes of storage space to store 16×16 dot matrix Chinese characters, 2048 characters can be displayed. 512K Flash can meet the storage requirements of different fonts of commonly used characters. The address line of SST39VF040 has 19 bits, and the microcontroller uses P1 port to expand the upper three address lines.
The MCU, SRAM and Flash in the system require 313V power supply, while the system access power supply is 5V. LM1117-3.3 can be used to provide 3.3V regulated power supply for the chip.
The low voltage dropout power chip LM1117 has an output current of up to 800mA, an output voltage accuracy within ±1%, and also has current limiting and thermal protection functions.
1.2 Serial interface circuit
The controller receives data using the full-duplex universal asynchronous receiver/transmitter (UART) inside the microcontroller. When the transmission distance is less than 20m, the unbalanced RS-232 is used, and when the transmission distance is from tens of meters to kilometers, RS-485 is used. RS-485 uses balanced transmission and differential reception, so it has the ability to suppress common-mode interference and can be networked to form a distributed system. Since the display screens are scattered and tens or even hundreds of meters apart, the controller uses MAX232 and SN75176 for level conversion, and uses jumpers to switch between RS-232 and RS-485, so as to achieve communication with the PC and complete data storage and update.
1.3 Real-time clock circuit
The interface between the microcontroller and the HT1381 low-power real-time clock chip uses serial transmission. As shown in Figure 4, only three wires are needed to read and write the year, month, day, week, hour, minute, and second, and display them on the LED screen when needed. The clock required by the HT1381 is independent of the microcontroller, and it can work with an external 321768kHz crystal oscillator. Equipped with a 3V rechargeable battery, when the system uses external power supply, the diode is turned on, 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, the diode is turned off, and the chip is powered by the battery.
1.4 Temperature Sensor Circuit
The temperature sensor uses a single bus digital temperature sensor DS18B20, which integrates the temperature sensor, temperature alarm trigger, ROM, etc. on a very small chip. The sensor directly outputs the digital value of the temperature signal. DS18B20 reflects the temperature value in a 9-bit digital format, and only one signal line is required to read or write data. [page]
1.5 Scanning Control Circuit and LED Array
At present, most LED display screens are designed with a modular structure. The basic unit is the LED display unit module. The screen size and shape can be flexibly changed, and the installation and maintenance of the display are also very convenient. The LED display unit module is divided into two parts: LED dot matrix and drive circuit.
The LED dot matrix uses a red and green dual-primary color screen, which can display three colors: red, green and yellow, and is moderately priced. Each module is 16×64 pixels and consists of 16 8×8 pixel common anode LED dot matrices. 16 rows of LEDs share one column of data, and the display time of each row of LEDs accounts for 1/16 of a scanning cycle. According to the visual persistence effect of the human eye, as long as the refresh rate of the entire screen is greater than 60Hz, a stable picture can be formed. Each LED display unit has 8 red data input terminals, 8 green data input terminals and 8 row control signal input terminals.
The driving circuit is divided into row driving and column driving.
The row drive circuit is composed of two 3-8 decoders 74HC138. A row selection signal controls the on and off of all LEDs in a row at the same time, so it requires a larger drive current, so 4953 is selected. 4953 contains two P-channel MOSFET tubes, and the maximum drain current can reach 419A, which ensures the row drive capability. 16×64 dot matrix requires 8 4953. The 16-way output of the two 138s is used to select the corresponding rows through the drive of 4953 to realize the control of the rows.
The column driver uses 74HC595, which contains a shift register and a three-state output latch, and can output the 8-bit data of the serial input in parallel. Eight 74HC595s are used to latch the red and green data respectively. The two-way control signal of the microcontroller is connected to the clock input SRCLK and latch signal RCLK of all 595s. The serial output of the first 595 is connected to the serial input of the second 595. Similarly, the connection method of other pins is the same. Through this cascade method, 8 595 chips are connected together, and the parallel output of each 595 chip is connected to the column of 8 LEDs.
The display process is:
(1) Send the first line of red data and green data in the display buffer area to the 595 latch respectively;
(2) Send a row scanning signal to select the first row of the LED array and delay it;
(3) Line blanking, the line scan signal moves down one line and the above process is repeated until the 16th line is displayed. This cycle continues.
Each LED display unit module has two interfaces, which can flexibly expand the LED unit according to different display length requirements, and the controller remains unchanged. If height expansion is required, it can be achieved by expanding the CPLD/FPGA to control the synchronization of the row scan signal. There is no difference in the display and control principles.
2 System software design
The system software includes the host computer software and the slave computer software. The host computer software is written in VC and communicates with the slave computer through an asynchronous serial port. The task of the host computer software is to calibrate the clock, edit the displayed content, color and display effect, etc., and send the data broadcast to the LED display controller. The data format of the communication is shown in Table 1.
After the lower computer is turned on for interrupt and serial port initialization, it executes the display subroutine according to the instructions, and performs temperature sampling and clock data reading at regular intervals. The lower computer is always in a listening state. When there is a serial port interrupt, it communicates with the upper computer. The upper computer sends a 1-byte address character. After receiving it, the lower computer compares it with the address of this screen. The address of this screen is set by the controller's DIP switch. If the address is the same, the data is received, otherwise the interrupt returns, thereby realizing the distributed control of the LED screen. After receiving all the data, it is checked. If an error occurs, it is required to resend. If the check is correct, the acceptance success flag is sent to the upper computer to end the interrupt. The flow of the serial port interrupt program and the timer interrupt program is shown in Figure 5.
After receiving the data, the controller stores it in the Flash and executes the corresponding operation according to the command word in the data. The operation judgment process is shown in Figure 6.
The display subroutine searches for the font from the character library according to the Chinese character internal code, sends it to the display buffer, and outputs it to the column selection signal after data processing, and cooperates with the row scanning signal to perform dynamic scanning display. The data processing function mainly completes the subtitle left shift, right shift, shutter, color change, flashing, etc.
3 Conclusion
This paper uses the STC89LE516 single-chip microcomputer. Under the premise of ensuring functionality and stability, it reduces costs and expands large-capacity Flash data storage. The host computer only needs to transmit the Chinese character internal code to display, which reduces the amount of data transmission and improves the response speed. The LED display unit can be flexibly expanded to meet different needs. The system has been verified by experiments to be stable and reliable, supporting temperature, calendar, Chinese characters and various special effects, and can be used in distributed LED displays in industrial production lines, building security, parking lots, etc.
Previous article:Application of BIST on SoC Embedded Microprocessor Core
Next article:Design of anti-theft remote control based on fingerprint sensor MBF310
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Typical remote IoT sensing designs and features of Sigfox, LoRaWAN, and RIIoT
- Research and implementation of a new type of Doherty amplifier——A-Doherty amplifier
- How to configure 2 network ports?
- [Synopsys IP Resources] Enabling Low-Power Machine Learning for Smart IoT Applications
- Prize live broadcast: C-V2X (Internet of Vehicles) test challenges and solutions, make an appointment to win Keysight gifts
- Testing of heating power of NOx sensor
- IoT access terminal
- How to Measure Cable Impedance and Loss Using a Vector Network Analyzer
- Make Magazine: Getting started with Python on hardware
- Does the LCD module need to be grounded when used?