摘 要
本設(shè)計是波形發(fā)生器的設(shè)計,以 51單片機(jī)為核心,通過按鍵輸入控制輸出信號的類型、頻率,采用 D/A轉(zhuǎn)換芯片DAC0832輸出相應(yīng)的波形,同時以LED 顯示器進(jìn)行實時顯示信號相關(guān)信息。我們采用 C 語言進(jìn)行編程,可實現(xiàn)方波,鋸齒波,三角波,三種波形的產(chǎn)生,且波形的類型、頻率可通過按鍵調(diào)節(jié),并頻率顯示在數(shù)碼管上。
關(guān)鍵字:單片機(jī)、D/A轉(zhuǎn)換芯片DAC0832
Abstract
This design is the design of waveform generator, using 51 single chip microcomputer as the core, through the key input type, frequency control output signal, using D/A conversion chip DAC0832 the corresponding output waveform, simultaneously by LED display to display information related to real time signal. We use C language to program, can achieve a square wave, sawtooth wave, triangle wave, three kinds of waveform generation, type, frequency and waveform can be adjusted via buttons, and frequency in the digital tube display.
Key word: Microcontroller, D/A conversion chip DAC0832
keyport=ZLG7290_GetKey();
switch(keyport)
{
case 1:num=1;break;
case 2:num=2;break;
case 3:num=3;break;
case 4:zk=1;break;
case 5:zk=2;break;
case 6:zk=3;break;
}