点阵显示仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
单片机源程序如下:
- //**********信息工程学院 陈国盛***************
- #include <reg51.h>
- #define tt 5
- unsigned int i;
- unsigned char j,k,m;
- sbit CLK1=P2^0;
- sbit CLK2=P2^1;
- unsigned char code lie_p3[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};//
- unsigned char code lie_p1[]={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};//列扫描值
- unsigned char code zifu1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};//字符模值
- unsigned char code zifu2[]={0x00,0x80,0x01,0x00,0x06,0x00,0x1F,0xFF,0xE0,0x00,0x00,0x00,0x20,0x00,0x24,0x9F,
- 0x24,0x92,0xA4,0x92,0x64,0x92,0x24,0x92,0x24,0x92,0x24,0x9F,0x20,0x00,0x00,0x00,};//信
- unsigned char code zifu3[]={0x00,0x02,0x00,0x0C,0x00,0x00,0x3F,0xC0,0x2A,0x9C,0x2A,0x82,0x6A,0x82,0xAA,0xA2,
- 0x2A,0x9A,0x2A,0x82,0x2A,0x82,0x3F,0xCE,0x00,0x00,0x00,0x10,0x00,0x0C,0x00,0x00,};//息
- unsigned char code zifu4[]={0x00,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x3F,0xFC,
- 0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x00,0x04,0x00,0x00,};//工
- unsigned char code zifu5[]={0x24,0x10,0x24,0x60,0x25,0x80,0x7F,0xFF,0xC4,0x80,0x44,0x60,0x00,0x02,0x7C,0x92,
- 0x44,0x92,0x44,0x92,0x44,0xFE,0x44,0x92,0x44,0x92,0x7C,0x92,0x00,0x82,0x00,0x00,};//程
- unsigned char code zifu6[]={0x02,0x20,0x0C,0x20,0x88,0x20,0x69,0x20,0x09,0x20,0x09,0x22,0x89,0x21,0x69,0x7E,
- 0x09,0x60,0x09,0xA0,0x19,0x20,0x28,0x20,0xC8,0x20,0x0A,0x20,0x0C,0x20,0x00,0x00,};//学
- unsigned char code zifu7[]={0x00,0x00,0x7F,0xFF,0x44,0x20,0x5A,0x10,0x61,0xE0,0x08,0x01,0x30,0x82,0x24,0x8C,
- 0x24,0xF0,0xA4,0x80,0x64,0x80,0x24,0xFC,0x24,0x82,0x28,0x82,0x30,0x8E,0x00,0x00,};//院
- unsigned char code zifu8[]={0x00,0x00,0x7F,0xFF,0x44,0x20,0x5A,0x10,0x61,0xE0,0x10,0x04,0x11,0x88,0x16,0xB0,
- 0x18,0x82,0xF0,0x81,0x17,0xFE,0x10,0x80,0x10,0xA0,0x10,0x90,0x10,0x0C,0x00,0x00,};//陈
- unsigned char code zifu9[]={0x00,0x00,0x7F,0xFF,0x40,0x02,0x48,0x12,0x49,0x12,0x49,0x12,0x49,0x12,0x4F,0xF2,
- 0x49,0x12,0x49,0x52,0x49,0x32,0x48,0x12,0x40,0x02,0x7F,0xFF,0x00,0x00,0x00,0x00,};//国
- unsigned char code zifu10[]={0x00,0x22,0x00,0xC2,0x3F,0x1E,0x24,0x12,0x24,0x92,0x24,0x5E,0x27,0x92,0x20,0x32,
- 0xF8,0x52,0x26,0x9E,0x21,0x12,0xA2,0x92,0x6C,0x5E,0x21,0xE2,0x00,0x02,0x00,0x00,};//盛
- unsigned char code zifu11[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
- //**********信息工程学院 陈国盛***************
- void delay1()
- {
- for(i=200;i>0;i--)
- ;
- ;
- }
- void main()
- {
- CLK1=0;
- CLK2=0;
- while(1)
- {
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
- P0=zifu1[2*(k-j)];
- CLK1=1;
- CLK1=0;
- P0=zifu1[2*(k-j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
- P0=zifu2[2*(8+k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu2[2*(8+k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
- P3=j;
- P0=zifu2[2*(16-k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu2[2*(16-k+j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
- P0=zifu2[2*(k-j)];
- CLK1=1;
- CLK1=0;
- P0=zifu2[2*(k-j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
- P0=zifu2[2*(k-j)];
- CLK1=1;
- CLK1=0;
- P0=zifu2[2*(k-j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
- P0=zifu3[2*(8+k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu3[2*(8+k+j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
- P3=j;
- P0=zifu3[2*(16-k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu3[2*(16-k+j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
- P0=zifu3[2*(k-j)];
- CLK1=1;
- CLK1=0;
- P0=zifu3[2*(k-j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
- P0=zifu3[2*(k-j)];
- CLK1=1;
- CLK1=0;
- P0=zifu3[2*(k-j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
- P0=zifu4[2*(8+k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu4[2*(8+k+j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
- P3=j;
- P0=zifu4[2*(16-k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu4[2*(16-k+j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
- P0=zifu4[2*(k-j)];
- CLK1=1;
- CLK1=0;
- P0=zifu4[2*(k-j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
- P0=zifu4[2*(k-j)];
- CLK1=1;
- CLK1=0;
- P0=zifu4[2*(k-j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
- P0=zifu5[2*(8+k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu5[2*(8+k+j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
-
- P3=j;
- P0=zifu5[2*(16-k+j)];
- CLK1=1;
- CLK1=0;
- P0=zifu5[2*(16-k+j)+1];
- CLK2=1;
- CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu5[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu5[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu5[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu5[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
-
- P0=zifu6[2*(8+k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu6[2*(8+k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
-
- P3=j;
-
- P0=zifu6[2*(16-k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu6[2*(16-k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu6[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu6[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu6[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu6[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
-
- P0=zifu7[2*(8+k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu7[2*(8+k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
-
- P3=j;
-
- P0=zifu7[2*(16-k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu7[2*(16-k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu7[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu7[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu7[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu7[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
-
- P0=zifu8[2*(8+k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu8[2*(8+k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- } }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
-
- P3=j;
-
- P0=zifu8[2*(16-k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu8[2*(16-k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu8[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu8[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu8[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu8[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
-
- P0=zifu9[2*(8+k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu9[2*(8+k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- } }
- for(k=8;k<16;k++)
- {
- for(m=tt;m>0;m--)
- for(j=0;j<k;j++)
- {
-
- P3=j;
-
- P0=zifu9[2*(16-k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu9[2*(16-k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- //**********信息工程学院 陈国盛***************
- for(k=16;k>8;k--)
- {
- for(m=tt;m>0;m--)
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu9[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu9[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- for(k=8;k>0;k--)
- {
- for(m=tt;m>0;m--)
- {
- for(j=k;j>0;j--)
- {
- P3=16-j;
-
- P0=zifu9[2*(k-j)];
- CLK1=1;CLK1=0;
-
- P0=zifu9[2*(k-j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- //**********信息工程学院 陈国盛***************
- for(j=0;j<8-k;j++)
- {
- P3=j;
-
- P0=zifu10[2*(8+k+j)];
- CLK1=1;CLK1=0;
-
- P0=zifu10[2*(8+k+j)+1];
- CLK2=1;CLK2=0;
- delay1();
- }
- }
- }
- for(k=8;k<16;k++)
- ……………………
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
陈.rar
(68.51 KB, 下载次数: 18)
|