introduction
LED display screen is a flat display screen composed of light-emitting diode dot matrix modules or pixel units. It has the advantages of high luminous rate, long service life, flexible configuration, rich colors and strong adaptability to indoor and outdoor environments. And it is widely used for information release and advertising in public places such as buses, shops, stadiums, stations, schools, banks, highways, etc. LED display screens are developing rapidly. This article describes the basic principles, hardware composition and design, program writing and debugging, Proteus software simulation and other basic links and related technologies of 16×16 LED Chinese character dot matrix scrolling display based on AT89C51 microcontroller.
1 Hardware circuit composition and working principle
This product is implemented using a circuit with AT89C51 microcontroller as the core chip. It is mainly composed of AT89C51 chip, clock circuit, reset circuit, column scan driver circuit (74HCl54), and 16×16 LED dot matrix, as shown in Figure 1. Among them, AT89C51 is a low-voltage, high-performance CMOS-type 8-bit microprocessor with 4kB Flash Programmable and Erasable Read Only Memory (FPEROM), commonly known as a single-chip microcomputer. The device is manufactured using ATMEL high-density non-volatile memory manufacturing technology and is compatible with the industry standard MCS-5l instruction set and output pins. Thanks to the combination of a versatile 8-bit CPU and flash memory in a single chip, it is capable of 1,000 write/erase cycles and has a data retention time of 10 years. It is a highly efficient microcontroller that provides a highly flexible and inexpensive solution for many embedded control systems. Therefore, the AT89C51 chip is often used in the intelligent electronic design and production process. The clock circuit is composed of the clock terminals of pins 18 and 19 of AT89C5l (XTAI l and XTAL2), 12 MHz crystal oscillator X, capacitors C2 and C3, and adopts on-chip oscillation mode. The reset circuit uses a simple power-on reset circuit, which is mainly composed of resistors R, R2, capacitor C, and switch K, which are respectively connected to the RST reset input of AT89C51. The LED dot matrix display uses a 16×16 dot matrix with a total of 256 pixels. The pin distribution of the dot matrix can be determined by testing the light-emitting diodes with a multimeter.
We connect the row and column bus to the I/0 port of the microcontroller, and then send the scan code analyzed above into the bus, and then we can get the displayed Chinese characters. However, if all the row and column ports of the LED dot matrix are directly connected to the 89S5 1 microcontroller, 32 I/0 ports will need to be used, which will cause the I/0 port resources to be exhausted and the system will have no room for expansion. Therefore, in practical applications, we only connect the 16 row lines of the LED dot matrix directly to the P0 port and the P2 port. As for the column selection scanning signal, it is selected and controlled by the 4-16 line decoder 74HCl54. In this way, the column The selection control only uses 4 I/O ports of the microcontroller, saving a lot of I/O port resources and providing conditions for expanding the functions of the microcontroller system. Considering that the P0 port must have a pull-up resistor, we use a 4.7 kΩ row resistor as the pull-up resistor. The basic process of Chinese character scanning display is as follows: after power-on, due to the action of resistor R and capacitor c1, the RST reset pin level of the microcontroller is first high and then low, thereby achieving reset; after that, C, C3, X and the internal clock of the microcontroller Under the action of the circuit, the microcontroller 89C51 outputs the code level corresponding to the internal Chinese characters at the P0 and P2 interfaces according to the set program and sends it to the row selection line (high level drive) of the LED dot matrix. At the same time, P1.1, P1. 2. The P1.3 and P1.4 interfaces output column selection scanning signals (low-level drive), thereby selecting the corresponding pixel LED to emit light, and using the persistence of vision characteristics of the human eye to synthesize the display of the entire Chinese character. Then change the table address to realize the scrolling display of Chinese characters.
2 The principle of dot matrix display of Chinese characters and the method of obtaining the font code
Let's take the UCDOS Chinese Song Dynasty font library as an example. Each character is displayed in a dot matrix of 16 rows and 16 columns. That is, each character in the national standard Chinese character library is represented by a 256-dot matrix. We can understand each point as a pixel, and the glyph of each word as an image. In fact, this Chinese character screen can not only display Chinese characters, but also any graphics within the range of 256 pixels. If the 8-bit AT89C51 microcontroller is used for control, since the bus of the microcontroller consists of 8 bits, a word needs to be split into 2 parts, as shown in Figure 2
In order to clarify the dot matrix composition rules of Chinese characters, the codes of Chinese characters are first obtained through the column scanning method. Chinese characters can be divided into upper and lower parts. The upper part is composed of 8×16 dots, and the lower part is also composed of 8×16 dots. In this example, the column scanning method is used to first display the upper half of the first column in the upper left corner, that is, the P00~P07 ports in column 0, with the direction from P00 to P07. When the Chinese character "I" is displayed, it is completely wiped out. The lower half is also total annihilation. The upper part of the second column, P06, lights up, arranged from top to bottom, as follows: PO.0 off, PO.1 off, P0.2 off, PO.3 off, PO.4 off, P0.5 off, P0 .6 is on, P0.7 is off. That is, binary 00000010, converted to hexadecimal is 02h. After the second column of the upper half is completed, continue to scan the second column of the lower half. For the convenience of wiring, we are still designed to scan from top to bottom, that is, from P27 Scan in the direction of P20. As can be seen from Figure 3, P23 in this column is on, which is 00001000, and in hexadecimal it is 08h. Follow this method to the third column, the fourth column,..., until the sixteenth column Scan, scan a total of 32 8-digit characters, and you can get the scan code of the Chinese character "I" as:
00H, 02H, 08H, 06H, 28H, 02H, 24H, 22H
0FCH, 3FH, 24H, 2 1H, 20H, 10H, 3CH, 08H
0E2H, 07H, 20H, 0AH, 0E4H, 11H, 0A8H, 20H
20H, 30H, 00H, 00H, 00H, 00H, 00H, 00H
It can be seen from this principle that no matter what font or image is displayed, this method can be used to analyze its scanned code and display it on the screen. Although the above method allows us to clarify the process of obtaining Chinese character dot matrix codes, it is a very cumbersome matter to rely on manual methods to obtain Chinese character codes. For this reason, we often use font software to search for character codes. After opening the software, enter Chinese characters and click "Retrieve". The Chinese character codes for the hexadecimal data will be automatically generated. Copy the vertical data we need into the program. Yes, as shown in Figure 3.
It can be seen that Chinese character dot matrix display generally has three types: dot scanning, row scanning and column scanning. In order to meet the visual persistence requirements, the scanning frequency of the point scanning method must be greater than 16×64-1 024 Hz, and the period must be less than 1 ms. The scanning frequency of row scanning and column scanning methods must be greater than 16×8-128 Hz, and the period is less than 7.8 ms. However, when driving one column or row (8 LEDs) at a time, an external drive circuit is required to increase the current, otherwise the LED brightness will be insufficient.
3 Program design and debugging in Keil environment
The software program mainly consists of start, initialization, main program, and font library. The flow chart of the main program is shown in Figure 4. The following program can be used to scroll and display "I love you - motherland". Display of Chinese characters.
The program list is as follows:
After completing program writing, debugging and compilation in keil software, a Hex file that allows the microcontroller to run is generated, as shown in Figure 5.
4 Component selection
The components required for this design are shown in Table 1.
5 Use Proteus software to simulate LED Chinese character display
Proteus is different from other microcontroller simulation software in that it can not only simulate the working conditions of the peripheral circuits of the microcontroller or other circuits without the participation of the microcontroller, but also simulate the working conditions of the microcontroller CPU. Therefore, during simulation and program debugging, the process and results of program operation and circuit work are directly viewed from an engineering perspective. In a sense, Proteus simulation is basically close to engineering applications. This design of a 16×16 LED Chinese character scrolling display based on the AT89C51 microcontroller has been simulated using Proteus software, as shown in Figure 6.
Although this design only uses a 16×16 LED dot matrix and the circuit is simple, it already covers the basic circuit principles, basic programs and Proteus software simulation of the LED Chinese character scrolling display. All you need to do is expand the 10 interface of the microcontroller and add some LED dot matrices. and related chips, we can design LED displays with larger areas and more patterns. Therefore, this article has certain theoretical and practical reference value for similar designs.
Previous article:Design of fully automatic sun tracking system using AT89C51 microcontroller as intelligent unit
Next article:Principle and design of electronic perpetual calendar based on AT89C2051 microcontroller
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- USB Type-C® and USB Power Delivery: Designed for extended power range and battery-powered systems
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- STMicroelectronics IO-Link Actuator Board Brings Turnkey Reference Design to Industrial Monitoring and Equipment Manufacturers
- BlueNRG beacon+serial port transparent transmission
- KiCad Diff Tool
- Engineers must know: "5 types" of production processes that must be considered before PCB layout!
- File status after dup and fork functions are executed
- EEWORLD University Hall----Live Replay: Explore the Black Technology of Network Cameras with Infineon
- GPRS Series Application 10
- Tesla Coil 2 "Low Power Discharge + Detailed Pictures" Welcome to guide
- 7ma/14ma constant current circuit help?
- What are the more important courses in communication engineering?
- Problems with the multi-function Bluetooth remote control