济南大学泉城学院毕业设计题目信号发生器的设计专业电气工程及其自动化班级电气1001学生贾恩伟学号20103005042指导教师方敏二〇一四年六月四日I摘要本文介绍一种用AT89C51单片机构成的波形发生器,信号发生器采用数字波形合成技术,通过硬件电路和软件程序相结合,可输出自定义的方波、三角波、正弦波、锯齿波等多种波形,波形的周期可用程序改变,并可根据需要选择单极性输出或双极性输出,波形的频率和幅度在一定范围内可任意改变。波形和频率的改变通过软件控制,幅度的改变通过硬件实现。介绍了波形的生成原理、硬件电路和软件部分的设计原理。本系统可以产生各种频率波形。该信号发生器具有体积小、价格低、性能稳定、功能齐全的优点。文章给出了源代码,其性能指标达到了设计要求。关键词:单片机;DAC;信号发生器济南大学泉城学院毕业设计IIABSTRACTThispaperintroducesasignalgeneratorwithMCUAT89C51,whichisusedtogenerateelectro-wave-formssuchassquares、triangles、sinesandteeth-saw.TheperiodsofthesesignalscanbechangedbyprogramsofMCUAT89C51andtheiroutputscanbeselectedtobemonopolarorbipolar.Thispaperprovidestheoriginalcode.Andthetechnicalparameterofthesignalgeneratormeetstherequestofthedesignafterthesimulationtest.ThiscoursedesignbasedonAT89C51single-chipmicrocomputerasthecoredesignofalow-frequencysignalgeneratorfunction.Signalgeneratorwithdigitalwaveformsynthesistechnology,thehardwarecircuitandsoftwareprogramcombined,canoutputsinewave,suchascustomwaveform,squarewave,trianglewaveandotherarbitrarywaveform,frequencyandamplitudeofthewaveforminacertainrangecanbechangedarbitrarily.Waveformandfrequencychangethroughsoftwarecontrol,thechangeoftheamplitudeisrealizedbyhardware.Introducesthewaveformgenerationprinciple,hardwarecircuitandsoftwaredesignprinciple.Thesystemcangeneratevariousfrequencywaveform.Thesignalgeneratorhastheadvantagesofsmallvolume,lowprice,stableperformance,completefunctions.Keywords:MCU;DAC;SignalGenerator济南大学泉城学院毕业设计III目录摘要....................................................................................................................................................IABSTRACT.............................................................................................................................................II1前言...............................................................................................................................................11.1课题的背景、目的及意义.........................................................................................................11.2单片机的历程.............................................................................................................................11.2.1单片机的定义..................................................................................................................11.2.2单片机的发展..................................................................................................................11.2.3单片机的特点及应用......................................................................................................22单片机的选择应用以及框图................................................................................................................32.1单片机的选择.............................................................................................................................32.2总体的设计框图及流程图.........................................................................................................33各模块的具体设计...............................................................................................................................53.1硬件设计....................................................................................................................................53.1.1系统的主控电路..............................................................................................................53.1.2系统D/A转换电路.........................................................................................................73.1.3时钟电路........................................................................................................................103.1.4显示电路........................................................................................................................113.1.5晶振复位电路................................................................................................................113.1.6按键电路........................................................................................................................123.2软件设计..................................................................................................................................133.2.1程序流程图....................................................................................................................133.2.2显示子程序....................................................................................................................153.2.3按键子程序....................................................................................................................163.2.4波形流程图及总程序....................................................................................................18参考文献...........................................................................................................................................23致谢.................................................................................................................................................24结论.........................................................................................................