毕业设计(论文)-多功能信号发生器的设计与实现_第1页
毕业设计(论文)-多功能信号发生器的设计与实现_第2页
毕业设计(论文)-多功能信号发生器的设计与实现_第3页
毕业设计(论文)-多功能信号发生器的设计与实现_第4页
毕业设计(论文)-多功能信号发生器的设计与实现_第5页
已阅读5页,还剩48页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

陕西理工学院毕业设计第第页 if(FreqNum[3]==-1) FreqNum[3]=9; LCDDispNum(6,2,FreqNum[3]);LCDDispNum(5,2,FreqNum[2]); } elseif(gFunctionCount==2&&gTimeCount==2) { FreqNum[2]--; if(FreqNum[2]==-1) FreqNum[2]=9; LCDDispNum(5,2,FreqNum[2]);LCDDispNum(4,2,FreqNum[1]); } elseif(gFunctionCount==2&&gTimeCount==3) { FreqNum[1]--; if(FreqNum[1]==-1) FreqNum[1]=9; LCDDispNum(4,2,FreqNum[1]);LCDDispNum(3,2,FreqNum[0]); } elseif(gFunctionCount==2&&gTimeCount==4) { FreqNum[0]--; if(FreqNum[0]==-1) FreqNum[0]=9; LCDDispNum(3,2,FreqNum[0]);LCDDispChar(2,2,''); } elseif(gFunctionCount==2&&gTimeCount==0) { FreqNum[4]--; if(FreqNum[4]==-1) FreqNum[4]=9; LCDDispNum(7,2,FreqNum[4]); LCDDispNum(6,2,FreqNum[3]); } elseif(gFunctionCount==3&&gTimeCount==0) { AmpNum[1]--; if(AmpNum[1]==-1) AmpNum[1]=9; LCDDispNum(14,1,AmpNum[1]); LCDDispChar(13,1,'.'); } elseif(gFunctionCount==3&&gTimeCount==1) { AmpNum[0]--; if(AmpNum[0]==-1) AmpNum[0]=5; LCDDispNum(12,1,AmpNum[0]); LCDDispChar(11,1,':'); } elseif(gFunctionCount==4&&gTimeCount==0) { DutyNum[1]--; if(DutyNum[1]==-1) DutyNum[1]=9; LCDDispNum(14,2,DutyNum[1]); LCDDispNum(13,2,DutyNum[0]); } elseif(gFunctionCount==4&&gTimeCount==1) { DutyNum[0]--; if(DutyNum[0]==-1) DutyNum[0]=9; LCDDispNum(13,2,DutyNum[0]); LCDDispChar(12,2,':'); } }while(!KEY4);//循环到松手 }}附录D英文原文1Introduction

SCMisanintegratedcircuitchip,VLSItechnologywithdataprocessingcapabilityofthecentralprocessingunitCPUrandomaccessmemoryRAM,readonlymemoryROM,andavarietyofI/Oportandinterruptsystem,timers/timerotherfunctions(whichmayalsoincludeadisplaydrivercircuit,pulsewidthmodulationcircuit,analogmulti-channelconverter,A/Dconverterandothercircuit)integratedintoasiliconconstituteasmallcomputersystem.

Thewaveformgeneratorisadatasignalgenerator,inthedebuggingofhardware,weoftenneedtoaddsomesignal,whetheritisnormaltoobservecircuitoperation.Generalsignalgenerator,notonlycumbersome,butonlymadeafewsimplewaveform,cannotmeettheneed.Example,whenuserswanttodebugserialcommunicationprogram,itisnecessaryonthecomputertowriteaprogram,andthenwiretoconnectthecomputerandtheusertargetboard,ifnotnormal,donotknowthatthecommunicationlineshaveaproblemoraproblemwiththeprogram.E2000/Lwaveformgeneratorcapability,youcandefinetheserialdata.Outputlogicprobehook,quickandeasytodebug.

Basedonasimplewaveformgeneratorofthemicrocontrollerisacommonsource,iswidelyusedintheexperimentofelectronictechnology,automaticcontrolsystemandotherscientificfields[9].

