DAC0832在Proteus中軟件仿真生成波形(矩形,三角,鋸齒,正弦)_第1頁(yè)
DAC0832在Proteus中軟件仿真生成波形(矩形,三角,鋸齒,正弦)_第2頁(yè)
DAC0832在Proteus中軟件仿真生成波形(矩形,三角,鋸齒,正弦)_第3頁(yè)
DAC0832在Proteus中軟件仿真生成波形(矩形,三角,鋸齒,正弦)_第4頁(yè)
DAC0832在Proteus中軟件仿真生成波形(矩形,三角,鋸齒,正弦)_第5頁(yè)
免費(fèi)預(yù)覽已結(jié)束,剩余1頁(yè)可下載查看

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、真誠(chéng)為您提供優(yōu)質(zhì)參考資料,若有不當(dāng)之處,請(qǐng)指正。1.電路圖2.鋸齒波3.三角波4矩形波5.正弦波6.C代碼#include #include #define DAC0832 XBYTE0x7fff#define uchar unsigned char#define uint unsigned int/生成波形期間對(duì)應(yīng)的按鍵要一直按下sbit key1=P10;sbit key2=P11;sbit key3=P12;sbit key4=P13;/下面的編碼定義是由正弦波數(shù)據(jù)生成器所生成,可以百度下載uchar code sin_tab=0x7F,0x82,0x85,0x88,0x8B,0x8F,

2、0x92,0x95,0x98,0x9B,0x9E,0xA1,0xA4,0xA7,0xAA,0xAD,0xB0,0xB3,0xB6,0xB8,0xBB,0xBE,0xC1,0xC3,0xC6,0xC8,0xCB,0xCD,0xD0,0xD2,0xD5,0xD7,0xD9,0xDB,0xDD,0xE0,0xE2,0xE4,0xE5,0xE7,0xE9,0xEB,0xEC,0xEE,0xEF,0xF1,0xF2,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFB,0xFC,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,

3、0xFE,0xFE,0xFE,0xFE,0xFD,0xFD,0xFC,0xFB,0xFB,0xFA,0xF9,0xF8,0xF7,0xF6,0xF5,0xF4,0xF2,0xF1,0xEF,0xEE,0xEC,0xEB,0xE9,0xE7,0xE5,0xE4,0xE2,0xE0,0xDD,0xDB,0xD9,0xD7,0xD5,0xD2,0xD0,0xCD,0xCB,0xC8,0xC6,0xC3,0xC1,0xBE,0xBB,0xB8,0xB6,0xB3,0xB0,0xAD,0xAA,0xA7,0xA4,0xA1,0x9E,0x9B,0x98,0x95,0x92,0x8F,0x8B,0x88,

4、0x85,0x82,0x7F,0x7C,0x79,0x76,0x73,0x6F,0x6C,0x69,0x66,0x63,0x60,0x5D,0x5A,0x57,0x54,0x51,0x4E,0x4B,0x48,0x46,0x43,0x40,0x3D,0x3B,0x38,0x36,0x33,0x31,0x2E,0x2C,0x29,0x27,0x25,0x23,0x21,0x1E,0x1C,0x1A,0x19,0x17,0x15,0x13,0x12,0x10,0x0F,0x0D,0x0C,0x0A,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x03,0x02,0x01,

5、0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x03,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0C,0x0D,0x0F,0x10,0x12,0x13,0x15,0x17,0x19,0x1A,0x1C,0x1E,0x21,0x23,0x25,0x27,0x29,0x2C,0x2E,0x31,0x33,0x36,0x38,0x3B,0x3D,0x40,0x43,0x46,0x48,0x4B,0x4E,0x51,0x54,0x57,0x5A,0x5D,

6、0x60,0x63,0x66,0x69,0x6C,0x6F,0x73,0x76,0x79,0x7C;/void delayms(uint xms)uint i,j;for (i=xms;i0;i-)for (j=110;j0;j-);/void juxing()uchar i;for (i=0;i0xff;i+)DAC0832=0;for (i=0;i0xff;i+)DAC0832=0xff;/void sanjiao()uchar i;for (i=0;i0;i-)DAC0832=i;/void juchi()uchar i;for (i=0;i0xff;i+)DAC0832=i;/void sin_func()uchar i;for (i=0;i0xff;i+)DAC0832=sin_tabi;if(i=0xff)i=0;/void main ()while (1)if(key1=0)delayms(10);/延時(shí)去抖動(dòng)if(key1=0)while (!key1)juxing();/if(key2=0)delayms(10);if(key2=0)while (!key2)sanjiao();/if(key3=0

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論