本科毕业设计(论文)题目基于单片机的低频信号发生器的设计学生姓名夏小林学号0817040125教学院系理学院专业年级电子信息科学与技术2008指导教师周云旭职称实验师单位西南石油大学理学院辅导教师职称单位完成日期2012年6月4日SouthwestPetroleumUniversityGraduationThesisAlowfrequencysignalgeneratorbasedonmicrocontrollerdesignGrade:2008Name:XiaolinXiaSpeciality:ElectronicandInformationScienceandTechnologyInstructor:YunxuZhouSchoolofScience2012-6I摘要低频信号发生器是一种广泛应用于电工学教学、实验物理学,电子线路和微机原理、接口技术实验,自动化测控系统等领域的常用信号源。随着现代测量技术和现代通信技术的发展,信号源通常都要求要有具备高稳定度和高精度。直接数字频率合成技术的出现为新一代函数信号发生器的设计与实现提供了理论依据和技术支持。本文主要介绍一种通过直接数字频率合成的方法,采用AVRMega16单片机作为控制核心的低频信号发生器。信号源能产生频率从1—1KHZ的正弦波、锯齿波、方波、三角波信号。最后信号通过DAC0832芯片进行数模转换,输出的函数信号通过一个低通滤波器,最后波形通过示波器显示。本方法设计的函数发生器频率稳定,性价比高。本文首先介绍了数字频率合成技术的发展和当前发展趋势,并且将直接数字频率合成技术与传统的频率合成技术进行了比较,紧接着详细介绍了直接数字频率合成的基本结构和工作原理,然后介绍了信号产生的基本原理和D/A数据转换芯片DAC0832的相关资料和工作模式,低通滤波器的原理及实现,LCD1602显示器等。最后对提出的设计方案进行了原理性的论证说明,对直接数字频率合成方法的部分误差进行了系统的分析,并对按键功能模块进行了介绍,文章最后总结了本次DDS的特性。关键词:信号发生器;AVR;FCW;直接数字频率合成;DAC0832IIAbstractThelowfrequencysignalgeneratorisacommonsource.Itiswidelyusedinthefieldofphysics,electricalengineeringteachingexperiments,electroniccircuitsandMicrocomputerPrincipleandInterfaceTechnology,automationandcontrolsystem.Withthedevelopmentofmodernmeasurementtechniquesandmoderncommunicationtechnology,thesignalsourceisusuallyrequiredtohavehighstabilityandprecision.Directdigitalfrequencysynthesizertechnologyforthedesignandimplementationofanewgenerationoffunctionsignalgeneratorprovidesatheoreticalbasisandtechnicalsupport.Thispaperintroducesalow-frequencysignalgeneratorthatusesthedirectdigitalfrequencysynthesismethodandtheAVRMega16microcontrollerasthecore.Itcangeneratefrequenciesfrom1-1KHZofwave,squarewaveandtriangularwavesignal.Intheend,thesignalthroughthechipDAC0832todigitaltoanalogconversionthefunctionoftheoutputsignalthroughalowpassfilter,andfinallythewaveformbytheoscilloscopetodisplay.Thefunctiongeneratorwiththisdesignmethodhasfrequencystability,cost-effectivefeatures.Thispaperfirstintroducesthedevelopmentofthedigitalfrequencysynthesisandcomparesitwiththetraditionalfrequencysynthesizertechnology,following,Idetailtotellthebasicstructureandworkingprincipleofdirectdigitalfrequencysynthesizer,andthenintroducethesignalgeneratedbythebasicprinciplesandD/AdataconversionchipDAC0832dataandoperatingmode,theprincipleandrealizationoflow-passfilter,LCDdisplayof1602andsoon,FinallyIputforwarddesignprincipleofargumentation,andthedirectdigitalfrequencysynthesiserroranalyzesystem,andthekeyfunctionmodulesareintroduced,finallythearticlesummarizesthecharacteristicsofDDS.Keywords:signalgenerator;AVR;FCW;directdigitalfrequencysynthesizer;DAC0832-1-目录1绪论...........................................................................................................................-1-1.1引言.................................................................................................................-1-1.2频率合成技术的发展[1].................................................................................-1-2直接数字频率合成的基本原理...............................................................................-4-2.1频率合成技术的理论基础.............................................................................-4-2.2DDS的误差分析............................................................................................-6-2.3相位累加器.....................................................................................................-7-2.4正弦查询表ROM.........................................................................................-8-3低频信号发生器的设计方案研究...........................................................................-8-3.1设计方案的采用............................................................................................-8-3.2方案原理分析论证.........................................................................................-9-3.3主控芯片的方案论证和选择.......................................................................-10-3.4D/A转换电路的设计...................................................................................-12-3.5阻容滤波电路...............................................................................................-16-3.6LCD1602液晶显示器..................................................................................-17-3.7按键控制模块..............................................................................................-20-4正弦波波形ROM表的设计.................................................................................-21-5硬件设计.................................................................................................................-22-5.1模块设计.......................................................................................................-22-5.2硬件设计电路原理图...................................................................................-24-6软件设计................................................................................................................-26-6.1ICCAVR简介...............................................................................................-26-6.2程序设计......................................................................................................-28-7