Atpresent,thecompositionofsimplewaveformgeneratorTherearemanyways,suchastypeofDDS(Direct2DigitalSynthesis)arbitrarywaveformgenerator,usingadedicatedsignalchipMAX038AWG.Thedesignstemsfromthe2007NationalUndergraduateElectronicsystemtocontest,throughanalysisandcomparisonwithtraditionalmethodstoachievethemulti-functionwaveformgenerator[10].Withhigh-performancesingle-chiphighspeedofoperation,systemintegration,strongadvantages,thedesignofthissignalgenerator,digitalsignalgeneratorthantheprevioushardwareissimpletounderstandandimplementeasier,clearerdesignideasfortheprogram,andeasytocontrolandtheadvantagesofthefrequencyandamplitude[11].

Thelow-frequencysignalgeneratorwiththesynthesisofsingle-chipwaveformgeneratortoproducehigh-precision,lowdistortionsinewavevoltagecanbeusedforthecalibrationfrequencyrelays,synchronizationrelays,etc.canalsobeusedasalow-frequencyinverterpowersupply.

Microcontrollerasthecoredesignofalowfrequencyfunctionsignalgenerator.Signalgeneratorwithdigitalwaveformsynthesistechniques,throughacombinationofhardwarecircuitryandsoftwareprogramscanoutputcustomwaveformssuchassine,square,trianglespreadtootherarbitrarywaveform.Waveformfrequencyandamplitudecanbearbitrarilychangedwithinacertainrange.Waveformgenerationprinciple,hardwareandsoftwarepartofthedesignprinciples.MCUcontroltheD/Aconvertertoproducesignalsabovehardwareandsoftwareprogramming,ofDAC0832D,/Aconverterprincipleanduse,AT89C52andrelatedtothedesignofthecircuitchip,ondifferentlow-frequencysignalsourcedesign.Thesignalgeneratorhastheadvantagesofsmallsize,lowprice,stableperformance,fullyfunctional.2SystemDesign

2.1program:

AT89C52microcontrollerprogrammingmethodtoproducesawtooth,sinewave,squarewavethreewaveforms,andthenthroughtheD/AconverterDAC0832digitalsignalconvertedtoanalogsignals,filteredandamplified,andultimatelybytheoscilloscopedisplay,andkeyboardtocontrolthreetypesofwaveformsofthefrequencychanges,thefinaloutputshowsthetypeandvalue.

Designrequirements

1),theuseofsingle-chipsoftwaredesignproducesthreewaveforms

2),threewaveformscanbeselectedviathekeyboard

3)Thewaveformfrequencyisadjustable

4),needtodisplaythewaveformtypesandfrequency

2.2deviceselection

1bytheMCUtocontroltheD/Aoutputthreekindsofwaveforms.

AT89C52microcontrollerisahigh-performance8-bitsinglechipmicrocomputer.Whichconstitutethecomputer'scentralprocessingunitCPU,memory,registers,theI/Ointerfacetoproductioninanintegratedcircuitchip,whichconstitutearelativelycompletecomputer,anditscheap.

3,theLCDmonitor1602.Itspowerissmall,theeffectisobvious,anddisplaytheprogrammingiseasytocontrol,youcandisplaytheletters.2.3Theoverallsystemdesign

ThesystemusesamicrocontrollerasthedataprocessingandcontrolofthecorebytheMCUtocompletetheman-machineinterface,systemcontrol,signalacquisitionandsignalprocessingandtransformation,usingkeystrokes,usetheLCDdisplayofthecircuitoutputdigitalprogram.Thedesigntaskisbrokendownintokeycircuits,liquidcrystaldisplaycircuitmodules.Figure2-1showstheoverallblockdiagramofthesystem2.4HardwareImplementationandunitcircuitdesign

2.4.1ofthesmallestsingle-chipsystemdesign

