【正文】
XXXXX學(xué)院 本科畢業(yè)設(shè)計(論文) 題 目 基于單片機的波形 發(fā)生器的設(shè)計 學(xué)生姓名 XXXXX 專業(yè)班級 電子科學(xué)與技術(shù) 1 班 學(xué) 號 XXXXX 院 (系) 電氣工程學(xué)院 指導(dǎo)教師 (職稱 ) XX(教授) XX(碩研(講師)) 完成時間 2022 年 5 月 15 日 基于單片機的 波形發(fā)生器 的設(shè)計 I 摘 要 本文介紹了一種基于單片機的波形發(fā)生器的設(shè)計,整個系統(tǒng)通過單片機STC89C52 控制 DAC0832 實現(xiàn)將 8 位數(shù)字量轉(zhuǎn)化成正弦波、方波、三角波、鋸齒波和脈沖波五種波形的模擬量 的 輸出 。 該波形發(fā)生器主要由兩部分組成:系統(tǒng)硬件設(shè)計和系統(tǒng)軟件設(shè)計, 在系統(tǒng) 硬件設(shè)計中,以 STC89C52 單片機為核心,通過 I/O 接口設(shè)計,擴展了 D/A 轉(zhuǎn)換模塊、波形選擇按鍵、并行輸入串行輸出模塊 74LS165 和 LCD1602 頻率 、 幅度顯示模塊。 并且 采用單片機仿真軟件,設(shè)計并制作波形發(fā)生器的印制電路板( PCB) 。 系統(tǒng)軟件設(shè)計是在 WAVE6000 的集成開發(fā)環(huán)境下采用匯編語言完成 的 , 包括主程序、四 種波形產(chǎn)生子程序、按鍵功能子程序和顯示子程序等模塊。 本系統(tǒng)可以實現(xiàn) 波形 頻率 、 幅度實時可調(diào),功能靈活,系統(tǒng)的開發(fā)成本在百元內(nèi),具有測量精度高,誤差小、功耗低,數(shù)據(jù)傳輸速度較快,可靠性高等特點,有一定的開發(fā)價值。 實驗表明,設(shè)計系統(tǒng)的測試結(jié)果與實際波形的頻率和幅度一致。 關(guān)鍵詞 波形發(fā)生 器 /STC89C52/LCD1602/DAC0832 基于單片機的 波形發(fā)生器 的設(shè)計 II THE DESIGN OF WAVEFORM GENERATOR BASED ON SINGLECHIP MICROCONTROLLER ABSTRACT This article describes the the design of the waveform generator based on singlechip, the entire system through the microcontroller STC89C52 controls the DAC0832 that can finish convertting eight digital into the five waveform analog output of sine wave, square wave, triangle wave, saw tooth wave and pulse wave. The waveform generator consists of two parts: system hardware design and system software design, in the system hardware design, the microcontroller STC89C52 is the core of the design, through I/O interface design to extend the DA converter module, waveform selector buttons, 74LS165 module the parallel input string line output and the LCD1602 module of frequency, magnitude of the display. And through the SCM simulation software to design and produce of the printed circuit board (PCB) of the waveform generator. System software design is done with assembly language in the integrated development environment WAVE6000, including the main Program, four waveform generator subroutine, key functions and display subroutines modules. This system can realize that frequency and amplitude of waveform is realtimeadjustable and flexible. The system development costs is in the hundred with a high accuracy, the error is small, low power consumption, faster data transfer speeds, high reliability, there is a certain development value. The tested frequency and amplitude of the system is consistent with the actual waveform. KEY WORDS waveform generator, stc89C52, lcd1602, dac0832 基于單片機的 波形發(fā)生器 的設(shè)計 目 錄 摘 要 ……………………………………………………………………………… ………… I ABSTRACT………………………………………………………………………… ……… II 1 緒 論 ………………………………………… ……… … ………………………………… 1 選題背景及意義 .................................................................................................... 1 本課題的研究現(xiàn)狀 ........................................................................................... 1 選題目的及意義 ............................................................................................... 2 設(shè)計的基本要求 ............................................................................................... 3 2 波形發(fā)生器系統(tǒng)方案設(shè)計與論證 ................................................................. 4 總體設(shè)計方案的比較 ........................................................................................... 4 子系統(tǒng)模塊方案設(shè)計 ........................................................................................... 4 控制模塊方案設(shè)計 ............................................................................................ 5 頻率調(diào)整模塊方案設(shè)計 ................................................................................... 5 幅度調(diào)整模塊方案設(shè)計 ................................................................................... 6 鍵盤模塊方案設(shè)計 ............................................................................................ 6 顯示模塊方案設(shè)計 ............................................................................................ 6 D/A 轉(zhuǎn)換模塊方案設(shè)計 ................................................................................... 7 放大模塊 .............................................................................................................. 8 系統(tǒng)總體框圖 ........................................................................................................... 9 波形產(chǎn)生相關(guān)理論 ............................................................................................. 11 單片機軟件開發(fā)系統(tǒng) ........................................................................................ 11 3 硬件實現(xiàn)及模塊電路設(shè)計 ............................................................................. 12 單片機最小系統(tǒng)的設(shè)計 .................................................................................... 12 波形產(chǎn)生及濾波放大模塊設(shè)計 .................................................................. 13 頻率調(diào)整模塊 ........................................................................................................ 13 基于單片機的 波形發(fā)生器 的設(shè)計 幅度調(diào)整模塊 ........................................................................................................ 14 LCD1602 顯示模塊 ............................................................................................. 15 RS232 串行通信電路及電源供電電路 .................................................... 15 RS232 串行通信電路 .................................................................................... 20 電源供電電路 .................................................................................................. 16 4 系統(tǒng)軟件設(shè)計 ..................................................................................................... 17 系統(tǒng)軟件編程語言方案設(shè)計 ......................................................................... 17 系統(tǒng)整體軟件設(shè)計思想 .................................................................................... 18 各個子程序模塊流程圖 .................