Use 8×8 to realize 16×16 dot matrix screen in Proteus8.6

1. Preliminary knowledge

First of all, there is no integrated 16×16 dot matrix screen in Proteus8.6. Therefore, we need to use the existing 8×8 dot matrix screen to achieve

1.1 How to detect the pin information of the 8×8 dot matrix screen by yourself

Call up an 8×8 dot matrix, connect VCC to the pin of the dot matrix, and connect the pin at the other end to GND, run the simulation to see if the dot matrix can be bright, which points are bright, if not Switch VCC and GND when light is on, so that the row and column of the dot matrix, common cathode or common anode pin information can be measured.


If you don’t want to check the pin information yourself during simulation, the pin information and icons of the four-color dot matrix screen have been given here.

1.2 Pin information of common 8×8 dot matrix screens

For the red dot matrix screen, when it is not rotating: the
  top is column selection, high level is valid; the
  bottom is row selection, low level is valid;

For other dot matrix screens, without rotating: the
  top is row selection, and the low level is valid; the
  bottom is column selection, and the high level is valid;


Tip: The following is the content of this article, the following cases are for reference

Two, Proteus simulation and principle explanation

2.1 Simulation icon

2.2 Source files

Click me to get the simulation picture .
Extraction code: 19WL


Three, C code writing

3.1 Get font software settings and links

Click me to get the modulus software .
Extraction code: TTFF
link comes from Baidu Netdisk

3.2 C code writing and analysis

code show as below:

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

//这里的字模可以用上面的取模软件获得
uchar code string[]=
{
    
    
	//物
	0x10,0x00,0x10,0x02,0x14,0x02,0x7E,0x3F,
	0x91,0x50,0x10,0x58,0x7F,0x6C,0x10,0x76,
	0x10,0x5B,0x10,0x4C,0x10,0x46,0x10,0x70,
	0x10,0x60,0x10,0x00,0x00,0x00,0x00,0x00,
	//联
	0x00,0x00,0x00,0x00,0x7E,0x21,0x24,0x12,
	0x3C,0x0C,0xA4,0x7F,0x3C,0x0C,0x24,0x0C,
	0xA4,0x7F,0x7F,0x0C,0x20,0x1E,0x20,0x33,
	0xA0,0x61,0x00,0x00,0x00,0x00,0x00,0x00,
	//网
	0x00,0x00,0x00,0x00,0xFE,0xFF,0x01,0x80,
	0x01,0x80,0x45,0xA2,0x29,0x94,0x11,0x88,
	0x29,0x94,0x45,0xA2,0x01,0x80,0x01,0xC0,
	0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
	//工
	0xFC,0x3F,0x00,0x01,0x00,0x01,0x00,0x01,
	0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,
	0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,
	0x00,0x01,0x00,0x01,0xFE,0x7F,0x00,0x00,
	//程
	0x00,0x00,0x00,0x00,0x30,0x1F,0x0C,0x11,
	0x0B,0x11,0x08,0x1F,0x08,0x00,0x3F,0x00,
	0x1C,0x1F,0x1A,0x04,0x29,0x1F,0x48,0x04,
	0x08,0x04,0x88,0x3F,0x08,0x00,0x00,0x00
};
//延时函数
void delay(uint j)
{
    
    
	uchar i=250;
	for(;j>0;j--)
	{
    
    
		while(--i);
		i=100;
	}
}
//主函数
void main()
{
    
    
	uchar i, j ,n;
	while(1)
	{
    
    
		for(j=0;j<5;j++)
		//这里控制输出几个字
		{
    
    
			for(n=0;n<40;n++)
			{
    
    
				for(i=0;i<16;i++)
				//逐行来扫描,一共扫描十六行
				{
    
    
					out1=i%16;
					//利用4-16译码器来控制显示哪一行
					out0=string[i*2+j*32];
					out2=string[i*2+1+j*32];
					//该数组中,前后两个十六进制数正好为16位
					//所以,out0不需加一,out2需要加一
					delay(4);
//					out0=0xff;
//					out2=0xff;
				}
			}
		}
	}
}

end

If there is an error, please private message to point it out

Guess you like

Origin blog.csdn.net/Stanford_sun/article/details/115337681