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.
Principle of Chinese character display:
Taking UCDOS Chinese Song Ti character library as an example, each word is displayed by a dot matrix of 16 rows and 16 columns. That is, each word in the national standard Chinese character library is represented by 256 dot matrix.
We can understand each point as a pixel, and the font of each word as an image. In fact, this Chinese character screen can display not only Chinese characters, but also any graphics within 256 pixels.
It is controlled by an 8-bit AT89C51 single chip microcomputer. Because the bus of the single chip microcomputer is 8 bits, a word needs to be divided into two parts.
Generally, we divide it into upper part and lower part. The upper part is composed of 8 * 16 lattice, and the lower part is also composed of 8 * 16 lattice. In this example, the MCU first displays the upper half of the first column in the upper left corner, that is, the p00 --- P07 port in column 0. The direction is p00 to P07. When the Chinese character "big" is displayed, P05 lights up and is arranged from top to bottom. It is p0.0 off, P0.1 off, P0.2 off, p0.3 off, P0.4 off, p0.5 on, p0.6 off and p0.7 off. That is, binary 00000100 is converted to hexadecimal 04H.
After the first column in the upper half is completed, continue to scan the first column in the lower half. For the convenience of wiring, we still design to scan from top to bottom, that is, from p27 to P20. As can be seen from the above figure, this column is not lit, that is, 00000000, and hexadecimal is 00h.
Then the MCU turns to the second column in the upper half, and P05 is still lit, which is 00000 100, i.e. hexadecimal 04H
After the completion of this column, continue to scan the lower part, p21 is lit, which is binary 00000010, i.e. hexadecimal 02h. According to this method, continue to scan the following, scanning a total of 32 8 bits, and the scanning code of Chinese character "big" can be obtained as follows:
From this principle, we can see that no matter what font or image is displayed, we can use this method to analyze its scanning code and display it on the screen.
However, there are many ready-made Chinese font generation software, so we don't have to draw tables and calculate codes ourselves.
After the software is opened, input Chinese characters and click "check", the Chinese character code of hexadecimal data can be automatically generated, and the vertical data we need can be copied into our program. We connect the row and column bus to the I0 port of the single chip microcomputer, and then send the scanning code analyzed above to the bus to get the displayed Chinese characters.
In this example, because 16 rows and 16 columns are used, if all of them are connected to 89C51 single chip microcomputer, a total of 32 IO ports are used, which leads to the depletion of IO resources and the system has no room for expansion. In practical application, we use 4-16 line decoder 74ls154 to display the column direction. The 16 lines in the travel direction are connected to port P0 and port P2.
Procedure list:
Double click code select all
The line direction in the circuit is scanned by port P0 and port P2. Since port P0 has no pull-up resistance, it is connected with a 4.7K * 8 drain resistance pull-up. If there is no resistance, 8 ordinary 4.7K 1 / 8W resistors can also be used. In order to provide load capacity, 16 2N5551 NPN triodes are connected.
The column direction is scanned by the 4-16 decoder 74ls154, which is controlled by P1.0 --- p1.3 of 89C51. Similarly, the driving part is completed by 16 2n5401 triodes.
Bao’an District Shenzhen City, China
+86 189 3806 5764