Strip LED display screen control based on multi-port serial Flash

Publisher:码上奇迹Latest update time:2012-11-21 Source: 维库电子Keywords:Flash  control Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: In order to increase the output speed of display data without increasing the hardware cost, a LED display control system based on multi-port serial Flash memory is proposed based on the analysis of the existing strip LED display unit board circuit. The system consists of STC12C5616 high-speed 1T single-chip microcomputer and SST26VF016B serial multi-port Flash memory with SPI interface. When the display data is output, the high-speed synchronous serial port (SPI) high-speed clock of the single-chip microcomputer is used to directly output the display data in the multi-port serial Flash memory to the ultra-long strip LED display in the form of "direct memory access (DMA)". Finally, a 4 096 × 64 dot matrix monochrome LED display is tested as an example. The results show that the refresh rate of the display reaches 62. 5 Hz, which verifies the effectiveness and feasibility of the system in practical applications.

In the application of LED display screens, the ultra-long strip LED screen is a very common form, which is characterized by "extra-long" length and narrow width. There is no clear definition of ultra-long LED display screens at present, and it is more appropriate to define the number of dots in the horizontal direction as ≥2 048.

Take the ultra-long strip LED display composed of 1/4 scan P10 unit board (dot pitch 10 mm) as an example. When the number of dots in the horizontal direction is 2048, its physical size in the horizontal direction is 20.48 m. The number of dots in the width (vertical direction) of the LED screen is generally 16, 24 and 32, and no more than 64 dots. The application is mainly to display a line of Chinese characters in various fonts. 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. It is difficult for ordinary LED display control cards to achieve 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 in "DMA" mode.

1 Commonly used unit board internal serial shift register connection method

Figure 1 shows three common ways to connect serial shift registers inside unit boards. Figure 1 (a) shows the connection relationship between the unit board 74HC595 and the LED light-emitting tube matrix and the simplified circuit. The serial shift registers used inside the LED display unit board are generally 74HC595, MBI5026 or MBI5026 compatible chips, and MBI5026 can be seen as two 74HC595 cascaded chips, which is a constant current source drive mode and is more suitable for LED driving.

Figure 1 (b), (c), and (d) show the connection methods of P10, P16, F3.75, or F5.0 unit boards, respectively.

Figure 1 Three common cell board internal serial shift register connection methods

Figure 1 Three common cell board internal serial shift register connection methods

2 Problems and solutions faced by ultra-long LED displays

At present, a large number of door head screens (strip LED display screens) on the market are the most widely used form of LED display screens. Technically speaking, the horizontal dots of door head screens range from 256 to thousands of dots, and the height generally does not exceed 64 dots. With the improvement of market demand and display accuracy, the demand for ultra-long LED display screens with a length of thousands of dots is increasing. Ordinary LED display screen control cards are difficult to meet the requirements of refresh rate. For example, take the F3.75 LED display screen with a length of 4096 pixels. Assuming the refresh rate is 60 Hz, its SCK clock cycle is at least 106/60/16/4096 = 0.254 μs = 254 ns.

There are two ways to solve the problem of data output of super long LED display screen: one is to select high-performance embedded processor and FPGA chip, which has high control card cost; the other is to cleverly apply special functional components on the microcontroller and optimize the data organization algorithm, which is very low cost. This article adopts the second method, which uses the optimization algorithm to pre-write the data into the multi-port serial Flash memory SST26VF016B, and uses the SPI component of the STC12C5616 microcontroller to generate a high-speed controllable SCK clock, and outputs the display data in the multi-port serial Flash memory directly to the super long strip LED display screen in "DMA" mode, meeting the display requirements of the super long LED display screen.

The height of an ultra-long LED display screen is generally no more than 64 dots. If a 1/16 scan monochrome LED display screen is controlled, 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 timing of the SST26VF016B memory. CS is the chip select terminal of the SST26VF016B memory. All operations on the memory must be performed during the period when CS is low. SCK is the clock line. When in idle mode, the SCK signal can be in a low state (MODE 0) or a high state (MODE 3). SIO (3: 0) is a 4-bit data port. When transmitting data, the high 4 bits of the byte are transmitted first, and then the low 4 bits of the byte are transmitted. From the control timing of the memory, it can be seen 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 functions such as chip erase, sector erase, single-byte read and write, and continuous byte read and write, which can fully meet the requirements of ultra-long LED display screens for memory capacity and control methods.

Figure 2 SST26VF016B memory control timing.

Figure 2 SST26VF016B memory control timing.

