The principle and production of dot matrix Chinese character LED display

Publisher:BlissfulMoonLatest update time:2016-09-30 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Chinese character display screens are widely used in bus station announcements, advertising screens, etc. This article introduces the production of a practical Chinese character display screen. Considering the easy availability of circuit components, 8*8 dot matrix light-emitting tube modules are not used, but 256 high-density light-emitting tubes are directly used to form a 16-row 16-column light-emitting dot matrix. At the same time, in order to reduce the difficulty of production, only one word is displayed in turn. In actual use, the number of displayed words can be expanded according to this principle.

1. The principle of Chinese character display:

Let's take the UCDOS Chinese Song font library as an example. Each character is displayed by a dot matrix of 16 rows and 16 columns. That is, each character in the national standard Chinese character library is represented by a 256-dot matrix. We can understand each dot as a pixel, and the shape of each character as an image. In fact, this Chinese character screen can not only display Chinese characters, but also display 256 pixels.

Any graphic within the range.

 

 

 

 

Let's take the Chinese character "大" as an example to illustrate the scanning principle:

In the UCDOS Chinese Song font library, each character is displayed in a dot matrix of 16 rows and 16 columns.

Controlled by the 8-bit AT89C51 microcontroller, since the microcontroller's bus is 8 bits, a word needs to be split into two parts.

Generally, we divide it into the upper part and the lower part. The upper part is composed of 8*16 dot matrix, and the lower part is also composed of 8*16 dot matrix.

In this example, the microcontroller first displays the upper half of the first column in the upper left corner, that is, the port p00---p07 in the 0th column. The direction is p00 to p07. When the Chinese character "大" is displayed, p05 lights up. From top to bottom, p0.0 turns off, p0.1 turns off, p0.2 turns off, p0.3 turns off, p0.4 turns off, p0.5 turns on, p0.6 turns off, and p0.7 turns off. That is, the binary number 00000100 is converted to hexadecimal 04h.

After completing the first column of the upper half, continue to scan the first column of the lower half. For the convenience of wiring, we still design it to scan from top to bottom, that is, scan from p27 to p20. From the above figure, you can see that this column is all dark, that is, 00000000, which is 00h in hexadecimal.

Then the MCU turns to the second column in the upper half, and p05 is still lit, which is 00000100, or hexadecimal 04h.

After this column is completed, the scan of the lower half continues, p21 lights up, and the binary value is 00000010, which is 02h in hexadecimal.

According to this method, continue the following scan, a total of 32 8-bit scans, you can get the Chinese character "大"

The scan code is:

04H,00H,04H,02H,04H,02H,04H,04H

04H,08H,04H,30H,05H,0C0H,0FEH,00H

05H,80H,04H,60H,04H,10H,04H,08H

04H,04H,0CH,06H,04H,04H,00H,00H

From this principle, we can see that no matter what font or image is displayed, this method can be used to analyze its scanning code and display it on the screen.

However, there are many ready-made Chinese character font generation software now, so we don’t have to draw tables and calculate codes ourselves.

 

 

 

After opening the software, input Chinese characters and click "Retrieve". The Chinese character code of the hexadecimal data will be automatically generated. Then copy the vertical data we need into our program.

We connect the row and column bus to the i0 port of the microcontroller, and then send the scan code analyzed above to the bus, and we can get the displayed Chinese characters. In this example, since there are 16 rows and 16 columns in total, if all of them are connected to the 89c51 microcontroller, a total of 32 io ports will be used, which will cause the exhaustion of io resources and the system will have no room for expansion. In actual applications, we use the 4-16 line decoder 74ls154 to complete the display in the column direction. The 16 lines in the row direction are connected to the p0 port and the p2 port.

 

 

 

Program Listing:

ORG 00H

LOOP: MOV A,#0FFH; boot initialization, clear screen

MOV P0,A ; Clear P0 port

ANL P2,#00; Clear P2 port

MOV R2,#200

D100MS: MOV R3,#250; Delay 100 milliseconds

DJNZ R3,$

DJNZ R2,D100MS

MOV 20H,#00H; get the initial value of the code pointer

l100: MOV R1,#100; the dwell time of each word

L16: MOV R6,#16; 16 codes per word

MOV R4,#00H ; Clear the scan pointer

