|
沒(méi)事看網(wǎng)上有氬弧焊機(jī)脈沖控制器自己做了一個(gè),用單面PCB加跳線,感光法做的PCB板,雙面板業(yè)余條件過(guò)孔太難搞了,用了2個(gè)4位共陽(yáng)極數(shù)碼管,一個(gè)顯示高電平時(shí)間ms,一個(gè)顯示低電平時(shí)間ms,沒(méi)有搞儲(chǔ)存幾組數(shù)據(jù),為了操作簡(jiǎn)單只儲(chǔ)存上一次的設(shè)置,5個(gè)按鍵,一個(gè)儲(chǔ)存鍵,另外4個(gè)調(diào)整脈沖高電平時(shí)間,與低電平時(shí)間,STC89C51控制
制作出來(lái)的實(shí)物圖如下:
描述
描述
測(cè)波形
測(cè)波形
試焊
試焊
Altium Designer畫(huà)的PCB圖在最后:(51hei附件中可下載工程文件)
單片機(jī)源程序如下:- /*********************************************************************************
- * 【編寫(xiě)時(shí)間】: 2021年3月12日
- * 【作 者】: 程云海
- * 【版 本】: 1.0
- * 【外部晶振】: 12mhz
- * 【主控芯片】: STC89C52RC
- * 【編譯環(huán)境】: Keil μVisio4
- * 【程序功能】: 脈沖輸出控制
- * 【使用說(shuō)明】: 1.使用數(shù)碼管顯示控制氬弧焊機(jī)脈沖輸出
- /*------------------------------------------------
- 主函數(shù)
- ------------------------------------------------*/
- void main (void)
- { a=byte_read(0x2000)*100+byte_read(0x2001);//程序開(kāi)始時(shí)讀取EEPROM中數(shù)據(jù)
- b=byte_read(0x2002)*100+byte_read(0x2003);//程序開(kāi)始時(shí)讀取EEPROM中數(shù)據(jù)
- //SectorErase(0x2000);//擦除扇區(qū)
- //byte_write(0x2000,a);//重新寫(xiě)入數(shù)據(jù)
- t0_init(); //定時(shí)1ms一個(gè)中斷
-
- while (1) //主循環(huán)
- { smgxshi( a, b); //數(shù)碼管顯示函數(shù)
- anjian(); //按鍵調(diào)整函數(shù)
- chucun(); //儲(chǔ)存函數(shù)
- shuchmch(); //輸出脈沖函數(shù)
-
- }
- }
- void smgxshi(uint a,uint b)//數(shù)碼管顯示函數(shù)
- { uint c1; uchar c2;
- a1=a/1000;
- c1=a%1000;
- a2=c1/100;
- c2=c1%100;
- a3=c2/10;
- a4=c2%10;
- b1=b/1000;
- c1=b%1000;
- b2=c1/100;
- c2=c1%100;
- b3=c2/10;
- b4=c2%10;
-
-
- D=d[a1];
- W=0x7f;
- DelayMs(1);
- D=0xff;
- DelayMs(1);
- D=d[a2];
- W=0xbf;
- DelayMs(1);
- D=0xff;
- DelayMs(1);
- D=d[a3];
- W=0xdf;
- DelayMs(1);
- D=0xff;
- DelayMs(1);
- D=d[a4];
- W=0xef;
- DelayMs(1);
- D=0xff;
- DelayMs(1);
- D=d[b1];
- W=0xf7;
- DelayMs(1);
- D=0xff;
- DelayMs(1);
- D=d[b2];
- W=0xfb;
- DelayMs(1);
- D=0xff;
- DelayMs(1);
- D=d[b3];
- W=0xfd;
- DelayMs(1);
- D=0xff;
- DelayMs(1);
- D=d[b4];
- W=0xfe;
- DelayMs(1);
- D=0xff;
- DelayMs(1); }
-
- void anjian(void) //按鍵調(diào)整函數(shù)
- { if(an1==0) // 按鍵1是否按下
- {smgxshi(a,b); //數(shù)碼管顯示函數(shù)延時(shí)
- if(an1==0) // 按鍵1是否按下
- smgxshi(a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- while(!an1) //按鍵有沒(méi)有松開(kāi)
- {smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- a++;
- if(a==1001)
- a=0;
- smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- } }
-
- if(an2==0) // 按鍵1是否按下
- {smgxshi(a,b); //數(shù)碼管顯示函數(shù)延時(shí)
- if(an2==0) // 按鍵1是否按下
- smgxshi(a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- while(!an2) //按鍵有沒(méi)有松開(kāi)
- {smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- a--;
- if(a==-1)
- a=1000;
- smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- } }
-
- if(an3==0) // 按鍵1是否按下
- {smgxshi(a,b); //數(shù)碼管顯示函數(shù)延時(shí)
- if(an3==0) // 按鍵1是否按下
- smgxshi(a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- while(!an3) //按鍵有沒(méi)有松開(kāi)
- {smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- b++;
- if(b==5001)
- b=0;
- smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- } }
-
- if(an4==0) // 按鍵1是否按下
- {smgxshi(a,b); //數(shù)碼管顯示函數(shù)延時(shí)
- if(an4==0) // 按鍵1是否按下
- smgxshi(a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- while(!an4) //按鍵有沒(méi)有松開(kāi)
- {smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- b--;
- if(b==-1)
- b=5000;
- smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- } }
- }
- void shuchmch(void) //輸出脈沖函數(shù)
- { if(ru==0) // 按鍵1是否按下
- {smgxshi(a,b); //數(shù)碼管顯示函數(shù)延時(shí)
- if(ru==0) // 按鍵1是否按下
- smgxshi(a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- TR0=1; //啟動(dòng)定時(shí)器0
- while(!ru) //按鍵有沒(méi)有松開(kāi)
- smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- chu=1;
- aa=0;
- TR0=0; //關(guān)閉定時(shí)器0
- smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- }
- }
-
- void chucun(void) //儲(chǔ)存函數(shù)
- { if(an5==0) // 按鍵1是否按下
- {smgxshi( a, b); //數(shù)碼管顯示函數(shù)延時(shí)
- if(an5==0) // 按鍵1是否按下
- ……………………
- …………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼
|
-
PCB圖
-
打印的菲林
-
PCB
-
-
-
氬弧焊機(jī)控制板.rar
2021-3-23 09:14 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
13.91 KB, 下載次數(shù): 104, 下載積分: 黑幣 -5
PCB與程序
評(píng)分
-
查看全部評(píng)分
|