The89C52chip,ROM/EPROMMCU,thischipconstitutetheminimumsystemsimple,andreliable.Constitutetheminimumapplicationsystemusingthe89C52microcontrollerconnectedtotheclockcircuitandresetcircuitcanbeshownintheFigure89C51microcontrollerminimumsystem.Duetothelimitofintegration,theminimumapplicationcanonlybeusedasasmallcontrolunit.Itsapplicationfeatures:

(1)availabletousersofalargenumberofI/Oportlines.

(2)Internalmemorycapacityislimited.

(3)applicationdevelopmentisunique.

Thestandard52forthe8Kprogramspace,128bytesofRAM,32ports,fiveinterrupts,twotimer/counter,12clockcyclestoexecuteabasicinstruction,thedivisionofthelongestfor48cycles.52forthe8Kprogramspace,and256bytesofRAM,32ports,sixinterrupt,threetimer/counters.2.4.2D/Aconverter

TheDAC0832isadualin-line8-bitD/Aconverter.Abletocompletethedigitalinputtoanalogoutput(current)conversion.Figure3.5showsthepindiagramoftheDAC0832.Itsmainparametersareasfollows:resolutionof8,theconversiontimeof1μs,fullscaleerrorof±1LSB,thereferencevoltage(+10/span>-10)V,powersupply(+5to+15)VlogiclevelinputscompatiblewithTTL.BeseenfromFigure3-1,theDAC0832intwolatchesthefirstlatchiscalledtheinputregister,itallowsthelatchedsignalasILE,thesecondlatchcalledtheDACregister,itthelatchsignalisalsoreferredtoasachannelcontrolsignal/XFER.Figure2-3,whentheILEishigh,thechipselectsignal/CSandthewritesignal/WR1islow,theinputregistercontrolsignal,inwhichcase,theoutputoftheinputregisterwiththeinputchanges.Thereafter,whenthehigh/WR1low,thecontrolsignalsbecomelowatthistime,thedataislatchedintotheinputregister,inputregisteroutputisnolongerwiththechangeoftheexternaldataDB.Thesecondstagelatchtransfercontrolsignal/XFERandwritesignal/WR2atthesametimeislow,thetwolatchcontrolsignalishigh,theoutputofthe8-bitDACregisterwiththeinput,thenwhen/WR2fromlow,thecontrolsignalgoeslow,sotheinputregisterislatchedintotheDACregister.

Figure2-3therestofthepinfunctiondefinedasfollows:

(DI7~DI0in:1)8-bitdatainput,DI7highest.

(2)IOUT1:analogcurrentoutputterminal1,whenthedataintheDACregisterareall1,themaximumoutputcurrent,theDACregisterdataareall0,theoutputcurrentis0.

(3)IOUT2​​:analogcurrentoutput,IOUT2​​andIOUT1andisaconstant,thatisIOUT1the+IOUT2​​=constant.

(4)theRFB:feedbackresistorterminalofDAC0832internalfeedbackresistor,RFB-sidecanbedirectlyconnectedtoanexternalopamp'soutput,thisisequivalenttoafeedbackresistorconnectedtotheopampoutputandinput.

(5)VREF:Referencevoltageinput,thisendcanbeconnectedtoapositivevoltagecanbeaccessedbyanegativevoltage,whichdeterminesthe0-255digitaltransformingtheamplitudeoftheanalogvoltagevalues​​,VREFrange(+10-10)V.ResistornetworkconnectedtothetheVREFsideandD/AinternalT-shaped.

(6)Vcc:chipsupplyvoltagerangeof(+5-15)V.2.4.3opampcircuitFigure2-4,R1iscoupledtoresistors,R2,R3,resistorvoltagedividerfeedback.R2andR1,thevoltageratioof1:2,forOUT2voltageof-5v~0vinthesecondopampinthemake-5v~0vbetweenthevoltagechange-5vto5v,thefirstopampconverttheamountofvoltagevaluesdidnotincreaseordecreasethe1v,thesecondstageopampvoltagedecreaseorincreaseof2v.2.4.4LEDdisplayinterfacecircuit

