“In the application of LED Display screen, the ultra-long strip LED screen is a very wide form, which is characterized by “extraordinarily long” length and narrow width. There is currently no clear definition for the ultra-long LED display, and it is more appropriate to define the number of points in the horizontal direction as ≥2 048.
“
In the application of LED display screen, the ultra-long strip LED screen is a very wide form, which is characterized by “extraordinarily long” length and narrow width. There is currently no clear definition for the ultra-long LED display, and it is more appropriate to define the number of points in the horizontal direction as ≥2 048.
Taking the ultra-long strip LED display composed of 1/4 scanning P10 unit board (dot spacing 10 mm) as an example, when the number of dots in the horizontal direction is 2 048, its physical size in the horizontal direction is 20.48 m. LED screen The width (vertical direction) points are generally 16, 24 and 32 points, with a maximum of 64 points. In the application, Chinese characters that can display a line of various fonts are mainly used. In order to ensure the refresh rate, in the control of the ultra-long LED display, it is required to send more data within the specified time, and it is difficult for the ordinary LED display control card to achieve the control requirements.
Based on the analysis of various existing strip LED display unit board circuits, this paper proposes an LED display control system based on multi-port serial Flash memory. The SPI interface of the microcontroller is used to generate a controllable clock, and the display data in the multi-port serial Flash memory is directly output to the ultra-long strip LED display by “DMA” mode.
1 Commonly used unit board internal serial shift register connection method
Figure 1 shows the connection methods of the internal serial shift registers of three common cell boards. Figure 1(a) shows the connection relationship between the unit board 74HC595 and the LED light-emitting tube dot matrix and the simplified representation circuit. The serial shift register used in the LED display unit board is generally 74HC595, MBI5026 or MBI5026 compatible chip, and MBI5026 can be regarded as a cascade of two 74HC595, which is a constant current source driving mode, which is more suitable for LED driving.
Figure 1 (b), (c), (d) are the connection methods of the P10, P16, F3.75 or F5.0 unit boards, respectively.
LED display control design based on multi-port serial Flash memory Figure 1 3 common cell board internal serial shift register connection methods 2 Problems and solutions faced by ultra-long LED display
At present, a large number of door screens (strip LED displays) on the market are the most widely used form of LED displays. Technically speaking, the horizontal point of the door screen is from 256 points to thousands of points, and the height is generally not more than 64 points. With the improvement of market demand and display accuracy, the demand for ultra-long LED displays with a length of thousands of dots is increasing. It is difficult for ordinary LED display control cards to meet the refresh rate requirements. Taking an F3.75 LED display with 4 096 pixels in length as an example, set the refresh rate to 60 Hz and its SCK clock cycle to be at least 106 /60 / 16 / 4 096 = 0. 254 μs = 254 ns.
There are two ways to solve the data output of the ultra-long LED display: one is to choose a high-performance embedded processor and FPGA chip, the cost of the control card is high; the other is to cleverly apply the special functional components on the single-chip microcomputer and optimize the data organization algorithm , the cost of this method is very low. The second method is adopted in this paper. The data is written into the multi-port serial Flash memory SST26VF016B in advance through the optimization algorithm, and the SPI part of the STC12C5616 microcontroller is used to generate a high-speed controllable SCK clock, and the display data in the multi-port serial Flash memory is converted. It is directly output to the super-long LED display screen in the “DMA” mode to meet the display requirements of the super-long LED display screen.
The height of the super-long LED display screen is generally not more than 64 points. If it controls a 1/16 scan monochrome LED display screen, the 4-bit data port of the SST26VF016B memory just meets the needs of the data port width of the LED display screen. Figure 2 shows the control sequence of the SST26VF016B memory, CS is the chip select end of the SST26VF016B memory, all operations on the memory must be performed when CS is low; SCK is the clock line, when the idle mode, the SCK signal can be low. Level state (MODE 0), can also be in high level state (MODE 3); SIO (3: 0) is a 4-bit data port, during data transmission, the upper 4 bits of the byte are transmitted first, and then the byte is transmitted the lower 4 bits. It can be seen from the control timing of the memory that the control of the memory is sent in the order of command word, 24-bit storage address, virtual byte, data byte 0 to data byte N. The command word of the memory can realize the functions of chip erasing, sector erasing, single-byte reading and writing, continuous byte reading and writing, etc., which can fully meet the requirements of the super-long LED display for the capacity and control mode of the memory.
LED display control design based on multi-port serial Flash memory Figure 2 SST26VF016B memory control sequence.
STC12C5616 is a high-speed 1T single-chip microcomputer introduced by STC, with a clock frequency of more than 30 MHz. It integrates a high-speed serial communication interface component (ie SPI interface). When the SPI part of STC12C5616 works in master mode, its SPI clock output frequency (fclk) can reach 1/4 times the crystal oscillator frequency (fosc), and its clock phase and clock polarity can be flexibly configured, which not only meets the requirements of SST26VF016B memory Control requirements, but also meet the clock requirements of the ultra-long LED display.
3 Circuit design of control card for super long LED display
Using the multi-bit data port memory of the serial flash memory SST26VF016B and the SPI part of the STC12C5616 microcontroller can generate a high-speed SCK clock, the display data is bypassed from the serial flash memory and output to the LED display. The circuit is shown in Figure 3.
When the dynamic refresh rate of the display screen reaches 50 times/s, on the LED display screen with 1/16 scan, the display time of one line should be less than 1/50/16 s, that is, 1. 25 ms. In the design of the control card, when When fosc = 22 MHz, the serial Flash clock frequency fclk = 1 /4 fosc = 5.5 MHz, so the time required for 4 096 CLK clocks is 4 096 × 1 / (5. 5 × 106 ) s = 0. 744 ms, plus the time to send memory instructions and addresses using the SQI protocol is also less than 1.25 ms, so in Figure 3, the external clock of the microcontroller STC12C5616 selects the 22 MHz clock, which can ensure that 4 096 overclocks can be achieved in the SQI protocol mode. Display on the long display.
The external clock of the single-chip STC12C5616 is 22.1184 MHz, which is convenient for the precise control of the serial port baud rate; pins P3. The communication connection; pins P2.0 ~ P2.3 are 4-bit data lines, which are connected to the 4-bit data port of the memory SST26VF016B on the one hand, and connected to the data line of the output interface of the LED unit board after being driven by 74HC245 superior. Two single-color LED unit board output interfaces are designed on the control card. Interface J1 uses data lines D0 and D1, and interface J2 uses data lines D2 and D3; pin P1.7 is SPI clock output, and the SPI clock output lines are connected at the same time Clock input to the serial flash memory SST26VF016B and the LED unit board; pin P1.4 is the chip select signal of the serial flash memory SST26VF016B; pin P3.5 is the data latch signal of the LED unit board; pin P3.7 It is the enable signal output of the LED unit board; pins P1.0 ~ P1.3 are the row selection signal output of the LED unit board; J1 and J2 connectors are used to connect the LED unit board of the display screen in the height direction to meet the 64-point height requirement for door header screen.
The design of this circuit can flexibly implement 3 different data access modes among the microcontroller, serial memory and LED unit board, namely:
(1) Normal access between the microcontroller and the memory.
As can be seen from Figure 3, the connection between the microcontroller STC12C5616 and the serial flash memory SST26VF016B is based on the data manual, which can realize normal data access, and the data will also enter the shift register buffer on the LED unit board. However, as long as the data latch RCK on the LED unit board does not get a valid signal, the data entering the LED unit board is invalid data that is not displayed.
(2) Data communication between the microcontroller and the LED unit board.
Set pin P1.4 of the single-chip microcomputer to a high level, that is, the enable terminal of the serial Flash memory is invalid. At this time, the data port of the memory is in a high-impedance state, and the data communication between the single-chip microcomputer and the LED unit board will not be affected by the memory data port. The data of the single-chip microcomputer can be normally output to the LED unit board.
(3) Data transfer between memory and LED display.
First, the mode (1) is adopted, the single-chip microcomputer first outputs the command word, storage address and virtual byte to the serial memory, and then sets all the data ports P2. The line memory reads the display data, and at the same time enters the LED unit board in “DMA” mode. After reading a line of data, a valid signal is generated on the data latch terminal RCK of the LED unit board, and the line data can be displayed. When using this mode, be sure to set the pins P2. 0 ~ P2. 3 of the microcontroller STC12C5616 to “weak pull-up” mode.
4 Super long LED display screen to display program design
In the hardware circuit design of 1/16 monochrome LED display, 74HC595 is connected in a straight-through way. According to the characteristics of the straight-through mode, the monochromatic display data is optimized in advance, and the organized display data is stored in the serial Flash memory SST26VF016B in advance. As shown in Figure 4, when the single-chip microcomputer outputs and displays the data of each line, repeat the sequence of “output data → send shift pulse → add 1 to the address”. After a line is displayed, RCK is latched and displayed, and the line strobe line is switched through ABCD.
LED display control design based on multi-port serial Flash memory Figure 4 1/16 scan monochrome F3. 75 or F5. 0 unit board (64 × 32 points) connection.
|
Taking the horizontal point of the LED display as 4 096 points as an example, the program code for displaying one frame of data is as follows:
woid Display(unsigned long begin_Addr)
{
unsigned char Ln
Bv = 1;
unsigned int Data_Length, Lw = 4096;
unsigned long Addr;
Data_Length = Bv* Lw
);
for ( Ln = 0; Ln {
Addr = Begin_Addr + Ln* Data_Length;
cs = 0;
SendSQI_Byte (0x0B); //Send read command
//Send 3 byte address
SendSQI_Byte((Addr>16)&0xff);
SendSQI_Byte((Addr>8)&0xff);
SendSQI_Byte((Addr&0xff);
SendSQI_Byte((0xff); //Send dummy byte
P2 = P2 | 0x0f;
SPCTL = 0xd0; // Enable SPI interface
SPDAT = 0xff; //Start the first SPI transmission
Data_Length = (Data_Length > 3) – 1;
while(Data_Length != 0)
{ //The SPI clock transmits 8 pulses at a time
while((SPSTAT&0x80)==0);
SPSTAT = 0x80; //clear the receive flag
SPDAT = 0xff; //Start SPI transmission
Data_Length — ;
}
while((SPSTAT&0x80)==0);
SPSTAT = 0x80; //clear the receive flag
SPCTL = 0x90; // disable SPI interface
CS = 1; /* disable devicce */
EN = 0;
RCK = 1; RCK = 0;
PI = (( P1 & 0xf0) | Ln
);
en = 1;
}
}
When designing a program, turn off the display only when wrapping, so that it doesn’t have an afterglow, and keep it on the rest of the time. In this program, Bv is the number of 595 groups used in the vertical direction of the data line; Lw is the number of pixels in the horizontal direction of the LED display screen; Ln is the current data line number displayed on the LED display screen. When displaying data, the data output mode of memory and LED display screen is adopted. The single-chip microcomputer first outputs the “read data” command word “0x0B” to the serial memory, then outputs the 24-bit address and virtual byte, and then makes the data port of the single-chip microcomputer output high. level, the SCK pulse can be output according to the length of the LED display. After sending a line of data, disable the SPI interface, the RCK latch signal is valid, switch to the next line, and continue to output display data according to the repeating steps.
5 test
After the test, the display screen shows normal and there is no jitter, and the refresh rate is tested with a logic analyzer. As shown in Figure 5(b), the level width of signal A indicates the time required to display 1 line, and its width is 1. 036 16 ms, the time to display 1 frame is 16 × 1. 036 16 ms≈16 ms, so the refresh rate of the LED display is 1/16 ms = 62. 5 Hz. And when the refresh rate of the LED display is greater than 50 times/s can meet the design requirements, so this design can meet the normal display requirements. By testing the SCK signal, as shown in Figure 5(a), it can be seen that the SCK signal has a group of 8 pulses, and the time interval between each group is only 570 ns. This time is mainly consumed in judging the SPI data transmission completion flag and loop control.
LED display control design based on multi-port serial Flash memory Figure 5 LED display signal test
6 Conclusion
In this paper, an LED display control system based on multi-port serial Flash memory is proposed. The SPI interface of the microcontroller is used to generate a controllable clock, and the display data in the multi-port serial Flash memory is directly output to the ultra-long strip LED by “DMA”. display.
Its manufacturing cost is low. According to the program and the timing diagram obtained by the logic analyzer, this method can control a 4 096 × 64 dot-matrix monochrome LED display, and has a good application prospect in the ultra-long display market.
The Links: TPS2540RTER G121SN01-V4