1 Introduction
In a large shopping mall, station, dock, Metro stations and various Office window, and so more and more sites use LED dot matrix display graphics and characters.
LED industry has become a fast development of new industries, markets, huge room and bright future. With the rapid development of information industry, LED display as information dissemination of an important tool, has been widely used in indoor and outdoor needs service content and the service principle of publicity in public places, such as indoor and outdoor public places advertising, Airport Station Visitors Guide information, bus stop system, securities and banking information is displayed, as shown in the restaurant offer information bean, highway variable information board, stadium match broadcasting, buildings, lighting, traffic lights, landscape lighting, etc. Obviously, LED displays have become urban lighting, modernization and the information society and an important indicator.This article is based on a single chip (AT89C51) describes 1616 LED matrix display Chinese characters in the basic principle, hardware composition and design, program compilation and download, and other basic links and related technologies.
2 hardware circuit composition and working principle
This product is intended to be used for the core chip MCU AT89C51 circuitry to achieve, mainly by AT89C51 chip, clock circuit and the reset circuit, column scanning driver circuit (74HC154), 1616 LED dot matrix 5 parts, as shown in Figure 1.
Among them, is a kind of belt AT89C51 4 kB Flash erasable programmable read-only memory (Erasable and Programmable Read Falsh OnlyMemory, FPEROM), low voltage, high-performance CMOS 8-bit microprocessor, microcontroller.
The device uses the ATMEL high density non-volatile memory technology, and industry standard MCS-51 instruction set and output pin compatible. Due to the versatile 8-bit CPU and Flash memory in a single chip, to 1 000 write/erase cycles, data retention period is 10 years. He is a high-performance micro-controller, as a lot of embedded control system provides a flexible and affordable options. Therefore, the intelligent electronics design and manufacturing process often used AT89C51 chip.Clock circuit consists of 18, and 19 AT89C51 foot clock end (XTALl and XTAL2) and 12 MHz crystal oscillator capacitor C2, X1, C3, using on-chip oscillator.
Reset circuit with simple power-on reset circuit, mainly by the resistance of the R1, R2, capacitor C1, switch K1, respectively-AT89C51-RST-reset input.
LED dot matrix display with 1616 total 256 pixel matrix, led by multimeter test method tests to figure out the distribution of pin dot matrix, as shown in Figure 2.
We received the ranks in SCM bus IO port, then the above analysis to scan the code give bus, you can get a display of Chinese characters.
But if the LED dot matrix of port all direct access 89S51 microcontroller, you need to use 32 IO IO, causing a run out of resources, the system has no room for expansion. Therefore, in practice only LED dot matrix of 16 line cord directly connected to P0 and P2, and as for the column is selected scan signal is composed of 4-line decoders/demultiplexers 74HC154 to select the control that this column is selected control only uses a single-chip 4 IO, saving a lot of IO resources to expand functionality SCM system. Taking into account the P0 port required a pull-up resistor, we use the 4.7 k Ω drain resistance as a pull-up resistor.Chinese character display the basic process of scanning is this: after power due to the resistance of the capacitor C1 R1, enable MCU RST reset feet after low level to high, so as to achieve the reduction; later, at C2, C3, X1 and MCU internal clock circuit, MCU 89C51 in accordance with the procedures set in P0 and P2 connector output and internal character corresponding to the code-level LED dot matrix rows selected line (high level driver), at the same time, the P1.1 P1.2, P1.3, P1.4 interface output columns selected scan signal (low level driver) to select the corresponding pixel LCD light, and use of the human eye Visual synthesis of the whole staying attribute display of Chinese characters.
3 principle of matrix display Chinese characters and character code gets method
Our UCDOS Chinese Songtizi library, for example, every word consists of 16 lines of 16 columns composed of dot-matrix display.
The national character of each word are represented by 256 pixels. We can make each point to a pixel, and each character's glyph is understood as an image. In fact the Chinese character screen not only can display Chinese characters, you can also display in 256-pixel-wide any graphics. If the search with 8-bit single-chip control, because AT89C51 microcontroller bus for 8-bit, one need to split into two parts, as shown in Figure 3.
In order to clarify the composition of characters dot matrix, first through the column scanning method to get the character code.
Kanji apportionable to upper and lower, upper composed by 816 dot matrix, lower from 816 dot matrix. This example by column scanning method first displays the upper-left corner of the first column in the upper part, which is the 0 column of P00-P07 to P00 port, direction to display Chinese characters P07, "great", P05 lit from top to bottom, to: P0.0 off, P0.1 off, P0.2 off P0.3 off, P0.4 off, P0.5 lit, P0.6 off, P0.7 off. That is,-Ary 00000100, convert to hexadecimal to 04h. The upper section of the first column is complete, continue to scan the lower part of the first column, for the sake of convenient wiring, we have designed from top to bottom scan from the scan direction to P20 P27, you can see from Figure 3, this column is all off, i.e. 00000000, hexadecimal 00 h. In this way to the second column, 3 column, ... Until the sixteenth column scanning, scanning 32 8-bit, it is possible to draw Chinese character for "big" scan code is:This principle can be seen, no matter what font displayed or image, you can use this method to parse out his scan code to display on the screen.
The above method while the ability to let us know Chinese characters dot matrix code gets the process, but rely on artificial methods to get the character code is a very tedious task.
To this end, we frequently used fonts software find the character code, enter the software opens, point to "seize", hexadecimal character code of the data can be automatically generated, we need vertical data can be copied to the program, as shown in Figure 4.
Visible, the Chinese character matrix display general a bit scan, line scan and scan 3 columns.
In order to comply with the requirements of Visual interning, point scan method of scanning frequency must be greater than 1664 = 1 024 Hz, cycle is less than 1 ms. Line scan and column scanning method of scanning frequency must be greater than 168 = 128 Hz, cycle is less than you, but ms 7.8 once driven one column or row (8 bright LED) required plus driver circuit to improve current, otherwise LED brightness.4 Select components
The design of the required components as shown in table 1.
5 PCB design and component Assembly
This works with Protel 99SE Board level common to EDA software complete PCB design, detail of the design process.
Taking into account the design to the small number of components, our basic strategy using single-sided cabling, only use a small amount of top-level crossover leads to amateur design manufacture. Has designed PCB diagram shown in Figure 5.
This circuit on the component parameters not demanding, as long as the component selection is correct, no damage to the circuit board manufacturing process is good, all the components proper welding Assembly after entering the program download and debugging work phase.
Creation and debugging, where the AT89C2051 should install 20 feet of the IC, so that the SCM can continue from the circuit board in programming procedures.6 programming, burn and debugging
Software program mainly consists of start, initialization, the main program, the fonts.
One of the main program and sub-program of the flowchart shown in Figure 6 and Figure 7.
The following procedures can be used to implement "for China's rise and learning" and the display of Chinese characters.
Program listing is as follows:
The complete program compilation and preparation of simulation, one can burn and write AT89C51 programmer and computer hardware connections after you burn the program AT89C51 chip downloads, then burn a good program of AT89C51-chip mounted to 40 feet of IC socket, power you can debug and run, because the example circuit component parameters in the request is not very high, as long as the component for better basic requirements, parameters, welding Assembly to work properly.
7 conclusion
Although this design only uses a LED dot matrix 1616, circuit is simple, but already covered led display circuit principle and basic procedures, as long as extended MCU IO interface and add some LED dot matrix and related chip, you can design a more extensive, more enchanting [1] [2]
No comments:
Post a Comment