Arrow protues simulation design based on 51 single-chip flying

Table of contents

1. Introduction of LED dot matrix screen

2. Display principle

3. Simulation demonstration

4. Source program


1. Introduction of LED dot matrix screen

The LED dot matrix screen has strong luminous brightness and good indication effect. It can make moving luminous graphics and texts, which is easier to attract people's attention. It has a large amount of information and can be updated at any time. It has very good advertising and notice effects. Here is a brief introduction to the dynamic scanning display of LED dot matrix screen. 1. The principle of LED dot matrix screen display is summarized as an internal equivalent circuit diagram of an 8x8 LED dot matrix monochromatic row common anode module. For red LEDs, its working forward voltage is about 1.8v, and its continuous working forward current Generally about 10ma, the peak current can be larger. As shown in the figure below, when a certain row line is high and a certain column line is low, the point where the row and column intersect will be lit. When a certain row line is low, regardless of the column line, all points in the corresponding row will be lit. for dark. The LED dot matrix screen display is to scan progressively through a certain frequency, and the data terminal continuously inputs data for display. LED dot matrix screens are widely used in various public places, such as car station announcers, advertising screens and bulletin boards. LED dot matrix screens are classified by color: single color, double color, full color, by pixel: 8*8, 16*16 etc. (Large-scale LED dot matrix is ​​usually spliced ​​by many small dot matrix).

2. Display principle

  • The structure of the LED dot matrix screen is similar to the digital tube, except that the digital tube arranges the pixels of each column in an "8" shape.
  • The LED dot matrix screen is the same as the digital tube, there are two connection methods of common cathode and common anode, and different connection methods correspond to different circuit structures.
  • The LED dot matrix screen needs to be scanned row by row or column by row, so that all LEDs can be displayed at the same time.

3. Simulation demonstration

Through the 16*16 LED dot matrix, 15 frames of pictures are dynamically displayed circularly, and the dynamic display of the arrow flying over is realized.

 4. Source program

#include "reg52.h"

#define MATRIX_Column_Front		P0
#define MATRIX_Column_Back		P1
#define MATRIX_Data_Front		P2
#define MATRIX_Data_Back		P3

unsigned char i = 0;
unsigned char count = 0;
unsigned char offset = 0;

//点阵显示画面,共有15帧
unsigned int code MatrixLED[] = {
0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,
0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,
0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,
0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,
0xffe0,0xffe0,0xffe0,0xffe0,0xffe0,0xffe0,0xffe0,0xffe0,
0xffc8,0xffc0,0xffc0,0xffc1,0xffc0,0xffc0,0xffc8,0xffc0,
0xffb8,0xff90,0xff80,0xff81,0xff83,0xff81,0xff80,0xffb8,
0xfffb,0xff71,0xff20,0xff01,0xff03,0xff07,0xff03,0xff01,
0xfbff,0x71ff,0x20ff,0x01ff,0x03ff,0x07ff,0x03ff,0x01ff,
0xf7ff,0xe3ff,0x41ff,0x03ff,0x07ff,0x0fff,0x07ff,0xf7ff,
0xefff,0xc7ff,0x83ff,0x07ff,0x0fff,0x1fff,0xefff,0xc7ff,
0xdfff,0x8fff,0x07ff,0x0fff,0x1fff,0xdfff,0x8fff,0x07ff,
0xbfff,0x1fff,0x0fff,0x1fff,0xbfff,0x1fff,0x0fff,0x1fff,
0x7fff,0x3fff,0x1fff,0x7fff,0x3fff,0x1fff,0x7fff,0x3fff,
0x7fff,0x7fff,0x7fff,0x7fff,0x7fff,0x7fff,0x7fff,0x7fff
};

//每帧画面LED组成位置序号
unsigned int code MatrixORD[] = {
0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
0x0001,0x0002,0x0001,0x0002,0x0001,0x0002,0x0001,0x0002,
0x0001,0x0002,0x0004,0x0001,0x0002,0x0004,0x0001,0x0002,
0x0001,0x0002,0x0004,0x0008,0x0001,0x0002,0x0004,0x0008,
0x0001,0x0002,0x0004,0x0008,0x0010,0x0002,0x0004,0x0008,
0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0001,0x0002,
0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0001,
0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,
0x0100,0x0200,0x0400,0x0800,0x1000,0x2000,0x4000,0x8000,
0x0200,0x0400,0x0800,0x1000,0x2000,0x4000,0x8000,0x0200,
0x0400,0x0800,0x1000,0x2000,0x4000,0x8000,0x0400,0x0800,
0x0800,0x1000,0x2000,0x4000,0x8000,0x0800,0x1000,0x2000,
0x1000,0x2000,0x4000,0x8000,0x1000,0x2000,0x4000,0x8000,
0x2000,0x4000,0x8000,0x2000,0x4000,0x8000,0x2000,0x4000, 
0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
};

//毫秒级延时,用于点阵动态显示
void delay_us(unsigned char t)
{
	while(t--);
}

//点阵显示函数
void MatrixLED_ShowColumn(unsigned int Column,unsigned int Data)
{
  MATRIX_Column_Front = (unsigned char)((Column >>8)&0xFF); //高8位:
  MATRIX_Column_Back = Column&0xFF;    //低8位:
	MATRIX_Data_Front = (unsigned char)((Data >>8)&0xFF); //高8位:
  MATRIX_Data_Back = Data&0xFF;    //低8位:
	delay_us(50);
}

void main()
{
	while(1)
	{
		for(i=0;i<8;i++)	//循环8次,显示8列数据
		{
			 MatrixLED_ShowColumn(MatrixORD[i+offset], MatrixLED[i+offset]);
		}
		count++;			//计次延时
		if(count>50)
		{
			count=0;
			offset+=8;		//偏移+8,切换下一帧画面
			if(offset>112)
			{
				offset=0;   //15帧画面播放完,重新开始播放
			}
		}
	}
}

 Flying arrow simulation source file and source program based on 51 microcontroller Baidu network disk link: Link: https://pan.baidu.com/s/1rIWxLJG-ELPN_njIYVJKDA Extraction code: j3kf 
 

Guess you like

Origin blog.csdn.net/weixin_53402301/article/details/129449174