CommonlyusedinLEDdisplayLEDstatusdisplay(commonlyknownaslight-emittingdiode)LEDseven-segmentdisplay(commonlyknownasthedigitalcontrolandLED16segmentdisplay,LEDdisplaytwostates,forthesystem;digitaltubefordigitaldisplay;LED16segmentdisplay,forthecharacterdisplay)

A.Digitalcontrolstructure

Digitaltubeconsistsofeightlight-emittingdiode(hereinafterreferredtoasfields),differentcombinationscanbeusedtodisplaythenumbers0-9.CharactersAFandthedecimalpoint"."Digitaltubeisdividedintotwocommoncathodeandcommonanodestructure.

Digitalpipeworks

Totalanode8digitaltubelightemittingdiodeanode(diodepositiveterminal)connectedtogether.Usuallycommonanodeconnectedhighageneralpowersupplywhenacathodeconnectedtolow,thedigitaltubeconductionandlight.Atotalofeightlight-emittingdiodedigitalcathodetubecathode(diodenegativeterminal)connectedtogether.Publiccathodeconnectedtolow(ground)whenananodeconnectedtohigh,thedigitaltubelight.2.4.5WaveformGenerationPrincipleandmoduledesign

1First,thedigitalvalueofthestoredwaveformmemoryarraytosin;52microcontrollertoreadthevalueinthearrayintotheD/Aconverter;

3,D/Aconverterinputdigitalvalueisconvertedtoanalogoutput;

4,theD/Aanalogoutputelectriccurrentthroughtheopamptoconvertthevoltageoutput.ThreewaveformsgeneratedbythemicrocontrollerprogrammingmethodthroughtheDAconvertermoduleDAC0832outputintothefilterwaveamplification.Schematic2-6asfollows:2.4.6thedesignofthedisplaymodule

