introduction
The basic working principle of LED display screen is dynamic scanning. The display control process is to first read the font data from the data storage, then write the data to the LED dot matrix through the serial port or parallel port of the microcontroller, and then scan it.
Compared with the static display solution, the dynamic scanning solution saves driving components, but requires a refresh rate higher than 50 Hz to avoid flickering of the displayed image or text. Due to the limitation of the refresh rate, the number of display components that can be controlled by a single chip is relatively small.
Nowadays, large-screen LED display screens are increasingly widely used. In order to achieve orderly and fast display control of hundreds or thousands of LED dot matrix pieces, people have put a lot of thought into it. Dual CPU, dual RAM solutions, FPGA solutions, etc. have been successfully applied; however, the display control process of these solutions is still read first and then write.
This solution has a new idea: using one read instruction to combine reading and writing in one step can greatly improve the efficiency of display control and the circuit is simple.
1 Working principle of LED display
The basic working principle of LED display is dynamic scanning. Dynamic scanning is divided into two modes: row scanning and column scanning. The commonly used mode is row scanning. Row scanning is divided into two modes: 8-row scanning and 16-row scanning.
In the row scanning mode, each LED dot matrix has a set of column drive circuits, and there must be a latch or shift register in the column drive circuit to latch the font data of the content to be displayed. In the row scanning mode, the same row control pins of the same row of LED dot matrix are connected in parallel on one line, a total of 8 lines, and finally connected to a row drive circuit; there must also be a latch or shift register in the row drive circuit to latch the row scan signal.
The column drive circuit and row drive circuit of the LED display are generally controlled by a single-chip microcomputer, and the commonly used single-chip microcomputer is the MCS51 series. The content displayed on the LED display is generally stored in the external data memory of the single-chip microcomputer in the form of a font, and the font is an 8-bit binary number.
The control process of the single-chip microcomputer on the LED display screen is to read first and then write. According to the arrangement order of the LED dot matrix pieces on the screen, the single-chip microcomputer first writes the font data read from the external data storage to the column driver latch of the first LED dot matrix piece in the first row, and then writes the font data to the second piece, the third piece... until the last piece of this row has finished writing the font data, and then the single-chip microcomputer writes the row scan signal to the row driver latch of this row, so the light-emitting diode related to the font data in the first row and the first row is lit. Then the first row of the second row, the first row of the third row... until the first row of the last row is lit. After the first row of each row is lit, there is a delay for a period of time, and then the screen is black, so that the single-chip microcomputer completes the control of a row of LED display screen scanning.
The single chip microcomputer controls the scanning of the second row, the third row, and so on until the eighth row of the LED display screen, and the process is the same as the scanning control process of the first row. After the control process of all 8 rows is completed, the LED display screen has completed the complete display of 1 frame of image.
Although in this working mode, the LED display screen lights up row by row, and only one row lights up at a time, as long as each row can be lit up more than 50 times per second, that is, the refresh rate is higher than 50 Hz, then due to human visual inertia, the image displayed on the LED display screen is still a full-screen stable image.
2 Traditional control methods of LED display screens
Reference [1] summarizes and compares the control circuits of LED display screens. Among them, the display control circuit works in a row scanning mode, and the column control circuit is divided into two categories. In the column control circuit, one category uses a chip such as 74LS377 as the latch of the column drive circuit, and the CPU writes the word model data to the latch of the column drive circuit through a parallel bus; the other category uses a chip such as a shift register 74LS595 as the latch of the column drive circuit, and the CPU writes the word model data to the latch of the column drive circuit through a serial bus.
Whether it is a parallel bus control mode or a serial bus control mode, the working process is to assign a value to the data pointer DPTR first, and then the accumulator A reads the font data from the external data storage RAM according to the direction of the data pointer DPTR. Then, in the case of a parallel bus, the data pointer DPTR is assigned a value again, and then the CPU writes the font data in the accumulator A to the latch of the LED dot matrix column drive circuit according to the direction of the data pointer DPTR; in the case of a serial bus, the CPU writes the font data in the accumulator A to the latch of the LED dot matrix column drive circuit through the serial port.
In general display control, the most commonly used single-chip microcomputer is the MCS51 series. Assuming that the crystal oscillator frequency of the single-chip microcomputer system is 12 MHz and the machine cycle is 1 μs, the above two control methods will take more than ten μs to complete the display control of one LED dot matrix piece.
The high-speed control scheme proposed in this paper can complete the display control of one LED dot matrix in about 4 μs. Based on this calculation, one MCS51 series microcontroller can control the display of more than 600 LED dot matrixes. Compared with traditional control methods, the efficiency of display control is doubled.
3 High-speed control solution for LED display
Figure 1 is the circuit principle of the high-speed control scheme LED display. The MCS51 series single-chip microcomputer is used to control the LED display; the random access memory 62512 is used as the data storage of the LED display to store the font data of the content to be displayed; the 8-row scanning method is adopted, and multiple LED dot matrix pieces share a group of row drive circuits; each LED dot matrix piece has a group of column drive circuits, and 74LS377 is used as the column drive latch. The CPU writes the font data to the latch of the column drive circuit through the parallel bus; the address decoding circuit is used to generate the chip select address of the LED dot matrix row drive circuit and column drive circuit.
Figure 1 High-speed control scheme LED display electrical principle [page]
This solution has two characteristics: First, although the CPU still writes the font data to the latch of the column drive circuit through the parallel bus, the latch signal of the latch uses the CPU control signal RD instead of the conventional WR; second, the address decoding circuit ensures that the chip select address of the LED dot matrix column drive circuit and the logical address of a certain section of the data memory are overlapping, instead of the conventional usage, the two sets of addresses must be separated.
Due to some simple changes in the above circuit, the display control efficiency of the single chip microcomputer on the LED display will change significantly. The specific working process is as follows: Assuming that the address of the data memory has been loaded into the data pointer DPTR, execute the instruction "MOVXA, @DPTR". The function of this instruction is that the CPU reads the font data from the external data memory according to the direction of DPTR and reads it into the accumulator A; but in this circuit, since the chip select address of the LED dot matrix column drive circuit and the logical address of a certain section of the data memory overlap, that is, when executing the instruction "MOVXA, @DPTR", DPTR not only points to a certain address of the external data memory, but also selects a latch of a certain LED dot matrix column drive circuit. If the latch pin of the selected latch happens to have an input pulse at this time, the latch will also lock the font data sent from the external data memory. This input pulse is used as RD. RD is the read control signal sent by the CPU to the external data memory when executing the instruction "MOVXA, @DPTR". Since the timing of the read control signal RD and the write control signal WR of the MCS51 series microcontrollers are exactly the same [2], it is not surprising that RD replaces WR to implement the latch function. When this instruction is executed, it completes the reading of the data memory and the writing of the LED dot matrix at the same time, thus speeding up the display control process.
As mentioned before, when the parallel bus is used, it takes about 10 μs for the CPU to complete the process of writing the font data to the latch of the column drive circuit of the LED dot matrix. Now it only takes 4 μs, which is much faster, because now it only takes two steps to complete the process of writing the font data to the latch of the column drive circuit of the LED dot matrix. First, assign a valid address to the data pointer DPTR, then the CPU reads the font data from the external data memory according to the direction of DPTR, and at the same time, it also transmits the font data to the latch of the column drive circuit of the LED dot matrix. 2 instructions, 4 machine cycles, 4 μs. Here we should add that when compiling the program of writing the font data to the latch of the column drive circuit of all LED dot matrix pieces, do not use loop instructions, because each process will increase 2 μs; adopt the method of programming the LED dot matrix piece by piece, so that the program compiled in this way takes up space, but saves time. The design method of using space for time is sometimes a method worth trying for designers.
The latch control of the row drive latch of this circuit still uses the write control signal WR of the CPU without any change. The chip select signal of the row drive latch also comes from the address decoding circuit. In order to avoid mutual interference between the data memory and the LED dot matrix, the storage space of the data memory corresponding to this group of addresses is not used.
The design of the address decoding circuit should ensure that the chip select address of the LED dot matrix column drive circuit and the logical address of a certain section of the data memory overlap. The specific design example is as follows:
Assume that a certain LED display screen uses 240 LED dot matrix pieces, which can display 60 16×16 Chinese characters, and uses a MCS51 series single-chip microcomputer for high-speed control. The chip select addresses of the column drive circuit of these 240 LED dot matrix pieces should be 240, and the address decoding circuit must ensure that the effective address after decoding is greater than this number. The address decoding circuit in Figure 1 inputs the address signals A0~A7 and A11~A15, and does not connect to A8, A9, and A10. Using the 74LS138 decoder, 256 effective address lines can be obtained after three-level decoding. The first effective address line corresponds to the 8 addresses of the external data memory: 0000H, 0100H, 0200H, 0300H, 0400H, 0500H, 0600H, and 0700H. The second valid address line corresponds to the 8 addresses of the external data memory: 0001H, 0101H, 0201H, 0301H, 0401H, 0501H, 0601H, 0701H. ... The 256th valid address line corresponds to the 8 addresses of the external data memory: 00FFH, 01FFH, 02FFH, 03FFH, 04FFH, 05FFH, 06FFH, 07FFH. Of these 256 valid address lines, 240 are chip select addresses for the column drive circuit, and the remaining are chip select addresses for the row drive circuit; if they are not enough, the row drive circuit can be controlled by serial bus. The above analysis results show that the I/O interface address of a LED dot matrix piece and the 8-byte address of the data memory have established an overlapping relationship. This is because each LED dot matrix piece has 8 rows, and each row corresponds to 1 byte of font data.
The above analysis results also show that the I/O interface addresses of all LED dot matrix slices and the address segment 0000H to 07FFH of the data memory have established a mapping relationship. The data memory 0000H to 07FFH stores exactly all the font data of a frame of image.
4 Application of high-speed control solutions in LED display screens
The large-screen LED display screens used in business now use hundreds, thousands or even tens of thousands of LED dot matrix pieces. The control of LED display screens by single-chip microcomputers includes three parts: communication between single-chip microcomputers and PCs, data processing of font data, and display control. A single-chip microcomputer must communicate with a PC, process data, and perform display control, which is definitely too busy.
In order to solve the control problem of large-screen LED display screens, many literatures have successfully designed control schemes. The basic idea of many schemes [36] is that data processing is completed by a single-chip microcomputer, and display control is completed by another single-chip microcomputer or a specially designed circuit. Although the control efficiency of these schemes is very high, the circuits are relatively complex.
Figure 2 Data memory segment selection switch circuit
The basic idea of this scheme is that the communication between the MCU and the PC, data processing and display control are all completed by a single MCU. The display control adopts the high-speed control scheme proposed in this article, the circuit is simple, and the display control efficiency is very high. For example, when the LED dot matrix uses the commonly used 6 cm × 6 cm LED dot matrix, when the screen area is less than 2 m2, a MCS51 series MCU can complete it. However, there are still some problems to be solved when the high-speed control scheme is used for large-screen LED displays:
① Communication problem between MCU and PC. When the large-screen LED display is connected to the PC, the PC is used to edit the content to be displayed and transmit the content to the MCU in the large-screen LED display. When the PC communicates with the MCU, it will not interfere with the work of the display. Because the display is working, it is displayed one by one, and there is a black screen time between the fields. There is no problem in using the black screen time for communication.
② The problem of increasing the number of display sessions. Most display screens work in a way that they display content one by one, one by one, and so on in a cycle. The previous design only considered the problem of establishing a mapping relationship between the I/O interface address of the LED dot matrix and a segment of the data memory when displaying a frame of image, so it can only display a frozen image. Adding Figure 2 on the basis of Figure 1 can establish a mapping relationship between the I/O interface address of the LED dot matrix and multiple segments of the data memory. When working, the multi-way switch is controlled by the P1 port to switch the mapping between different segments of the data memory and the I/O interface address of the LED dot matrix, so that the display screen can display one by one in a cycle. If the number of pieces of external data memory is expanded, and one of them is enabled by the P1 port, then more segments can be expanded to establish a mapping relationship with the I/O interface address of the LED dot matrix, so that some display effects such as curtain pulling and flowing water can also be realized.
③ The problem of data processing of font data. There are many display modes, such as freeze frame, curtain, and flowing water. The flowing water mode includes left flowing water, right flowing water, etc. When switching the display mode, the font data must be processed once. This will not be a problem if one single-chip microcomputer is used. Because when switching the display mode, the screen will be black for 1 s to several s, and this time is just right for data processing.
Conclusion
The high-speed control scheme of this LED display has been proven to be stable and reliable, and the circuit is simple, which is particularly suitable for bank exchange rate display and interest rate display. In addition, the idea of flexibly using read instructions proposed in this article can also be provided for people to learn from.
Previous article:Atmospheric temperature acquisition and recording system based on 51 single chip microcomputer
Next article:Design of coding, decoding and display experimental circuit based on 51 single chip microcomputer
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
- [Popular Science] IGBT - Starting from the name
- Relay protection device tester verification
- The circuit board cannot start normally after plugging in a power bank
- FPGA beginners ask for help with Verilog test code
- I found a very good 51 single-chip microcomputer tutorial book and recommend it to beginners for self-study of programming.
- PCB circuit board heat dissipation
- PCB board design method and key points analysis
- EEWORLD University - Write a container from scratch
- Thank you +EEWORLD community
- Ask a question about ADC selection