找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1941|回復: 1
打印 上一主題 下一主題
收起左側

0-30V 4A數(shù)控穩(wěn)壓電源資料

[復制鏈接]
跳轉到指定樓層
樓主
ID:307745 發(fā)表于 2018-4-14 22:30 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式


單片機源程序如下:
  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.                    查忙函數(shù)         
  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.                    寫指令函數(shù)         
  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.                    寫數(shù)據(jù)函數(shù)        
  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.                          讀數(shù)據(jù)函數(shù)         
  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的地址計數(shù)器歸零
  159.         }
  160. }

  161. /************************************************************************************
  162. ---------------------------寫整屏點陣數(shù)據(jù)
  163. ---------------------------x :圖像數(shù)據(jù)的起始地址        
  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數(shù)控穩(wěn)壓電源圖.pdf (68.11 KB, 下載次數(shù): 18)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發(fā)
ID:307985 發(fā)表于 2018-4-26 09:24 | 只看該作者
有仿真的文件嗎
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復 返回頂部 返回列表