LCD1602displaytheoutputwaveform,frequency,thecircuitdiagram.AsshowninFigure2-7,the1602dataoftheeightterminationmicrocontrollerP1port,itsthreeP3.2-P3.4canendRS,RW,,E,respectively,thenthemicrocontroller.ThroughsoftwarecontroloftheLCDscreencandisplaythewaveformtypesandfrequencyofthewaveform.附录E中文原文波形发生器即简易函数信号发生器,是一个能够产生多种波形,如三角波、锯齿波、方波、正弦波等波形电路。函数信号发生器在电路实验和设备仪器中具有十分广泛的用途。通过对函数发生器的原理以及构成分析,可设计一个能变换出三角波、锯齿波、方波、正弦波的函数波形发生器。在工业生产和科研中利用函数信号发生器发出的信号,可以对元器件的性能及参数进行测量,还可以对电工和电子产品进行指数验证、参数调整及性能鉴定。常用的信号发生器绝大部分是由模拟电路构成的,当这种模拟信号发生器用于低频信号输出往往需要的RC值很大,这样不仅参数准确度难以保证,而且体积和功耗都很大,而由数字电路构成的低频信号发生器,虽然其性能好但体积较大,价格较贵,因此,高精度,宽调幅将成为数字量信号发生器的趋势。本文介绍的是利用89C52单片机和数模转换器件DAC0832产生所需不同信号的低频信号源,其信号幅度和频率都是可以按要求控制的。文中简要介绍了DAC0832数模转换器的结构原理和使用方法,89C52的基础理论,以及与设计电路有关的各种芯片。文中着重介绍了如何利用单片机控制D/A转换器产生上述信号的硬件电路和软件编程。信号频率幅度也按要求可调。1引言单片机是一种集成在电路芯片,是采用超大规模集成电路技术把具有数据处理能力的中央处理器CPU随机存储器RAM、只读存储器ROM、多种I/O口和中断系统、定时器/计时器等功能(可能还包括显示驱动电路、脉宽调制电路、模拟多路转换器、A/D转换器等电路)集成到一块硅片上构成的一个小而完善的计算机系统。波形发生器是一种数据信号发生器,在调试硬件时,常常需要加入一些信号,以观察电路工作是否正常。用一般的信号发生器,不但笨重,而且只发一些简单的波形,不能满足需要。例如用户要调试串口通信程序时,就要在计算机上写好一段程序,再用线连接计算机和用户实验板,如果不正常,不知道是通讯线有问题还是程序有问题。用E2000/L的波形发生器功能,就可以定义串口数据。通过逻辑探勾输出,调试起来简单快捷。基于单片机的简易波形发生器是一种常用的信号源,它广泛地应用在电子技术实验、自动控制系统和其他科研领域。目前,简易波形发生器的构成方法有很多,例如采用DDS(Direct2DigitalSynthesis)型的任意波发生器、采用专用的信号发生芯片MAX038以及传统的AWG。本设计源于2007年全国大学生电子制做大赛,通过分析比较后采用传统的方法来实现多功能波形发生器。借助高性能单片机运算速度高,系统集成度强的优势,设计的这种信号发生器,比以前的数字式信号发生器具有硬件简单,理解及实现起来较容易,该方案的设计思路较为清晰,且容易对频率和幅值进行控制等优点。低频信号发生器采用单片机波形合成发生器产生高精度,低失真的正弦波电压,可用于校验频率继电器,同步继电器等,也可作为低频变频电源使用。以单片机为核心设计了一个低频函数信号发生器。信号发生器采用数字波形合成技术,通过硬件电路和软件程序相结合,可输出自定义波形,如正弦波、方波、三角波及其他任意波形。波形的频率和幅度在一定范围内可任意改变。介绍了波形的生成原理、硬件电路和软件部分的设计原理。介绍了单片机控制D/A转换器产生上述信号的硬件电路和软件编程、DAC0832D/A转换器的原理和使用方法、AT89C52以及与设计电路有关的各种芯片、关于产生不同低频信号的信号源的设计方案。该信号发生器具有体积小、价格低、性能稳定、功能齐全的优点。2系统设计2.1方案:利用AT89C52单片机采用程序设计方法产生锯齿波、正弦波、矩形波三种波形,再通过D/A转换器DAC0832将数字信号转换成模拟信号,滤波放大,最终由示波器显示出来,通过键盘来控制三种波形的类型选择、频率变化,最终输出显示其各自的类型以及数值。设计要求1)、利用单片机采用软件设计方法产生三种波形2)、三种波形可通过键盘选择3)、波形频率可调4)、需显示波形的种类及其频率2.2器件选择1、通过单片机控制D/A,输出三种波形。2、AT89C52单片机是一种高性能8位单片微型计算机。它把构成计算机的中央处理器CPU、存储器、寄存器、I/O接口制作在一块集成电路芯片中,从而构成较为完整的计算机、而且其价格便宜。3、采用LCD液晶显示器1602。其功率小,效果明显,显示编程容易控制,可以显示字母。2.3总体系统设计该系统采用单片机作为数据处理及控制核心,由单片机完成人机界面、系统控制、信号的采集分析以及信号的处理和变换,采用按键输入,利用液晶显示电路输出数字显示的方案。将设计任务分解为按键电路、液晶显示电路等模块。2.4硬件实现及单元电路设计2.4.1单片机最小系统的设计89C52是片内有ROM/EPROM的单片机,因此,这种芯片构成的最小系统简单﹑可靠。用89C52单片机构成最小应用系统时,只要将单片机接上时钟电路和复位电路即可,如图89C51单片机最小系统所示。由于集成度的限制,最小应用系统只能用作一些小型的控制单元。其应用特点:有可供用户使用的大量I/O口线。内部存储器容量有限。应用系统开发具有特殊性。标准的52为8K程序空间,128字节的RAM,32条端口,5个中断,2个定时/计数器,12个时钟周期执行一条基本指令,最长的除法为48个周期。52为8K程序空间,256字节的RAM,32条端口,6个中断,3个定时/计数器。2.4.2D/A转换器DAC0832是双列直插式8位D/A转换器。能完成数字量输入到模拟量(电流)输出的转换。图3.5为DAC0832的引脚图。其主要参数如下

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论