LED dot matrix display principle (font acquisition software + Keil + Proteus)

Foreword

When I was writing this, I was still a little angry because I found that I followed the steps in the book exactly, but it turned out to be unsatisfactory. I had to debug myself later to solve the problem. -_-I will shed tears if I say too much, let’s go directly to the text.

For the operation of the software, please refer to my previous blog.

Static display and dynamic display of LED digital tube (Keil + Proteus)-CSDN Blogicon-default.png?t=N7T8https://blog.csdn.net/weixin_64066303 /article/details/134101256?spm=1001.2014.3001.5501

Principle

LED dot matrix screen_Baidu Encyclopedia (baidu.com)icon-default.png?t=N7T8https://baike.baidu.com/item/LED dot matrix screen /7374324MCU-51: LED dot matrix screen_MCU LED dot matrix display principle_Hello xiǎo lěi’s blog-CSDN blogicon-default.png?t=N7T8https:/ /blog.csdn.net/qq_27928443/article/details/128468090 The principle of LED dot matrix display is to use light-emitting diodes (LEDs) to form a dot matrix, and by controlling the lighting and extinguishing of each LED light, Realize the display of text, numbers, graphics and other information. If many light-emitting diodes are lit in sequence in a short period of time, the LEDlattice can display a stable character, number or other graphics. . The essence of controlling the LED dot matrix display display is to control the coding added to the row lines and column lines, and control the lighting of certain light-emitting diodes (dots), thereby displaying various characters composed of different luminous points. . LED dot matrix display screen usually consists of display module, control system and power supply system. It has the advantages of simple production and convenient installation. It is widely used in various public places, such as car stop announcers, advertising screens and bulletin boards. In practical applications, the appropriate control method can be selected according to needs, and the control of the LED lattice can be achieved through reasonable circuit design and programming.

16*16 dot code

The first is the dot matrix code part. I believe that no one would be stupid enough to draw it by themselves, and it is easy to make mistakes. Here you can use the software to take the font model.

PCtoLCD2002

Feng(0) Xi(1) Ze(2) You(3)

DB 02H,02H,12H,23H,12H,22H,12H,22H,FEH,FCH,12H,24H,12H,24H,12H,24H;
DB 00H,00H,09H,00H,08H,C2H,08H,01H,FFH,FEH,08H,00H,08H,00H,00H,00H;”sealed”,0

DB 00H,01H,40H,11H,60H,91H,54H,92H,4DH,92H,55H,94H,66H,98H,56H,F0H;
DB 84H,98H,88H,94H,82H,92H,91H,92H,A0H,D1H,80H,11H,00H,01H,00H,00H;”奥”,1

DB 08H,20H,06H,20H,40H,7EH,31H,80H,00H,00H,41H,08H,61H,48H,52H,48H;
DB 4AH,48H,45H,FFH,4AH,48H,52H,48H,61H,48H,01H,08H,01H,00H,00H,00H;”泽”,2

DB 00H,80H,01H,00H,06H,00H,1FH,FFH,E0H,00H,08H,01H,08H,06H,08H,38H;
DB FFH,C0H,08H,00H,0FH,FCH,88H,02H,68H,02H,08H,02H,08H,1EH,00H,00H;”Excellent”,3

Font Extraction V2.1

Initialize settings before experiment:

Check byte reverse order

The next step is to extract the font

/*– Text: seal –*/
/*– Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16×16 –*/
0x10,0x10,0x10,0x10,0x10,0x10,0xFE,0x10,0x10,0x7E,0x10,0x10,0xFF,0x10,0x00,0x12,
0x10,0x14,0x10,0x14,0xFE,0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0x0F,0x14,0x02,0x08,

/*– Text: Xi –*/
/*– Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16×16 –*/
0x00,0x3F,0xFE,0x00,0x44,0x10,0xA8,0x08,0x10,0x02,0xF8,0x01,0xC0,0x04,0x30,0x08,
0xFC,0x1F,0x80,0x10,0x80,0x00,0xFE,0x3F,0x40,0x01,0x20,0x02,0x18,0x0C,0x07,0x70,

/*– Text: Ze –*/
/*– Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16×16 –*/
0x00,0x00,0xE4,0x1F,0x48,0x10,0x88,0x08,0x01,0x05,0x02,0x02,0x82,0x0D,0x68,0x72,
0x08,0x02,0xC4,0x1F,0x07,0x02,0x04,0x02,0xE4,0x3F,0x04,0x02,0x04,0x02,0x00,0x02,

/*– Text: Excellent –*/
/*– Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16×16 –*/
0x10,0x09,0x10,0x11,0x10,0x11,0x08,0x01,0xE8,0x7F,0x0C,0x05,0x0C,0x05,0x0A,0x05,
0x09,0x05,0x08,0x05,0x88,0x04,0x88,0x44,0x88,0x44,0x48,0x44,0x48,0x78,0x28,0x00,

Added on November 6: (Baidu network disk link)

Link: https://pan.baidu.com/s/1RkMxhWm7Tku89T9_ZtwcrA
Extraction code: 0205

After unzipping, there are two softwares available. You can choose according to your needs.

Keil

The program is basically the same as in the book, just comment out those two lines of code. Its principle is to print line by line, and then print each line through hexadecimal numbers. Because it is fast, it is the same as printing together.

