找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5311|回复: 5
收起左侧

自己的16x16点阵制作,采用的4个74hc573图纸与单片机源程序分享

[复制链接]
ID:241769 发表于 2017-11-8 16:32 | 显示全部楼层 |阅读模式
                       图中三极管于电阻没有用到,
                       c文件里面有教程;
                       hex也有;连线放式;

下面是图纸:
IMG_20171108_162519.jpg

制作出来的实物图:
IMG_20171108_162543.jpg IMG_20171108_162534.jpg IMG_20171108_162520.jpg

单片机源程序如下:
  1. /***采用四个74hc573,***/
  2. #include<reg52.h>
  3. sbit sao=P2^3; //573使能端前8位,行扫描
  4. sbit sao1=P2^2; //573使能端后8位,行扫描
  5. sbit su=P2^1;  //573使能端前8位,列数据传送
  6. sbit su1=P2^0;        //573使能端后8位,列数据传送
  7. unsigned char a,b,c;
  8. unsigned char code tbo[]={
  9. 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,
  10. 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
  11. };//扫描数据,根据连线更改
  12. unsigned char code tbo1[30][32]={
  13. {0xFE,0xFE,0x00,0xFE,0xFE,0x80,0x93,0x99,
  14. 0x90,0x9E,0x9E,0x80,0x9E,0x9E,0x9E,0x9F,
  15. 0x7F,0x7F,0x00,0x7F,0x7F,0x01,0xC9,0x99,
  16. 0x09,0x79,0x79,0x01,0x79,0x79,0x61,0xF3},/*"南",0*/

  17. {0xFC,0xFE,0x00,0xF9,0xF9,0xF3,0xE7,0xC0,
  18. 0xF9,0xF9,0xF9,0xF9,0xF3,0xF3,0xE7,0x8F,
  19. 0xFF,0x7F,0x00,0xFF,0xFF,0xCF,0xE7,0x03,
  20. 0x93,0x9F,0x9F,0x9F,0x99,0x99,0x99,0xC1},/*"充",1*/

  21. {0xFE,0x02,0xF2,0xF2,0xF2,0x82,0x9E,0x98,
  22. 0x9E,0x82,0xF2,0xF2,0xF2,0xF2,0x86,0xCE,
  23. 0x7F,0x73,0x73,0x67,0x4F,0x1F,0x7F,0x00,
  24. 0x1F,0x4F,0x4F,0x67,0x73,0x19,0x3C,0x7F},/*"张",2*/

  25. {0xFC,0xCE,0xE0,0xE1,0x38,0x99,0x98,0xE0,
  26. 0xE0,0xC8,0x08,0xC8,0xC9,0xC8,0xC9,0xF9,
  27. 0xFF,0x01,0x79,0x99,0x01,0x99,0x01,0x01,
  28. 0x01,0x01,0x01,0x01,0x09,0x01,0x99,0x91},/*"澜",3*/

  29. {0xE7,0xE7,0xE7,0xE4,0x01,0xE7,0xE7,0xE0,
  30. 0xE3,0xC7,0x07,0xE7,0xE7,0xE7,0x86,0xC8,
  31. 0xCF,0xCF,0xCF,0x00,0xCF,0xCF,0xCF,0x01,
  32. 0x39,0x33,0x93,0x87,0xCF,0x87,0x33,0xF8},/*"技",4*/

  33. {0xF3,0xF0,0x93,0x93,0x93,0x92,0x92,0x92,
  34. 0x92,0x92,0x92,0xF2,0xE6,0xE7,0xCF,0x9F,
  35. 0xFF,0x00,0xCF,0xCF,0xCF,0x01,0x49,0x49,
  36. 0x49,0x49,0x49,0x41,0x43,0xCF,0xCF,0xCF},/*"师",5*/

  37. {0xCC,0xE6,0xE6,0xFF,0x80,0x9F,0x3F,0xE0,
  38. 0xFF,0xFE,0x00,0xFE,0xFE,0xFE,0xF8,0xFC,
  39. 0xF3,0x73,0x67,0xCF,0x00,0xFC,0xF9,0x0F,
  40. 0x9F,0x3F,0x00,0x7F,0x7F,0x7F,0x7F,0xFF},/*"学",6*/

  41. {0xFF,0x83,0x90,0x84,0x81,0x8E,0x87,0x93,
  42. 0x90,0x93,0x83,0x87,0x9E,0x9E,0x9C,0x99,
  43. 0x9F,0xCF,0x00,0xFC,0xF9,0x03,0xFF,0xFF,
  44. 0x00,0x27,0x27,0x27,0x64,0x64,0xF0,0xFF},/*"院",7*/

  45. {0xFE,0xFE,0xFC,0xF9,0xF3,0xE7,0xC0,0x1E,
  46. 0xFE,0xC0,0xFE,0xE6,0xF2,0xF2,0x00,0xFF,
  47. 0x7F,0x7F,0x3F,0x9F,0xCF,0xE7,0x03,0x78,
  48. 0x7F,0x03,0x7F,0x67,0x67,0x4F,0x00,0xFF},/*"金",8*/

  49. {0xF9,0xF9,0xF0,0xE7,0xCF,0x80,0x0E,0xCE,
  50. 0xC0,0xCE,0xCE,0xC0,0xFF,0xFF,0x00,0xFF,
  51. 0xFF,0xFF,0x0F,0xCF,0x9F,0x03,0x73,0x73,
  52. 0x03,0x73,0x73,0x03,0xFF,0xFF,0x00,0xFF},/*"鱼",9*/

  53. {0xE7,0xE7,0xE7,0xE7,0x81,0x80,0x80,0x81,
  54. 0x80,0x81,0x81,0x81,0x89,0xFF,0xFF,0xFF,
  55. 0xCF,0xCF,0x87,0x87,0x33,0x49,0xE4,0xE7,
  56. 0x01,0xF9,0xF3,0x33,0x87,0xCF,0xE7,0xE7},/*"岭",10*/

  57. {0xE7,0xE7,0xE7,0xE6,0x01,0xE7,0xC6,0xC0,
  58. 0x81,0x87,0x27,0xE7,0xE7,0xE7,0xE7,0xE4,
  59. 0x9F,0xCF,0xCF,0x00,0xFF,0x33,0x79,0xFC,
  60. 0x33,0x33,0x87,0x87,0xCF,0x87,0x33,0x78},/*"校",11*/

  61. {0xFF,0x80,0x9F,0x9F,0x99,0x9C,0x9E,0x9F,
  62. 0x9E,0x9C,0x99,0x93,0x9F,0x9F,0x80,0xFF,
  63. 0xFF,0x01,0xFF,0xE7,0xE7,0xCF,0x1F,0x3F,
  64. 0x1F,0xCF,0xE7,0xE7,0xFF,0xFF,0x00,0xFF},/*"区",12*/

  65. {0xFF,0xFF,0xFF,0xF3,0xC3,0xF3,0xF3,0xF3,
  66. 0xF3,0xF3,0xF3,0xF3,0xF3,0xC0,0xFF,0xFF,/*"1",13*/
  67. 0xFF,0xFF,0xFF,0x80,0x9F,0x9F,0x9F,0x83,
  68. 0x99,0xFC,0xFC,0x9C,0x99,0xC3,0xFF,0xFF},/*"5",14*/

  69. {0xE7,0xE4,0xCF,0xCF,0x93,0x03,0xE7,0xCF,
  70. 0x9E,0x02,0x9E,0xFE,0xE0,0x0C,0x99,0xFE,
  71. 0xFF,0x01,0x39,0x33,0x33,0x27,0x21,0x39,
  72. 0x19,0x19,0x43,0x43,0xE7,0xC3,0x99,0x3C},/*"级",15*/

  73. {0xFE,0xFE,0xFE,0xC0,0xCE,0xCE,0xCE,0xC0,
  74. 0xCE,0xCE,0xCE,0xC0,0xCE,0xFE,0xFE,0xFF,
  75. 0x7F,0x7F,0x7F,0x03,0x73,0x73,0x73,0x03,
  76. 0x73,0x73,0x73,0x03,0x70,0x7C,0x7C,0x00},/*"电",16*/

  77. {0xFF,0x80,0xFF,0xFF,0xFF,0xFE,0xFE,0x00,
  78. 0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xF8,0xFC,
  79. 0xFF,0x03,0xE7,0xCF,0x9F,0x3F,0x7F,0x00,
  80. 0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0xFF},/*"子",17*/

  81. {0xFE,0xFE,0xFE,0xC0,0xFC,0xFC,0x00,0xF9,
  82. 0xF3,0xF0,0xFF,0xFF,0xF8,0xFE,0xFF,0xFF,
  83. 0x7F,0x7F,0x7F,0x03,0xFF,0xFF,0x00,0xFF,
  84. 0xFF,0x07,0xE7,0xCF,0x9F,0x3F,0x9F,0xCF},/*"专",18*/

  85. {0xF9,0xF9,0xF9,0xF9,0x99,0xC9,0xC9,0xE1,
  86. 0xE1,0xE1,0xF9,0xF9,0xF9,0xF9,0x00,0xFF,
  87. 0x9F,0x9F,0x9F,0x9F,0x99,0x99,0x93,0x93,
  88. 0x87,0x8F,0x9F,0x9F,0x9F,0x9F,0x00,0xFF},/*"业",19*/

  89. {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  90. 0xFF,0xC7,0xC7,0xFF,0xC7,0xC7,0xFF,0xFF,
  91. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  92. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},/*":",20*/

  93. {0xF3,0xF3,0x00,0xF3,0x9F,0xC8,0xCF,0x38,
  94. 0x99,0x80,0xE1,0x08,0xC9,0xC9,0xC9,0xF9,
  95. 0xCF,0xCF,0x00,0xC3,0x99,0x00,0x9F,0x01,
  96. 0x99,0x01,0x99,0x01,0x99,0x99,0x81,0xF3},/*"蒲",21*/

  97. {0xF3,0xF3,0x00,0xF3,0xFF,0xFF,0xC0,0xCF,
  98. 0xCF,0xCF,0xCF,0xCF,0xCF,0x9F,0x9E,0x38,
  99. 0xCF,0xCF,0x00,0xCF,0x27,0x33,0x01,0x3F,
  100. 0x33,0x33,0x87,0x87,0xC9,0x81,0x31,0xF9},/*"茂",22*/

  101. {0xFC,0xFE,0xC0,0xCF,0xCF,0xC0,0xCF,0xCF,
  102. 0xC0,0xCC,0xCE,0xCF,0xCF,0xC9,0xC3,0xC7,
  103. 0xFF,0x7F,0x07,0xE7,0xE7,0x07,0xE7,0xE7,
  104. 0x07,0xF3,0x67,0x0F,0x9F,0xCF,0xE3,0xF8},/*"良",23*/

  105. {0xFF,0xFF,0xFF,0xC3,0x99,0x3C,0x3C,0x3C,
  106. 0x3C,0x3C,0x3C,0x04,0x91,0xC3,0xF8,0xFF,/*"Q",24*/
  107. 0xFF,0xFF,0xFF,0xC3,0x99,0x3C,0x3C,0x3C,
  108. 0x3C,0x3C,0x3C,0x04,0x91,0xC3,0xF8,0xFF},/*"Q",25*/

  109. {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  110. 0xFF,0xC7,0xC7,0xFF,0xC7,0xC7,0xFF,0xFF,
  111. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  112. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},/*":",26*/

  113. {0xFF,0xFF,0xFF,0xF3,0xC3,0xF3,0xF3,0xF3,
  114. 0xF3,0xF3,0xF3,0xF3,0xF3,0xC0,0xFF,0xFF,/*"1",27*/
  115. 0xFF,0xFF,0xFF,0x80,0x9F,0x9F,0x9F,0x83,
  116. 0x99,0xFC,0xFC,0x9C,0x99,0xC3,0xFF,0xFF},/*"5",28*/

  117. {0xFF,0xFF,0xFF,0xF9,0xF1,0xF1,0xE1,0xC9,
  118. 0xC9,0x99,0x80,0xF9,0xF9,0xE0,0xFF,0xFF,/*"4",29*/
  119. 0xFF,0xFF,0xFF,0xE3,0xC9,0x9C,0x9C,0x9C,
  120. 0x9C,0x9C,0x9C,0x9C,0xC9,0xE3,0xFF,0xFF},/*"0",30*/

  121. {0xFF,0xFF,0xFF,0xC1,0x9C,0x9C,0x9C,0xC9,
  122. 0xE3,0xC9,0x9C,0x9C,0x9C,0xC1,0xFF,0xFF,/*"8",31*/
  123. 0xFF,0xFF,0xFF,0xC1,0x9C,0x9C,0x9C,0xFC,
  124. 0xF9,0xF3,0xE7,0xCF,0x9C,0x80,0xFF,0xFF},/*"2",32*/

  125. {0xFF,0xFF,0xFF,0x80,0x9C,0xF9,0xF9,0xF3,
  126. 0xF3,0xE7,0xE7,0xE7,0xE7,0xE7,0xFF,0xFF,/*"7",33*/
  127. 0xFF,0xFF,0xFF,0x80,0x9C,0xF9,0xF9,0xF3,
  128. 0xF3,0xE7,0xE7,0xE7,0xE7,0xE7,0xFF,0xFF},/*"7",34*/

  129. {0xFF,0xFF,0xFF,0xE3,0xC9,0x9C,0x9C,0x9C,
  130. 0x9C,0x9C,0x9C,0x9C,0xC9,0xE3,0xFF,0xFF,/*"0",35*/
  131. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  132. 0xFF,0xFF,0xFF,0xFF,0x8F,0x8F,0xFF,0xFF},/*".",36*/

  133. };
  134. /****上面就是列数据,数据可以用取模软件生成****/

  135. void main()
  136. {
  137.   TMOD=0x01;
  138.   TH0=(65536-50000)/256;
  139.   TL0=(65536-50000)%256;
  140.   TR0=1;
  141.   /****这是时间设定****/
  142. while(1)
  143.   {
  144.    if(TF0==1)//判断定时设定是否溢出,
  145.     {
  146.          TF0=0;        //溢出就清零。
  147.          c++;
  148.          if(c==16)//溢出16次为一秒,数据之间间隔。
  149.           {
  150.             c=0;
  151.             b++;  //这是数组个数,满30就重头开始。
  152.                 if(b==30)
  153.                  {
  154.               b=0;
  155.                  }
  156.           }
  157.         }
  158. /*下面中每一次数据传输后都有个清屏,也就是消隐,数据32个中前16个是
  159. 每个字的前一半,同理后16个*/
  160.    for(a=0;a<8;a++)         //前8位扫描;
  161.     {
  162.          sao=1;
  163.          P3=tbo[a];
  164.          su=1;
  165.          P1=tbo1[b][a];
  166.          P1=0xff;
  167.          su=0;
  168.          su1=1;
  169.          P1=tbo1[b][a+16];//A加16是数据前面8位;
  170.          P1=0xff;
  171.          su1=0;
  172.         }
  173.         P3=0x00;
  174.         sao=0;

  175.    for(a=8;a<16;a++)  //后8位扫描;
  176.     {
  177.          sao1=1;
  178.          P3=tbo[a];
  179.          su=1;
  180.          P1=tbo1[b][a];
  181.          P1=0xff;
  182.          su=0;
  183.          su1=1;
  184.          P1=tbo1[b][a+16]; //A加16是数据后面8位;
  185.          P1=0xff;
  186.          su1=0;
  187.         }
  188.         P3=0x00;
  189.         sao1=0;
  190.         a=0;

  191. …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码

所有资料51hei提供下载:
16x16显示(单片机).zip (3.61 KB, 下载次数: 40)

评分

参与人数 1黑币 +50 收起 理由
admin + 50 共享资料的黑币奖励!

查看全部评分

回复

使用道具 举报

ID:1 发表于 2017-11-9 03:22 | 显示全部楼层
好资料,51黑有你更精彩!!!
回复

使用道具 举报

ID:241769 发表于 2017-11-10 08:21 | 显示全部楼层
admin 发表于 2017-11-9 03:22
好资料,51黑有你更精彩!!!

为什么我的视屏没有发上去?
回复

使用道具 举报

ID:412500 发表于 2019-4-13 19:50 | 显示全部楼层
真不知道我哪天才有此水平
回复

使用道具 举报

ID:320097 发表于 2019-4-13 22:12 | 显示全部楼层
P1=tbo1[b][a],初学者请教一下,这样写是P1=tbo1[b],还是P1=tbo1o[a]
回复

使用道具 举报

ID:653220 发表于 2019-12-11 11:09 来自手机 | 显示全部楼层
灯的亮度不够
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表