loading

The perfect choice of one-stop service for diversification of architecture.

How to Use USB Interface to Realize the Design of LED Display System

Cooperate with driving LED display to realize high-speed data transmission. The application software processes text messages and communicates with USB devices. The design can dynamically display text information after testing.

1 Introduction

LED display screen is a display device composed of several light-emitting diodes. It adopts low-voltage scanning drive, which has the advantages of low power consumption, long service life, low cost, high brightness, large viewing angle, long visual distance, many specifications and varieties. It is widely used in tips, instructions, advertisements and so on in many public places.

This design includes hardware and software. The hardware includes the drive and control of LED display. The driving part is responsible for providing appropriate driving current to the specified LED light-emitting device according to the row and column gating signal; The control part adopts CY7C68013A microprocessor integrating USB2.0 to realize USB communication and control of row column shift register system. The software includes firmware program, driver and application software written in Keil C51 environment. The firmware program controls the hardware to complete the corresponding functions; The driver provides a software interface of the hardware device connected to the computer; The application software processes the graphic information and communicates with the USB device. The structural block diagram of this design is shown in Figure 1.

2 hardware design

2.1 display and drive design

The LED display screen of this design is shown in Figure 1 × 16 LED dot matrix display, using 16 8 × 8 modules, consisting of 4 16 × 16 dot matrix. Each 16 × The 16 dot matrix displays one Chinese character, so the LED display can display four Chinese characters.

Due to the limited driving capacity of I / O port, PNP transistor is used for column driving. About 20mA driving current is required to light each LED device. In order to meet the driving current of about 320mA required to light 16 LEDs at the same time, the emitter of PNP transistor is connected to the power supply, the collector is connected to the LED anode, and the base is connected to the 74HC595 output through the current limiting resistance. In this way, using the current amplification function of the transistor, the output of the 74HC595 only needs to provide a driving current of a few milliamps to control the on and off of the corresponding LED. Part of the driving circuit is shown in Figure 2.

2.2 control design

The USB interface of this design adopts the microprocessor CY7C68013A integrating USB2.0. Its advantage is that it integrates USB2.0 transceiver, intelligent SIE, enhanced 8051 microcontroller and programmable peripheral interface. The data transmission rate reaches 56mbyte / s. It can process USB1.1 and USB2.0 protocols in hardware, so as to reduce development time, ensure USB compatibility and improve hardware integration and reliability.

The peripheral circuit of CY7C68013A mainly includes power supply (5v-3.3v conversion) circuit, serial I2C bus circuit and reset and wake-up circuit. The specific circuit can refer to the literature.

The basic working principle of LED display is dynamic scanning. Dynamic scanning is divided into row scanning and column scanning. This design adopts line scanning mode.

8 in the same line × The same name row control pin of the 8-dot matrix module is connected to one line, a total of 16 lines, which are connected to the row shift register system. Two 8 in the same column × The column control pin of the same name of the 8-dot matrix module is also connected to one line, a total of 64 lines, which are connected to the column shift register system. The row shift register system consists of two 74HC595 and the column shift register system consists of eight 74HC595.

Take the line shift register system as an example: the DS (serial data input) end of the first chip is controlled by an I / O port of CY7C68013A; Sh of the first and second 74HC595_ CP (clock pulse of shift register), St_ The CP (clock pulse of storage register) and OE (output enable end) terminals are connected together respectively and controlled by an I / O port; The Q7 (serial output) end of the first chip is connected with the DS of the second chip; MR (chip reset) termination high level; O1 - O7 (parallel data output) terminals are respectively connected with the corresponding LED row control pins.

CY7C68013A in Sh_ The CP terminal generates 16 consecutive rising edges of clock pulses, sends the 16 bit binary number 0x01 into the two shift registers in turn, locks it in the latch, and then stores it in the St_ The CP terminal generates a rising edge of clock pulse and outputs 0x01 to the corresponding 16 row control pin lines in parallel, so that the LED cathode of the first row is low level and the LED cathode of other rows is high level. At this time, the corresponding font is sent to the column drive system. If the LED anode of the column is high level, the corresponding LED is lit. If the LED anode of the column is low level, the corresponding LED is dark. Select the second to sixteenth rows in turn, send the corresponding font to the column drive system, and light the corresponding LED. When the font on the 16th line is displayed, it will be displayed from the first line, so that the LED display screen will display the corresponding Chinese characters.

According to this working mode, the LED display is lit line by line, and only one line is lit each time. However, since the maximum visual retention time of human eyes is 1 / 16 S, as long as the designed scanning cycle time (the time spent from the first column to the last column) is less than 1 / 16 S, you can still see a stable image on the full screen.