STC12C5616 is a high-speed 1T microcontroller launched by STC. Its clock frequency can reach more than 30 MHz. It integrates a high-speed serial communication interface component (i.e., SPI interface). When the SPI component 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 for SST26VF016B memory control, but also meets the requirements for the clock of the ultra-long LED display.

3. Ultra-long LED display control card circuit design

By utilizing the multi-bit data port memory of the serial Flash memory SST26VF016B and the SPI component of the STC12C5616 microcontroller that can generate a high-speed SCK clock, the display data is bypassed from the serial Flash memory to the LED display screen. The circuit is shown in Figure 3.

Figure 3: Circuit diagram of the extra-long LED display screen control card.

Figure 3: Circuit diagram of the extra-long LED display screen control card.

When the dynamic refresh rate of the display reaches 50 times/s, on the 1/16 scan LED display, 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 fosc = 22 MHz, the serial Flash clock frequency fclk = 1/4 fosc = 5.5 MHz, so the time required for 4096 CLK clocks is 4096 × 1/(5.5 × 106) s = 0.744 ms, plus the time for sending memory instructions and addresses using the SQI protocol is also less than 1.25 ms. Therefore, in Figure 3, the external clock of the microcontroller STC12C5616 selects a 22 MHz clock, which can ensure the display of a 4096 ultra-long display screen under the SQI protocol.

The external clock of the microcontroller STC12C5616 selects 22.1184 MHz, which is convenient for precise control of the serial port baud rate; pins P3.0 and P3.1 are UART interfaces, and the communication connection between the control card and the PC is realized through the communication interface chip MAX232 chip; 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 on the other hand. There are two monochrome LED unit board output interfaces 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 line is connected to the serial Flash memory SST26VF016B and the clock input of the LED unit board at the same time; 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 is the enable signal output of the LED unit board; Pins P1.0 ~ P1.3 are the row selection signal outputs of the LED unit board; J1 and J2 connectors are used to connect the LED unit board in the height direction of the display screen to meet the 64-point height requirement of the door head screen.

The design of this circuit can flexibly realize three different data access modes between 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 connected in accordance with the data manual, and normal data access can be achieved. At the same time, 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 receive 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 the MCU pin P1.4 to a high level, that is, invalidate the enable end of the serial Flash memory. At this time, the data port of the memory is in a high-impedance state. The data communication between the MCU and the LED unit board will not be affected by the memory data port, and the MCU data can be output normally to the LED unit board.

(3) Data transmission between the memory and the LED display screen.

First, use the first mode (1). The MCU outputs the command word, storage address and virtual byte to the serial memory first, then sets the data ports P2.0 ~ P2.3 of the MCU to high level, reads the display data from the serial memory through the SPI clock, and enters the LED unit board in "DMA" mode. After reading a row of data, a valid signal is generated on the data latch terminal RCK on the LED unit board, and the row of data can be displayed. When using this mode, be sure to set the pins P2.0 ~ P2.3 of the MCU STC12C5616 to "weak pull-up" mode.

4. Ultra-long LED display display program design

In the hardware circuit design of 1/16 monochrome LED display screen, 74HC595 is connected in direct connection mode. According to the characteristics of direct connection mode, the monochrome display data is optimized and organized in advance, and the organized display data is pre-stored in the serial Flash memory SST26VF016B. As shown in Figure 4, when the microcontroller outputs and displays each line of data, it repeats the order of "output data → send shift pulse → address plus 1". After displaying a line, RCK latches the display and switches the line selection line through ABCD.

Figure 4 1/16 Scanning monochrome F3.75 or F5.0 unit board (64 × 32 dots) connection method.

Figure 4 1/16 Scanning monochrome F3.75 or F5.0 unit board (64 × 32 dots) connection method.

Taking the LED display screen with 4096 dots in the horizontal direction 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 < 16; Ln + + )

{

Addr = Begin_Addr + Ln* Data_Length;

CS = 0;

SendSQI_Byte(0x0B) ; //send read command

//Send 3 bytes 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)

{ //SPI clock transmits 8 pulses each 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 device */

EN = 0;

RCK = 1; RCK = 0;

PI = ( ( P1 & 0xf0 ) | Ln

) ;

EN = 1;

}

}

When designing the program, the display screen is turned off only when the line is changed to avoid it from producing afterglow, and it is lit at other times. In this program, Bv is the number of groups of 595 used by the data line in the vertical direction; Lw is the number of pixels in the horizontal direction of the LED display screen; Ln is the row number of the data displayed on the current LED display screen. When displaying data, the data output mode of the memory and the LED display screen is adopted. The microcontroller first outputs the "read data" command word "0x0B" to the serial memory, and then outputs the 24-bit address and virtual byte, and then makes the microcontroller data port output a high level, and then the SCK pulse can be output according to the length of the LED display screen. After sending a line of data, the SPI interface is disabled, the RCK latch signal is valid, and it switches to the next line, and continues to output the display data according to the repeated steps.