#include <reg51.h>
#define uchar unsigned char
#define uint unsigned int
#define out0 P0
#define out1 P1
#define out2 P2


void delay(uint y) //delay function
{
uchar x=250;
for(;y>0;y--)
{
while(--x);
x=100;
}
}

uchar code string[]=
{
/*-- Text: seal --*/
/*-- Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16x16 --*/
0x10,0x10,0x10,0x10,0x10,0x10,0xFE,0x10,0x10,0x7E,0x10,0x10,0xFF,0x10,0x00,0x12,
0x10,0x14,0x10,0x14,0xFE,0x10,0x10,0x10,0x10,0x10,0xF0,0x10,0x0F,0x14,0x02,0x08,

/*-- Text: Xi --*/
/*-- Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16x16 --*/
0x00,0x3F,0xFE,0x00,0x44,0x10,0xA8,0x08,0x10,0x02,0xF8,0x01,0xC0,0x04,0x30,0x08,
0xFC,0x1F,0x80,0x10,0x80,0x00,0xFE,0x3F,0x40,0x01,0x20,0x02,0x18,0x0C,0x07,0x70,

/*-- Text: Ze --*/
/*-- Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16x16 --*/
0x00,0x00,0xE4,0x1F,0x48,0x10,0x88,0x08,0x01,0x05,0x02,0x02,0x82,0x0D,0x68,0x72,
0x08,0x02,0xC4,0x1F,0x07,0x02,0x04,0x02,0xE4,0x3F,0x04,0x02,0x04,0x02,0x00,0x02,

/*-- Text: Excellent --*/
/*-- Song Dynasty 12; The corresponding dot matrix under this font is: width x height = 16x16 --*/
0x10,0x09,0x10,0x11,0x10,0x11,0x08,0x01,0xE8,0x7F,0x0C,0x05,0x0C,0x05,0x0A,0x05,
0x09,0x05,0x08,0x05,0x88,0x04,0x88,0x44,0x88,0x44,0x48,0x44,0x48,0x78,0x28,0x00,
} ;
void main()
{uchar i,j,n;
while(1)
{
for(j=0;j<4;j + + ) //Display a total of 4 Chinese characters
{
for(n=0;n<40;n + + )//Scan the entire screen 40 times for each Chinese character
{
for(i=0;i<15;i + + )//Scan 16 lines progressively
{
out1=i;//output line code
out0=string[i*2 + j*32];//Output column codes C0~C7
out2=string[i*2 + 1 + j*32];//Output column codes C8~C15
delay(4);//Delay between each line
//out0=0xff;
//out2=0xff;
}
}
}
}
}

Proteus

The program in the book has been modified. The 16*16 LED dot matrix in the picture is realized by four 8*8 dot matrices (such a dot matrix needs to be drawn by yourself, otherwise the position of the pins is wrong).

One of the two mistakes I made was that the ground symbol of 74HC154 was wrong, which caused it to print one column after another.

The second one is the inverter. I just followed the instructions in the book, but I didn’t know what it was going to do. The printed result seemed to be the same word, but it was wrong. I wondered if I had done it backwards, so I changed the inverter. get rid.

Let’s first show how to implement it using only the built-in devices.

Required components

Component name Proteus keyword
51 MCU AT89C51
4-16 decoder 74HC154
Blue 8*8LED dot matrix MATRIX-8X8-BLUE
Green 8*8 LED dot matrix MATRIX-8X8-GREEN
Orange 8*8 LED dots array MATRIX-8X8-ORANGE
Red 8*8LED dot matrix MATRIX- 8X8-RED
Exclusion PESPACK-8
Power supply POWER
GROUND GROUND

The main thing to pay attention to is the pin connection. (Don’t ask how you know it. Just ask. Just try it out. According to the connection in the book, the direction of the four pieces will be correct, but there may be reversed rows and columns. Split a word into four pieces, and then read it again. If there is any problem with the four parts, just reverse the rows and connect them)

Color can be unified into one color. I think there are exactly four colors, which represent four modules respectively.

Renderings

Expand

The following is implemented using the component library given by the teacher.

There are renderings of the inverter.

Rendering without inverter

If you can draw one yourself The 16*16 rendering is even better.

Reference link

Proteus simulation experiment—-8*8 dot matrix (point scanning experiment)_matrix-8x8_DH Xiaolei’s blog-CSDN blogicon-default.png?t=N7T8 https://blog.csdn.net/weixin_46510976/article/details/127950291【Proteus】16 times 16 dot matrix scrolling play – Zhihu (zhihu.com)icon-default.png ?t=N7T8https://zhuanlan.zhihu.com/p/138580722 [Selected] 16x16LED dot matrix production tutorial in Proteus8.6_16*16 dot matrix_TiAmoLH’s blog-CSDN blogicon-default.png?t=N7T8https://blog.csdn.net/yz20200414/article/details/116958385proteus simulation 51 microcontroller driver 16×16 dot matrix displays your name and symbols_bili Bili_bilibiliicon-default.png?t=N7T8https://www.bilibili.com/video/BV18G4y1b79A/?spm_id_from=333.337.search-card.all .click &vd_source=7c3bfbf39d037fe80c97234396acc524

Summary

After reading for a few days, my efforts were still in vain, so I kept following the instructions in the book, and found no problems. I changed the code and the schematics, but the results were exactly the same, but there were problems, so in the future, everyone still needs to think and complete it by themselves.