【正文】
但是我將在以后的工作和學(xué)習(xí)中繼續(xù)努力、不斷完善。另外兩個(gè)開關(guān)可以調(diào)節(jié)頻率,三種波形的頻率可調(diào)范圍不同,分別如下: 正弦波:1—180HZ 方 波:1—— 三角波:1——180HZ根據(jù)示波器的波形頻率的顯示計(jì)算出三種波形的頻率計(jì)算公式如下:正弦波:f=(1000/(9+3*ys))方 波:f=(100000/(3*ys))三角波:f=(1000/(15+3*ys)其中ys為延時(shí)的變量。 delay1(ys)。 delay1(ys)。 } } if(s3==0) { delay(5)。 write_data(0x20)。 write_data(0x20)。 write_data(0x72)。 //寫squrae write_data(0x71)。 //寫sine: write_data(0x69)。 write_f(fre)。 write_data(0x30+ge)。 qian=date/1000。 //寫wave: write_data(0x61)。 wr=0。}void write_data(uchar date) //1602數(shù)據(jù) { lcdrs=1。i0。/*正弦波碼 */void delay(uint z) //延時(shí)子程序 { uchar i,j。sbit s1=P2^0。當(dāng)按開關(guān)7時(shí)輸出波形的頻率增加,按開關(guān)8時(shí)輸出波形的頻率減小。當(dāng)鍵盤上沒有鍵閉合時(shí),所有的行和列線都斷開,行線都呈高電平。此方案輸出的波形不夠穩(wěn)定,抗干擾能力弱,不易調(diào)節(jié)。關(guān)鍵詞:單片機(jī)AT89S5DAC083液晶1602Abstract: this system capitalize on AT89s52,it makes use of central processor to generate three kinds of waves, they are triangle wave, and use D/A conversion module, wave generate module and liquid crystal display of 1602, it can have the 1Hz3KHz profile. In this system it can control wave form choosing, frequency, range,can have the sine wave, the squarewave, the triangular wave. Simultaneously may also take the frequency measurement frequency,and displays them through liquid crystal display of 1602. this design includes three modules. They are D/A conversion module, wave generate module and liquid crystal display of LED module. In this design, the wave generator into wave form module and D/A conversion module are discussed in detail. key word: AT89S52, DAC0832, liquid crystal 1602.通過芯片IC145152,壓控振蕩器搭接的鎖相環(huán)電路輸出穩(wěn)定性極好的正弦波,再利用過零比較器轉(zhuǎn)換成方波,積分電路轉(zhuǎn)換成三角波。 單片機(jī)的選擇論證 方案一:AT89S52單片機(jī)是一種高性能8位單片微型計(jì)算機(jī)。但其價(jià)格較貴 鍵盤方案論證通過軟件控制液晶屏可以顯示波形的種類以及波形的頻率。sbit lcdrs=P3^2。uchar s1num,a,ys,j。j)。 lcde=1。 lcde=0。 write_(0x01)。 //寫