給51黑論壇的朋友們分享一個不錯的51單片機(jī)0-30v 4A數(shù)控電源.就是成本有點高!兩路輸出:1:0-30V/4A 2: 5V/1.5A(固定輸出)
電壓分辨率0.458mV,電流分辨率0.076mA
電壓步進(jìn)0.0073V,實際用的是0.1V步進(jìn)調(diào)節(jié)
在制作中發(fā)現(xiàn);C37極性畫反了!還有就是復(fù)位電路是51和AVR都兼容的,不能把四個原件都焊接上去,
用什么芯片就焊接什么樣的復(fù)位電路 !特此告知!
0.png (895.56 KB, 下載次數(shù): 190)
下載附件
2016-10-11 11:07 上傳
0.png (554.06 KB, 下載次數(shù): 181)
下載附件
2016-10-11 11:07 上傳
0.png (828.05 KB, 下載次數(shù): 210)
下載附件
2016-10-11 11:07 上傳
0.png (829.44 KB, 下載次數(shù): 206)
下載附件
2016-10-11 11:07 上傳
1.png (260.43 KB, 下載次數(shù): 235)
下載附件
2023-5-21 18:20 上傳
0.png (113.09 KB, 下載次數(shù): 191)
下載附件
2016-10-11 11:07 上傳
單片機(jī)源程序:
- #include"reg52.h"
- #include"math.h"
- #include"intrins.h"
- #include"function.h"
- #define DB P0
- sbit RS = P1^4;
- sbit RW = P1^5;
- sbit E = P1^6;
- uchar code logo[] = {
- /*-- 調(diào)入了一幅圖像:I:\液晶屏BMP圖\菜單.bmp --*/
- /*-- 寬度x高度=128x64 --*/
- 0x00,0x00,0x00,0x20,0x20,0x08,0x20,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x20,0x17,0xFC,0x13,0xF0,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x78,0x20,0x50,0x08,0x12,0x20,0x24,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x4B,0xFC,0x40,0x08,0x02,0x20,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x70,0x00,0x48,0x20,0x47,0xC8,0x02,0x1C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x48,0x20,0x44,0x48,0xF4,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x79,0x20,0x44,0x48,0x1B,0xF0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x48,0xA0,0x47,0xC8,0x11,0x10,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x48,0xA0,0x44,0x48,0x11,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x48,0x20,0x44,0x48,0x14,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x78,0x20,0x47,0xC8,0x18,0x40,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x60,0x48,0x20,0x40,0x08,0x10,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x7C,0x60,0x40,0xA0,0x40,0x28,0x03,0x1C,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x40,0x40,0x10,0x0C,0x08,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x10,0x00,0x10,0x20,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x1F,0xF8,0x3F,0xF8,0x13,0xF0,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x10,0x10,0x00,0x00,0x12,0x20,0x24,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x3C,0x00,0x1F,0xF0,0x00,0x00,0x02,0x20,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x42,0x00,0x10,0x10,0x00,0x08,0x02,0x1C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x42,0x00,0x1F,0xF0,0x7F,0xFC,0xF4,0x00,0x7F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x02,0x00,0x10,0x10,0x01,0x00,0x1B,0xF0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x04,0x00,0x04,0x80,0x09,0x40,0x11,0x10,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x08,0x00,0x44,0x88,0x09,0x20,0x11,0x10,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x00,0x24,0x90,0x11,0x10,0x14,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x20,0x00,0x14,0xA0,0x21,0x08,0x18,0x40,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x42,0x60,0x14,0xC0,0x41,0x08,0x10,0xA0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x7E,0x60,0x04,0x88,0x05,0x00,0x03,0x1C,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0xFF,0xFC,0x02,0x00,0x0C,0x08,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x08,0x40,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x1C,0x40,0x02,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0xF0,0x40,0x7F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x3C,0x00,0x11,0x50,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x42,0x00,0xFD,0x48,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x42,0x00,0x11,0x44,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x04,0x00,0x32,0x44,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x18,0x00,0x3A,0x40,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x04,0x00,0x52,0x48,0x09,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x02,0x00,0x50,0x10,0x18,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x42,0x00,0x90,0x20,0x28,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x42,0x60,0x10,0x40,0xC9,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x3C,0x60,0x11,0x80,0x0A,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x16,0x00,0x0C,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x20,0x08,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x17,0xFC,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x48,0x08,0x3C,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x08,0x00,0x42,0x08,0x41,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x08,0x00,0x5F,0xE8,0x41,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x18,0x00,0x42,0x08,0xF9,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x28,0x00,0x4F,0xC8,0xA1,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x48,0x00,0x4A,0x48,0x21,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x48,0x00,0x4A,0x48,0xFD,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x7E,0x00,0x4A,0x48,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x08,0x00,0x4A,0xC8,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x08,0x60,0x42,0x08,0x28,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x1E,0x60,0x42,0x28,0x30,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x40,0x10,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- /************************************************************************************
- 查忙函數(shù)
- ************************************************************************************/
- void busy(void)//RS=0;RW=1;wait=0閑;wait!=0忙
- {
- uchar wait;
- RS = 0;
- RW = 1;
- E = 1;
- for(;;)
- {
- wait = DB;
- wait &= 0x80;
- if(wait == 0)break;
- }
- E = 0;
- }
- /************************************************************************************
- 寫指令函數(shù)
- ************************************************************************************/
- void w_code(uchar c)//RS=0;RW=0;E下降沿
- {
- busy();
- RS = 0;
- RW = 0;
- DB = c;
- E = 1;
- E = 0;
- DB = 0xff;
- }
- /************************************************************************************
- 寫數(shù)據(jù)函數(shù)
- ************************************************************************************/
- void w_data(uchar d)//RS=1;RW=0;E下降沿
- {
- busy();
- RS = 1;
- RW = 0;
- DB = d;
- E = 1;
- E = 0;
- DB = 0xff;
- }
- /************************************************************************************
- 讀數(shù)據(jù)函數(shù)
- ************************************************************************************/
- uchar r_data(void)//RS=1;RW=1;E下降沿
- {
- uchar rd_lcd;
- busy();
- RS = 1;
- RW = 1;
- E = 1;
- rd_lcd = DB;
- E = 0;
- return rd_lcd;
- }
- /************************************************************************************
- 寫DGRAM:x_lcd橫坐標(biāo),y_lcd縱坐標(biāo)
- ************************************************************************************/
- void address(uchar x_lcd,uchar y_lcd)//
- {
- w_code(y_lcd);//垂直坐標(biāo)
- w_code(x_lcd);//水平坐標(biāo)
- }
- /************************************************************************************
- 初始化液晶屏
- 0:字庫 1:繪圖
- ************************************************************************************/
- void lcd_rst(bit a)
- {
- if(a)
- {
- w_code(0x01);// 清屏
- w_code(0x32);// 功能設(shè)置---8BIT控制界面,繪圖顯示ON
- w_code(0x36);// 功能設(shè)置---8BIT控制界面,擴(kuò)充指令集
- }
- else
- {
- w_code(0x30);// 功能設(shè)置---8BIT控制界面,基本指令集
- w_code(0x0c);//顯示打開,光標(biāo)關(guān),反白顯示關(guān)
- w_code(0x01);// 清除屏幕顯示,將DDRAM的地址計數(shù)器歸零
- }
- }
- /************************************************************************************
- ---------------------------寫整屏點陣數(shù)據(jù)
- ---------------------------x :圖像數(shù)據(jù)的起始地址
- ************************************************************************************/
- void write_lcd_full(uint x )
- {
-
- uchar i,j,a;
- j = 0x80; //Y地址寄存器
- for(a = 0;a < 32;a++)
- {
- w_code(j);
- j++;
- w_code(0x80);//X地址寄存器
- for(i = 0;i < 16;i ++)
- {
- w_data(logo[x]);
- x++;
- }
- }
- j = 0x80; //Y地址寄存器
- for(a = 0;a < 32;a++)
- {
- w_code(j);
- j++;
- w_code(0x88);//X地址寄存器
- for(i = 0;i < 16;i ++)
- {
- w_data(logo[x]);
- x++;
- }
- }
- }
復(fù)制代碼
0.png (58.44 KB, 下載次數(shù): 179)
下載附件
2016-10-11 11:09 上傳
數(shù)控電源的所有資料下載:
0-30V 4A數(shù)控穩(wěn)壓電源資料.zip
(2.37 MB, 下載次數(shù): 1229)
2016-9-7 22:52 上傳
點擊文件名下載附件
數(shù)控電源 下載積分: 黑幣 -5
|