找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6284|回复: 3
打印 上一主题 下一主题
收起左侧

16*64点阵显示汉字Proteus仿真,74hc595

[复制链接]
跳转到指定楼层
楼主
用74ls154和74hc595完成

Proteus仿真: 80290427916x64LeD-in-51.rar (85.59 KB, 下载次数: 144)


程序如下
  1. #include <reg52.h>
  2. #define uchar  unsigned char
  3. #define uint   unsigned int
  4. sbit        P1_0=P1^0;
  5. sbit        P1_1=P1^1;
  6. sbit        P1_2=P1^2;
  7. sbit         P1_3=P1^3;
  8. sbit        P3_0=P3^0;

  9. uchar idata pragm[4*32]={0};
  10. uchar pos=0;
  11. uchar code zi[12][32]={
  12. {0x01,0x00,0x41,0x00,0x23,0xF8,0x22,0x08,
  13. 0x85,0x10,0x50,0xA0,0x50,0x40,0x10,0xB0,
  14. 0x23,0x0E,0x2E,0x04,0xE3,0xF8,0x22,0x08,
  15. 0x22,0x08,0x22,0x08,0x23,0xF8,0x22,0x08},/*"洛",0*/

  16. {0x10,0x00,0x10,0xFC,0x20,0x84,0x3E,0x84,
  17. 0x40,0x84,0x7C,0xFC,0x90,0x84,0x10,0x84,
  18. 0xFE,0x84,0x10,0xFC,0x10,0x84,0x12,0x84,
  19. 0x14,0x84,0x18,0xFC,0x10,0x84,0x00,0x00},/*"钼",4*/

  20. {0x08,0x80,0x08,0x40,0x1F,0xF8,0x30,0x80,
  21. 0x5F,0xF8,0x10,0x80,0x1F,0xF8,0x10,0x80,
  22. 0x1F,0xFC,0x01,0x00,0x7F,0xFE,0x03,0x40,
  23. 0x05,0x20,0x19,0x1C,0x61,0x08,0x01,0x00},/*"集",6*/

  24. {0x00,0x00,0x7F,0xFC,0x40,0x84,0x40,0x84,
  25. 0x5F,0xF4,0x41,0x84,0x41,0x84,0x42,0x84,
  26. 0x44,0x84,0x48,0x84,0x50,0x84,0x60,0x84,
  27. 0x42,0x84,0x41,0x04,0x7F,0xFC,0x40,0x04},/*"团",7*/

  28. {0x01,0x00,0x01,0x00,0x02,0x80,0x04,0x40,
  29. 0x08,0x30,0x30,0x0E,0xCF,0xF4,0x01,0x00,
  30. 0x01,0x00,0x3F,0xF8,0x01,0x00,0x09,0x20,
  31. 0x05,0x20,0x05,0x40,0xFF,0xFE,0x00,0x00},/*"金",8*/

  32. {0x3F,0xFC,0x20,0x04,0x3F,0xFC,0x20,0x00,
  33. 0x2F,0xF8,0x20,0x80,0x27,0xF8,0x24,0x88,
  34. 0x27,0xF8,0x20,0x80,0x2F,0xFC,0x28,0xA4,
  35. 0x48,0xF4,0x4B,0x14,0x88,0x04,0x08,0x0C},/*"属",9*/

  36. {0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,
  37. 0xFD,0xFE,0x10,0x10,0x38,0x30,0x34,0x30,
  38. 0x34,0x50,0x50,0x50,0x50,0x90,0x91,0x10,
  39. 0x12,0x10,0x10,0x10,0x10,0x50,0x10,0x20},/*"材",10*/

  40. {0x08,0x08,0x08,0x88,0x4A,0x48,0x2C,0x48,
  41. 0x18,0x08,0xFF,0x08,0x1C,0x88,0x2A,0x48,
  42. 0x2A,0x4E,0x49,0xF8,0x48,0x08,0x88,0x08,
  43. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},/*"料",11*/

  44. {0x01,0x00,0x01,0x00,0x7F,0xFE,0x02,0x00,
  45. 0x04,0x00,0x0F,0xF0,0x18,0x10,0x28,0x10,
  46. 0x4F,0xF0,0x88,0x10,0x08,0x10,0x0F,0xF0,
  47. 0x08,0x10,0x08,0x90,0x08,0x70,0x08,0x20},/*"有",12*/

  48. {0x00,0x00,0xFB,0xF8,0x92,0x08,0x93,0xF8,
  49. 0xA2,0x08,0xA2,0x08,0x93,0xF8,0x8A,0x80,
  50. 0x8A,0x48,0xAA,0x50,0x92,0x20,0x82,0x20,
  51. 0x82,0x10,0x82,0x8E,0x83,0x04,0x82,0x00},/*"限",13*/

  52. {0x00,0x00,0x04,0x40,0x06,0x40,0x04,0x40,
  53. 0x08,0x20,0x08,0x10,0x10,0x18,0x22,0x0E,
  54. 0x43,0x04,0x02,0x00,0x04,0x20,0x08,0x10,
  55. 0x11,0xF8,0x3F,0x18,0x10,0x10,0x00,0x00},/*"公",14*/

  56. {0x00,0x00,0x3F,0xFC,0x00,0x04,0x00,0x04,
  57. 0x7F,0xE4,0x00,0x04,0x00,0x04,0x3F,0xC4,
  58. 0x20,0x44,0x20,0x44,0x3F,0xC4,0x20,0x44,
  59. 0x20,0x04,0x00,0x14,0x00,0x08,0x00,0x00},/*"司",15*/

  60. };
  61. unsigned long int T500ms=0;
  62. uchar T500ms_flag=0,k=0;
  63. void delay(int z);
  64. void main()
  65. {
  66.     uchar l,n,k,m,q;
  67.         SCON=0x00;
  68.         TMOD=0x01;
  69.         TR0=1;
  70.         IE=0x82;
  71.         P2=0x3f;
  72.   while(1)
  73.   {
  74.   for(l=0;l<12;l++)
  75.   {
  76.    for(n=0;n<2;n++)
  77.    {
  78.    for(k=0;k<8;k++)
  79.    {
  80.     for(m=0;m<16;m++)
  81.     {
  82.      for(q=0;q<4;q++)
  83.      {
  84.       pragm[m*2+q*32]=pragm[m*2+q*32]<<1|pragm[m*2+1+q*32]>>7;
  85.       if(q==3)  pragm[m*2+1+q*32]=pragm[m*2+q*32+1]<<1|zi[l][m*2+n]>>(7-k);
  86.       else
  87.       pragm[m*2+1+q*32]=pragm[m*2+1+q*32]<<1|pragm[m*2+(q+1)*32]>>7;
  88.      }
  89.          delay(80);
  90.     }
  91.         delay(2000);
  92.     }
  93.    }
  94.   }
  95.   }
  96. }
  97. void delay(int z)   
  98. {
  99. int i,j;
  100. for(i=z;i>0;i--)
  101.    for(j=4;j>0;j--);
  102. }
  103. void leddisplay(void)interrupt 1
  104. {
  105.          register unsigned char m,n=8;
  106.      TH0=0xfc;
  107.          TL0=0x18;
  108.          m=P2;
  109.          m=++m&0x0f;
  110.          do
  111.          {
  112.                  n--;
  113.                 SBUF=pragm[m*2+(n/2)*30+n];
  114.                 while(!TI);        
  115.             TI=0;
  116.      }while(n);
  117.          P1_3=1;
  118.          P2&=0xf0;
  119.          P1_0=0;
  120.          P2|=m;
  121.          P1_0=1;
  122.          delay(1);
  123.          P1_0=0;
  124.          P1_3=0;
  125. }
复制代码









分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏2 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:110935 发表于 2016-6-24 22:43 | 只看该作者
不错的学习材料,不知道仅仅用74hc595行不行
回复

使用道具 举报

板凳
ID:165107 发表于 2017-2-17 14:50 | 只看该作者
正需要
回复

使用道具 举报

地板
ID:906181 发表于 2021-4-29 19:39 | 只看该作者
想问一下为什么仿真时会出现Logic contention(s) detected on net P20.;Logic contention(s) detected on net P21这些错误呢?谢谢
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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