This paper studies the design of a 16×16 LED Chinese character scrolling display screen based on the AT89C51 single-chip microcomputer and its simulation implementation using Proteus software. It mainly introduces the hardware circuit of the LED Chinese character display screen, assembly program design and debugging, Proteus software simulation, etc. The design of this display screen has the advantages of small size, less hardware, simple circuit structure and easy implementation. It can help the majority of electronic enthusiasts understand the dot matrix display principle of Chinese characters, understand the basic structure, working principle and application method of single-chip microcomputers, and improve the ability to apply single-chip microcomputer knowledge and technology. Keywords
: single chip; LED; dot matrix; Chinese character display
O Introduction
LED display is a flat display screen composed of light-emitting diode dot matrix modules or pixel units. It has the advantages of high luminous efficiency, long service life, flexible configuration, rich colors and strong adaptability to indoor and outdoor environments. 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×16LED Chinese character dot matrix scrolling display based on AT89C51 single-chip microcomputer.
1 Hardware circuit composition and working principle
This product is implemented with the circuit based on AT89C51 single-chip microcomputer as the core chip. It is mainly composed of AT89C51 chip, clock circuit, reset circuit, column scanning drive circuit (74HCl54), and 16×16 LED dot matrix, as shown in Figure 1. Among them, AT89C51 is a low-voltage, high-performance CMOS 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 industrial standard MCS-51 instruction set and output pins. Since the multi-functional 8-bit CPU and flash memory are combined in a single chip, it can perform 1,000 write/erase cycles and the data retention time is 10 years. It is an efficient microcontroller that provides a highly flexible and inexpensive solution for many embedded control systems. Therefore, AT89C51 chips are often used in the design and production of intelligent electronics. The clock circuit is composed of the clock terminals (XTAL and XTAL2) of the 18th and 19th pins of the AT89C51, as well as the 12 MHz crystal X, capacitors C2 and C3, and adopts the on-chip oscillation mode. The reset circuit adopts a simple power-on reset circuit, which is mainly composed of resistors R, R2, capacitor C, and switch K, and is connected to the RST reset input terminal of the AT89C51 respectively. The LED dot matrix display screen adopts 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 to the bus, and 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 89S51 microcontroller, 32 I/0 ports will be needed, which will cause the exhaustion of I/0 port resources and there will be no room for expansion of the system. Therefore, in actual application, we only connect the 16 rows of the LED matrix directly to the P0 and P2 ports, and the column selection scan signal is selected and controlled by the 4-16 line decoder 74HCl54. In this way, the column selection control only uses the 4 I/O ports of the microcontroller, saving a lot of I/O port resources and providing conditions for the expansion of the use of the microcontroller system. Considering that the P0 port must be set with a pull-up resistor, we use a 4.7 kΩ resistor as the pull-up resistor. The basic process of Chinese character scanning display is as follows: after power is turned on, due to the effect of resistor R and capacitor C1, the RST reset pin level of the single-chip microcomputer is high first and then low, thus achieving reset; afterwards, under the effect of C, C3, X and the internal clock circuit of the single-chip microcomputer, the single-chip microcomputer 89C51 outputs the code level corresponding to the internal Chinese character at the P0 and P2 interfaces according to the set program and sends it to the row selection line of the LED dot matrix (high level drive), and at the same time outputs the column selection scanning signal (low level drive) at the P1.1, P1.2, P1.3, P1.4 interfaces, thereby selecting the corresponding pixel LED to emit light, and using the visual persistence characteristics of the human eye to synthesize the display of the entire Chinese character. Then change the table fetch address to realize the scrolling display of Chinese characters.
2 Dot matrix display principle of Chinese characters and method of obtaining font code
Let's take the UCDOS Chinese Song font library as an example. Each character is displayed by 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 dot as a pixel, and the shape of each character 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. For example, if it is controlled by an 8-bit AT89C51 microcontroller, since the bus of the microcontroller is 8 bits, a character needs to be split into 2 parts, as shown in Figure 2
In order to understand the dot matrix composition rules of Chinese characters, we first use the column scanning method to obtain the code of Chinese characters. Chinese characters can be divided into the upper part and the lower part. The upper part is composed of 8×16 dot matrix, and the lower part is also composed of 8×16 dot matrix. In this example, the upper half of the first column in the upper left corner is first displayed by the column scanning method, that is, P00~P07 of the 0th column, the direction is P00 to P07, when the Chinese character "I" is displayed, it is all off, and the lower half of the first column is also all off. The upper half of the second column, P06, is lit, and arranged from top to bottom, as follows: PO. 0 is off, PO. 1 is off, P0. 2 is off, PO. 3 is off, PO. 4 is off, P0. 5 is off, P0. 6 is on, and P0. 7 is off. That is, the binary 00000010 is converted to hexadecimal 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 still design it to scan from top to bottom, that is, scan from P27 to P20. From Figure 3, we can see that P23 in this column is bright, which is 00001000, and the hexadecimal is 08h. According to this method, we turn to the third column, the fourth column, and so on until the sixteenth column is scanned, and a total of 32 8-bits are scanned. It can be concluded that the scanning code of the Chinese character "我" is:
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
From this principle, it can be seen that no matter what font or image is displayed, this method can be used to analyze its scanning code and display it on the screen. Although the above method can allow us to figure out the process of obtaining the Chinese character dot matrix code, it is a very cumbersome task to obtain the Chinese character code by manual method. To this end, we often use font software to find character codes. After opening the software, enter the Chinese characters and click "Retrieve". The hexadecimal data Chinese character code can be automatically generated. Just copy the vertical data we need into the program, 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 requirements of visual persistence, the scanning frequency of the dot scanning method must be greater than 16×64-1 024 Hz, and the cycle can be less than 1 ms. The scanning frequency of the row scanning and column scanning methods must be greater than 16×8-128 Hz, and the cycle can be less than 7.8 ms. However, when driving one column or one row (8 LEDs) at a time, an external driving circuit is required to increase the current, otherwise the LED brightness will be insufficient.
3 Programming and debugging in Keil environment
The software program mainly consists of start, initialization, main program, and font library. The flowchart of the main program is shown in Figure 4. The following program can be used to realize the scrolling display of "I love you - my motherland". The display of Chinese characters. The program list is as follows:
After completing program writing, debugging and compiling in the Keil software, a Hex file that can run the microcontroller 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 the LED Chinese character display screen.
Proteus is different from other microcontroller simulation software in that it can not only simulate the working conditions of the microcontroller peripheral circuits or other circuits without the participation of the microcontroller, but also simulate the working conditions of the microcontroller CPU. Therefore, when simulating and debugging the program, the process and results of program operation and circuit operation can be directly viewed from the engineering perspective. In a sense, Proteus simulation is basically close to engineering application. The design of the 16×16 LED Chinese character scrolling display screen 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 has included the basic circuit principles, basic procedures and Proteus software simulation of the LED Chinese character scrolling display screen. As long as the 10 interfaces of the microcontroller are expanded and some LED dot matrices and related chips are added, a larger area and more colorful LED display screen can be designed. Therefore, this article has certain theoretical and practical reference value for similar designs.
Previous article:Design of large LCD backlighting system
Next article:RGB LED mood lighting - MSP430 creates warm lighting
Recommended ReadingLatest update time:2024-11-16 17:41
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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
- Can the comment statement in C language be written in the IF judgment condition in KEIL5?
- How to handle the error in calling the ti.osal.ae674 library when porting the FATFS routine of pdk_omapl138?
- Problems with functionality after reset
- ZTE's 7nm chip mass production still needs time to catch up with high-end chip track
- Comparison of Three Synchronous Designs in FPGA
- Looking for package SOT128-1
- 【Qinheng RISC-V core CH582】Timer PWM drive servo
- Selection and use of bypass capacitors
- CircuitPython Holiday Wreath
- Application and advantages of mica capacitors