找回密码
 注册

QQ登录

只需一步,快速开始

搜索

51单片机+74LS595+74HC154六字led点阵屏幕Proteus仿真程序

[复制链接]
eng 发表于 2021-7-6 16:17:21 | 显示全部楼层 |阅读模式
6个16*16的点阵 显示6个汉字 仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
1.png


  1. #include<AT89X52.H>
  2. sbit ST=P3^5;
  3. sbit E1=P3^4;
  4. sbit MR=P3^7;
  5. char cashe[12];
  6. char code wd[12][16]={


  7. {0xFF,0xC0,0xFE,0xFE,0xFE,0xFE,0x80,0xFE,0xFD,0xFD,0xFB,0xF7,0xEF,0xDF,0x3F,0xFF},
  8. {0xFF,0x03,0xFF,0xFF,0xFF,0xFF,0x01,0x7F,0x7F,0x7F,0x7F,0x7F,0x7D,0x7D,0x81,0xFF},/*"无",0*/
  9. /* (16 X 16 , 宋体 )*/

  10. {0xDF,0xDF,0xDF,0xCF,0x57,0x58,0x5F,0xDF,0xDE,0xDE,0xDE,0xDD,0xDD,0xDB,0xDB,0xD7},
  11. {0x7F,0x6F,0x73,0x77,0x7F,0x01,0x5F,0x5F,0xDF,0xDF,0xDF,0xDF,0xDD,0xDD,0xE1,0xFF},/*"忧",1*/
  12. /* (16 X 16 , 宋体 )*/

  13. {0xFE,0xFE,0xFE,0xC0,0xDE,0xDE,0xC0,0xDE,0xDE,0xDE,0xC0,0xDE,0xFE,0xFE,0xFF,0xFF},
  14. {0xFF,0xFF,0xFF,0x07,0xF7,0xF7,0x07,0xF7,0xF7,0xF7,0x07,0xF7,0xFD,0xFD,0x01,0xFF},/*"电",2*/
  15. /* (16 X 16 , 宋体 )*/

  16. {0xFF,0xC0,0xFF,0xFF,0xFF,0xFE,0xFE,0xFE,0x00,0xFE,0xFE,0xFE,0xFE,0xFE,0xFA,0xFD},
  17. {0xFF,0x0F,0xDF,0xBF,0x7F,0xFF,0xFF,0xFB,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},/*"子",3*/
  18. /* (16 X 16 , 宋体 )*/

  19. {0xFF,0x83,0xBB,0xAB,0xAA,0xAA,0xA9,0xAB,0xAB,0xAA,0xEE,0xD7,0xDB,0xBB,0x7F,0xFF},
  20. {0x7F,0x3F,0x7F,0x01,0xFD,0xFD,0xBD,0xBD,0x5D,0xED,0x05,0xED,0xFD,0xFD,0xEB,0xF7},/*"购",4*/
  21. /* (16 X 16 , 宋体 )*/

  22. {0xEF,0xEF,0xAF,0xAE,0x82,0xAD,0x6B,0xEB,0xE6,0xCD,0x2B,0xEF,0xEE,0xED,0xEB,0xFF},
  23. {0x7F,0x7F,0x7F,0x03,0xAB,0xAB,0x6B,0x6B,0xDB,0xDB,0xBB,0x7B,0xFB,0xFB,0xD7,0xEF},/*"物",5*/
  24. /* (16 X 16 , 宋体 )*/

  25. };


  26. void del(int i)//============================//延时程序
  27. {while(i--);}

  28. aline()        ////=======================发送一行的显示程序
  29. {
  30. char i=0;
  31. TI=0;
  32. for(i=0;i<12;i++)
  33. {SBUF=cashe[i];while(~TI);TI=0;} //将缓存中的信息转存入595的存储器中,到此不显示
  34. }

  35. main()
  36. {
  37. int m=0,n=0;
  38.         TI=0;
  39.         SM0=0;
  40.         SM1=0;
  41. E1=0;
  42. while(1)
  43. for(m=0;m<16;m++)      //共有16行  循环16次显示这16行  串行的595送出行的数据
  44.         {                                        //由74hc154选中要显示的行

  45.         for(n=0;n<12;n++)         //这个for循环用来向缓存数组中装载要显示的内容
  46.                 {cashe[11-n]=wd[n][m];}  //将第m个字的第n行信息装载  ,因为595串接 数据第一个进去的会在最后一个595中,最后进去的会在第一个595中
  47.     aline();     //将缓存中的一行信息载入595缓存中
  48.         ST=0;ST=1; //595产生上升沿 输出595锁存的数据
  49.         P2=m;  //选中要显示的行输出数据
  50.       
  51.         del(100);//延时一段时间,以造成视觉暂存效应

  52.           }

  53. }
复制代码
四字点阵屏单片机源码和仿真文件.rar (837.39 KB, 售价: 3 E币)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|ELEOK |网站地图

GMT+8, 2024-12-22 12:04

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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