找回密码
 立即注册

QQ登录

只需一步,快速开始

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

0-30V 4A数控稳压电源资料

[复制链接]
跳转到指定楼层
楼主


单片机源程序如下:
  1. #include"reg52.h"
  2. #include"math.h"
  3. #include"intrins.h"
  4. #include"function.h"

  5. #define DB P0

  6. sbit RS = P1^4;
  7. sbit RW = P1^5;
  8. sbit E  = P1^6;

  9. uchar code logo[] = {

  10. /*--  调入了一幅图像:I:\液晶屏BMP图\菜单.bmp  --*/
  11. /*--  宽度x高度=128x64  --*/
  12. 0x00,0x00,0x00,0x20,0x20,0x08,0x20,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
  13. 0x00,0x00,0x00,0x20,0x17,0xFC,0x13,0xF0,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
  14. 0x00,0x00,0x78,0x20,0x50,0x08,0x12,0x20,0x24,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
  15. 0x10,0x00,0x4B,0xFC,0x40,0x08,0x02,0x20,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
  16. 0x70,0x00,0x48,0x20,0x47,0xC8,0x02,0x1C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  17. 0x10,0x00,0x48,0x20,0x44,0x48,0xF4,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
  18. 0x10,0x00,0x79,0x20,0x44,0x48,0x1B,0xF0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  19. 0x10,0x00,0x48,0xA0,0x47,0xC8,0x11,0x10,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
  20. 0x10,0x00,0x48,0xA0,0x44,0x48,0x11,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
  21. 0x10,0x00,0x48,0x20,0x44,0x48,0x14,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
  22. 0x10,0x00,0x78,0x20,0x47,0xC8,0x18,0x40,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
  23. 0x10,0x60,0x48,0x20,0x40,0x08,0x10,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
  24. 0x7C,0x60,0x40,0xA0,0x40,0x28,0x03,0x1C,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
  25. 0x00,0x00,0x00,0x40,0x40,0x10,0x0C,0x08,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
  26. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  27. 0x00,0x00,0x00,0x10,0x00,0x10,0x20,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
  28. 0x00,0x00,0x1F,0xF8,0x3F,0xF8,0x13,0xF0,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
  29. 0x00,0x00,0x10,0x10,0x00,0x00,0x12,0x20,0x24,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
  30. 0x3C,0x00,0x1F,0xF0,0x00,0x00,0x02,0x20,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
  31. 0x42,0x00,0x10,0x10,0x00,0x08,0x02,0x1C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  32. 0x42,0x00,0x1F,0xF0,0x7F,0xFC,0xF4,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
  33. 0x02,0x00,0x10,0x10,0x01,0x00,0x1B,0xF0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  34. 0x04,0x00,0x04,0x80,0x09,0x40,0x11,0x10,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
  35. 0x08,0x00,0x44,0x88,0x09,0x20,0x11,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
  36. 0x10,0x00,0x24,0x90,0x11,0x10,0x14,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
  37. 0x20,0x00,0x14,0xA0,0x21,0x08,0x18,0x40,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
  38. 0x42,0x60,0x14,0xC0,0x41,0x08,0x10,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
  39. 0x7E,0x60,0x04,0x88,0x05,0x00,0x03,0x1C,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
  40. 0x00,0x00,0xFF,0xFC,0x02,0x00,0x0C,0x08,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
  41. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  42. 0x00,0x00,0x08,0x40,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  43. 0x00,0x00,0x1C,0x40,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  44. 0x00,0x00,0xF0,0x40,0x7F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  45. 0x3C,0x00,0x11,0x50,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  46. 0x42,0x00,0xFD,0x48,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  47. 0x42,0x00,0x11,0x44,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  48. 0x04,0x00,0x32,0x44,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  49. 0x18,0x00,0x3A,0x40,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  50. 0x04,0x00,0x52,0x48,0x09,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  51. 0x02,0x00,0x50,0x10,0x18,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  52. 0x42,0x00,0x90,0x20,0x28,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  53. 0x42,0x60,0x10,0x40,0xC9,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  54. 0x3C,0x60,0x11,0x80,0x0A,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  55. 0x00,0x00,0x16,0x00,0x0C,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  56. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  57. 0x00,0x00,0x20,0x08,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  58. 0x00,0x00,0x17,0xFC,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  59. 0x00,0x00,0x48,0x08,0x3C,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  60. 0x08,0x00,0x42,0x08,0x41,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  61. 0x08,0x00,0x5F,0xE8,0x41,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  62. 0x18,0x00,0x42,0x08,0xF9,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  63. 0x28,0x00,0x4F,0xC8,0xA1,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  64. 0x48,0x00,0x4A,0x48,0x21,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  65. 0x48,0x00,0x4A,0x48,0xFD,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  66. 0x7E,0x00,0x4A,0x48,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  67. 0x08,0x00,0x4A,0xC8,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  68. 0x08,0x60,0x42,0x08,0x28,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  69. 0x1E,0x60,0x42,0x28,0x30,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  70. 0x00,0x00,0x40,0x10,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  71. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  72. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  73. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  74. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  75. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

  76.                      };

  77. /************************************************************************************
  78.                    查忙函数         
  79. ************************************************************************************/
  80. void busy(void)//RS=0;RW=1;wait=0闲;wait!=0忙
  81. {
  82.     uchar wait;
  83.     RS = 0;
  84.     RW = 1;
  85.     E = 1;
  86.     for(;;)
  87.     {
  88.         wait = DB;
  89.         wait &= 0x80;
  90.         if(wait == 0)break;
  91.     }
  92.     E = 0;
  93. }

  94. /************************************************************************************
  95.                    写指令函数         
  96. ************************************************************************************/
  97. void w_code(uchar c)//RS=0;RW=0;E下降沿
  98. {
  99.     busy();
  100.     RS = 0;
  101.     RW = 0;
  102.     DB = c;
  103.     E = 1;
  104.     E = 0;
  105.     DB = 0xff;
  106. }

  107. /************************************************************************************
  108.                    写数据函数        
  109. ************************************************************************************/
  110. void w_data(uchar d)//RS=1;RW=0;E下降沿
  111. {
  112.     busy();
  113.     RS = 1;
  114.     RW = 0;
  115.     DB = d;
  116.     E = 1;
  117.     E = 0;
  118.     DB = 0xff;
  119. }

  120. /************************************************************************************
  121.                          读数据函数         
  122. ************************************************************************************/
  123. uchar r_data(void)//RS=1;RW=1;E下降沿
  124. {
  125.     uchar rd_lcd;
  126.     busy();
  127.     RS = 1;
  128.     RW = 1;
  129.     E = 1;
  130.     rd_lcd = DB;
  131.     E = 0;
  132.         return rd_lcd;
  133. }

  134. /************************************************************************************
  135.                    写DGRAM:x_lcd横坐标,y_lcd纵坐标         
  136. ************************************************************************************/
  137. void address(uchar x_lcd,uchar y_lcd)//
  138. {
  139.     w_code(y_lcd);//垂直坐标
  140.     w_code(x_lcd);//水平坐标
  141. }

  142. /************************************************************************************
  143.                    初始化液晶屏
  144.                                    0:字库  1:绘图      
  145. ************************************************************************************/
  146. void  lcd_rst(bit a)
  147. {  
  148.     if(a)
  149.         {
  150.         w_code(0x01);//   清屏  
  151.         w_code(0x32);//   功能设置---8BIT控制界面,绘图显示ON  
  152.         w_code(0x36);//   功能设置---8BIT控制界面,扩充指令集  
  153.         }
  154.         else
  155.         {
  156.         w_code(0x30);// 功能设置---8BIT控制界面,基本指令集
  157.         w_code(0x0c);//显示打开,光标关,反白显示关
  158.         w_code(0x01);// 清除屏幕显示,将DDRAM的地址计数器归零
  159.         }
  160. }

  161. /************************************************************************************
  162. ---------------------------写整屏点阵数据
  163. ---------------------------x :图像数据的起始地址        
  164. ************************************************************************************/

  165. void  write_lcd_full(uint x )
  166. {

  167.           uchar  i,j,a;
  168.           j = 0x80; //Y地址寄存器   
  169.           for(a = 0;a < 32;a++)
  170.                   {
  171.                 w_code(j);
  172.                 j++;
  173.                 w_code(0x80);//X地址寄存器
  174.                   for(i = 0;i < 16;i ++)
  175.                           {
  176.                         w_data(logo[x]);
  177.                         x++;
  178.                         }
  179.                 }

  180.           j = 0x80; //Y地址寄存器  
  181.           for(a = 0;a < 32;a++)
  182.                   {
  183.                 w_code(j);
  184.                 j++;
  185.                 w_code(0x88);//X地址寄存器
  186.                   for(i = 0;i < 16;i ++)
  187.                           {
  188.                         w_data(logo[x]);
  189.                         x++;
  190.                         }
  191.                 }
  192. }


复制代码

所有资料51hei提供下载:
0-30V 4A数控稳压电源图.pdf (68.11 KB, 下载次数: 18)


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

使用道具 举报

沙发
ID:307985 发表于 2018-4-26 09:24 | 只看该作者
有仿真的文件吗
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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