5 Testing

After testing, the display screen is normal without jitter. The refresh rate is tested with a logic analyzer, as shown in Figure 5 (b). The level width of signal A represents the time required to display one line, and its width is 1.036 16 ms. The time to display one frame is 16 × 1.036 16 ms ≈ 16 ms, so the refresh rate of the LED display screen is 1 / 16 ms = 62.5 Hz. When the refresh rate of the LED display screen is greater than 50 times/s, it 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 8 pulses per group, 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.

Figure 5 LED screen signal test

Figure 5 LED screen signal test

6 Conclusion

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 in "DMA" mode.

Its manufacturing cost is low. According to the program in this paper and the timing diagram obtained by the logic analyzer, this method can control a 4 096 × 64 dot matrix monochrome LED display screen, and has a good application prospect in the ultra-long display screen market.

Keywords:Flash  control Reference address:Strip LED display screen control based on multi-port serial Flash

Previous article:Dealing with backlight driver interference in smartphones
Next article:100W High Reliability LED Bulb Driver Design

Recommended ReadingLatest update time:2024-11-16 20:34

Solution to JLink Nor Flash Programming Error
I was watching Guoqian's teaching videos recently. In the Guoqian Experience Class 2-1 (Development Board System Installation - Jlink Method), the method of burning the nor flash directly without any configuration was successful purely by chance! In the video, there were also two errors when burning, which were mistak
[Microcontroller]
Analyzing NOR Flash Timing (S3C2440)
The timing of the programmable access cycle of the S3C2440 memory controller is: The time parameters (Tacc, Tacs, Tcoh, etc.) in the above figure are all programmable. Let's take a look at the timing of NOR Flash: All we need to do is set the timing of the S3C2440 Nor Flash controller (BANK0 of the memory contro
[Microcontroller]
Analyzing NOR Flash Timing (S3C2440)
Use J-Link to burn bootloader to Mini2440 Nor Flash
1 Development Environment     Host: Windows + VMWare + Ubuntu16.04     Development board: Mini2440     Emulator: JLink V8 2 Wiring and drive     The wiring diagram is shown below:                           Figure 1 J-Link and Mini2440 wiring diagram Download the driver and install it, then open J-Link Commander. If
[Microcontroller]
Combined with the firmware library to discuss STM32 read and write FLASH steps and HardFault problems
In a single-chip microcomputer system, the program is usually stored in flash, and the data that is not easy to lose is usually stored in EEROM (such as the AT24C02, AT24C256 that we often use). It is generally not recommended to store frequently read and written data in Flash. On the one hand, FLASH in a single-chip
[Microcontroller]
HuaDa Electronics MCU CIU32L061x8 Memory (Flash) II
5.3.5 User flash area erase operation The User flash area supports the following erasing methods: l Page Erase (512 bytes) l Block Erase (16KB) l Bulk Erase (128KB) When the Flash memory is performing an erase operation, the read operation cannot be performed at the same time. The read opera
[Microcontroller]
【MPC5744P】Flash structure, boot principle and memory mapping
Like most MCUs, the Flash, RAM and peripherals of MPC5744P are mapped to memory addresses. The following is the mapping address range: There are several ways to categorize Flash. Method 1: EEPROM, Small, Medium, Large Flash. Method 2: Low, Medium, High, First256K, Second256K. The second method mentioned a
[Microcontroller]
【MPC5744P】Flash structure, boot principle and memory mapping
STM32F407 hardware SPI read and write SST25VF flash memory flash code
void SPI_FLASH_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; SPI_InitTypeDef SPI_InitStructure; NVIC_InitTypeDef NVIC_InitStructure;   /* Enable the SPI periph */ RCC_APB2PeriphClockCmd(FLASH_SPI_CLK, ENABLE);   /* Enable SCK, MOSI and MISO GPIO clocks */ RCC_AHB1PeriphClockCmd(FLASH_SPI_SCK_
[Microcontroller]
Memory Morgan Stanley: NOR Flash prices may peak in Q4
Following the "memory winter theory" in August, Morgan Stanley released a report on Monday (18th) that once again predicted a bearish market, believing that NOR Flash prices may peak in the fourth quarter, and therefore downgraded the ratings of suppliers such as GigaDevice, Macronix, and Winbond Electronics by one le
[Mobile phone portable]
Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号