MOV R0,20H; store the code pointer in R0

L3: MOV A,R4; scan pointer is stored in A

MOV P1,A ; Scan output

INC R4; Scan pointer plus 1, scan the next

MOV A,R0; store the code pointer in A

MOV DPTR,#TABLE ;Get the code of the upper half of the data table

MOVC A,@A+DPTR

MOV P0,A ; Output to P0

INC R0; add 1 to the code pointer and fetch the next code.

MOV A,R0

MOV DPTR,#TABLE; Get the code of the lower half of the data table

MOVC A,@A+DPTR

MOV P2,A; output to P2 port

INC R0

MOV R3,#02 ; Scan 1 millisecond

DELAY2: MOV R5,#248;

DJNZ R5,$

DJNZ R3,DELAY2

MOV A,#00H ; Clear the screen

MOV P0,A

ANL P2,#00H

DJNZ R6,L3; Are 16 codes for one word completed?

DJNZ R1,L16; Has the dwell time for each word reached?

MOV 20H,R0; store the code pointer in 20H

CJNE R0,#0FFH,L100; Are 8 words and 256 codes completed?

JMP LOOP; Repeated loop

TABLE :

; Code for the Chinese character “倚”

db 01H,00H,02H,00H,04H,00H,1FH,0FFH

db 0E2H,00H,22H,00H,22H,0FCH,26H,88H

db 2AH,88H,0F2H,88H,2AH,0FAH,26H,01H

db 63H,0FEH,26H,00H,02H,00H,00H,00H

; The following are the codes for Tian, ​​Yi, Chu, Bao, Dao, Tu, Long, respectively, omitted.

end

The row direction of the circuit is scanned by ports P0 and P2. Since port P0 has no pull-up resistor, a 4.7k*8 resistor is connected to pull it up. If there is no resistor, 8 ordinary 4.7k 1/8w resistors can also be used. To provide load capacity, 16 2n5551 NPN transistors are connected to drive.

The column direction is scanned by a 4-16 decoder 74LS154, which is controlled by P1.0-P1.3 of 89C51. Similarly, the driving part is completed by 16 2N5401 transistors.

The circuit is powered by a LM7805 three-terminal regulator, which consumes about 100 mA of current.

Use a 12*20cm universal circuit board, and choose light-emitting tubes of better quality (otherwise there will be bad pixels, which are troublesome to replace). First, insert 256 light-emitting tubes into the circuit board, pay attention to the insertion direction, and make the height consistent. Solder them directly in the row direction and bridge them in the column direction. After completion, test them with a multimeter and replace any that do not light up.

Then find a data cable of a computer hard disk, cut the required length, and lead the row and column lines to the relevant pins of the circuit. For simplicity, the schematic diagram only shows the schematic diagram, only 2 transistors are drawn in the row and column directions, and only 4 light-emitting tubes are drawn on the screen. In fact, there are 256 light-emitting tubes, 16 transistors in the row and column directions, a total of 32. The welding process can be completed in one day. After compiling the program, burn it into 89c51, insert it into the 40pin Ic socket, and you can see the screen display in turn: "Yitian comes out with a sword to slay the dragon".

Of course, you can replace the Chinese character code part of the program with the code you need to display the Chinese characters you need.

 

 

 

The above picture is a photo of the actual object. Readers who are interested in this article can find his completed program in the accompanying CD of this issue of Radio Magazine, or download it from the author's website www.51c51.com.

Components List:

 

name
quantity
Specification
4.7k 1/8w
32
resistance
4.7k*8 resistor
1
 
2n5551
16
Low power NPN transistor
2n5401
16
Low power PNP transistor
led
256
3mm white red high brightness
22P
2
Ceramic capacitors
10uf/50v
1
Electrolytic Capacitors
100uf/25v
2
Electrolytic Capacitors
AT89C51
1
or AT89S51
40pin IC socket
1
Plug in 89c51
12M
1
Crystal
74LS154
1
LM7805
1
Voltage regulator IC
Power outlet
1
 
Power Supply
1
9-12V/200Ma regulated power supply
Universal circuit board
1
12*20(cm)

Reference address:The principle and production of dot matrix Chinese character LED display

Previous article:Speedometer made by single chip microcomputer
Next article:Come with me to write the simplest single chip program

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号