3 software design

3.1 firmware programming

Firmware program refers to the program running in the device CPU. Only when the program is running can a peripheral be called an external device with a given function. The firmware program is written in Keil C51 environment.

C51 compiler package can be used on all 8051 series processors and can be executed on the w indows 32-bit command line. The firmware program flow chart of this design is shown in Figure 3.

After the hardware device is powered on / reset, the work distributor function TD_ Init() initializes the microprocessor, and then calls the job allocator function TD_ Poll() starts sampling to judge whether ep2out interrupt occurs. If an interrupt occurs, enter the interrupt processing function int_ Ep2out(), put the data transmitted by the upper computer through the USB bus into the ep2outbuf, drive the rows and columns of the LED display screen in turn according to these data, and update the LED display. After the interrupt processing, it returns to the start sampling stage to repeatedly judge whether there is an interrupt process. If no interrupt occurs, continue to maintain the LED display, and then return to the start sampling stage to repeatedly judge whether there is an interrupt process.

The function to display the font on line I is as follows:

chooseraw_ 5950 ( i) ; / / Select line I

choosELine_ 5951 ( a, b) ; / / The first word corresponds to the font of line I

chooseline_ 5951 ( c, d) ; / / The second word corresponds to the font of line I

chooseline_ 5952 ( e, f) ; / / The third word corresponds to the font of line I

chooseline_ 5952 ( g, h) ; / / The fourth word corresponds to the font of line I

stcp0 = 0; stcp1 = 0; stcp2 = 0;

stcp0 = 1; stcp1 = 1; stcp2 = 1; / / st_ The CP terminal generates a pulse rising edge and the data is output in parallel

delay_ ms (3) ; / / Delay 3MS

3.2 driver design

DDK is used to develop the driver, DDK compiler build is used to compile the driver, and softice in DriverStudio toolkit is used to debug the driver [5].

The routines used by the driver include: driver entry routine, plug and play routine, distribution routine, power management routine and unloading routine.

The writing of the driver is related to the USB transmission mode and other information defined in the firmware. In the firmware, the endpoint EP2 is used as the batch transmission endpoint in the out direction to store the data to be sent to the peripherals.

3.3 application software design

Because it involves the problem of communication with USB, this design uses the combination of dynamic link library (DLL) and application program to write application software. The dynamic link library uses the driver to establish the communication with the underlying hardware, and the application program provides users with an intuitive software interface to facilitate operation.

The application program can use different algorithms to realize the rolling display of text, such as moving left, moving right, turning up, turning down, etc.

4 Conclusion

The LED display system of this design adopts USB bus communication to realize the static and dynamic display of text, and meets the design requirements.

Compared with serial port, USB interface can improve the data transmission rate.

The row and column drive system of LED display screen adopts serial input to parallel output shift register, which makes the expansion very convenient. Calling different text libraries, the system can display Chinese characters, numbers, letters and symbols of different fonts, as well as custom pictures.

How to Use USB Interface to Realize the Design of LED Display System 1

GET IN TOUCH WITH Us
recommended articles
Related Blogs blog
Although GPR has been widely used in hydrology, engineering, environment and other fields, many basic theoretical and technical problems have not been fundamentally ...
So I am thinking of a possible answer to my own question:Build my own journal note entry app linked to a wiki.Zim Wiki uses a file based system for wiki. Maybe I cou...
About 8 I think1. where can i get ncaa football 10 rosters with names?For the last two years I got mine from "Pastapadre". From what i can tell they are really prett...
The Haunting I vaguely remember some kind of eye injury in the movie.• Other Related Knowledge ofa cocktail glass— â€&...
rsync can be somewhat painful if you have a very large number of files - especially if your rsync version is lower than 3. On the other hand: if you use tar, you wou...
Blockchain Technology Explained: Powering BitcoinMicrosoft recently became the latest big name to officially associate with Bitcoin, the decentralized virtual curren...
PLEASE HELP ME CHOOSE A VIDEO CAMERA!?the Flip ultra HD is a really good HD portable camcorder, and it's fairly cheap. A lot of famous youtubers use it, such as timo...
In order to implement the tasks proposed in the outline of the national medium and long term science and technology development plan (2006-2020), the national key R ...
Alibaba group and Royal Philips of the Netherlands announced that they have officially signed an IT infrastructure service framework agreement to jointly promote the...
but it seems the company has disappeared and you can only get it from other sites such as Canadian Content.It works on Windows 7 and due to the nature of the OSes, t...
no data
Customer service
detect