浙江科技学院毕业设计(论文)(外文翻译)DesignofDigitalControlledSignalGeneratorBasedonDDSandMCUYinjunChena,ZehuaiYuanFacultyofElectronicInformationandMechanicalElectricalEngineering,ZhaoqingUniversity,Zhaoqing526061,ChinaKeywords:DDS;MCU;Signalgenerator;PhaseAccumulator;DACAbstract.ItsadvantagetouseDDSchipisoutputsignalfrequencybigger,andprecisionhigher,Butuserscan'tchangetheoutputsignalwaveforms.TheMCUcanproducetherequiredarbitrarywaveforms,butitsprogramexecutionoftheorderlimitthespeed.SoweusetheirSynergytodesignthedigitalcontrolledsignalgenerator.TheSystemhastheadvantageofoutputgoodqualitywaveform,frequencyofprecisionandstability,andhighfrequency,empty,amplitudeandphaseistostepintotheneed.IntroductionThedigitallysynthesizedsinewaveform(DirectDigitalSynthesis,DDS)isawell-knownmethodandhasbeenappliedtomanyembeddedapplications[1].Thistechniquecanbeusedtocreateapositivedigitalsinewaveform.Comparedtootherfrequencycomposingmethod,DirectDigitalFrequencySynthesis(DDS)hasbeenthemostpopulartrendinmodernfrequencysynthetictechniqueforitsexcellentcharacteristics.ThesignalsourcethattheDDStechnologyrealizescancarryoutaccuratecontrollingonDDSfrequency,extent,phaseexportingwaveform'setc.bynumericalcontrolcircuit,thesystemmakinguseofthismethodhasmanymeritssuchasstability,reliablyandaccuracy.ThecommercialDDSchipcanonlyexportasinewaveforthedataintheROMformalreadyhasbeensolidified.Ifneedingtocomeintobeinganywaveform,itmaycometruebythewaythatFPGAadoptsDDSIPcoreorhardwaredescribelanguageetc,however,thecostofThiswaycostishigh;ontheotherhand,anywaveformcanbeachievedbymakinguseofmicrocontrollerunit(MCU)tocarryoutfigurefrequencycombiningandDAconverting.TheexperimentandapplyingtestinghaveshownthatthenumericalcontrolsignalsourcecomposedofSTM32microcontrollerandDDSchipcanworkwell.浙江科技学院毕业设计(论文)(外文翻译)DDSandwaveformprogrammingpatternThecoreofDDSsystemisphaseaccumulatorcarriage,anditiscomposedofaADRandoneunitphaseregister.Whenanyclockcomes,thephaseregisterincreasesbywiththesteplength,phaseregisteroutputandphasecontrolwordaddtogether,andthentheoutputisimportedtosineinquiryformaddress.Thesineinquiringformincludesthenumeralextentinformationofone-periodsinewave,eachaddresscorrespondstothephasedotof0~360degreesofthesinewave.ThemappingdigitalsignaldrivesDACandoutputsanalogvalue.TheoutputsinecircleandfrequencyareThephaseregisterwillreturntotheoriginalstatewhenthe2N/Mfcclockisfinished.Accordingly,theDDSsystemoutputasinewavewhenthesineinquiringformfinishacircle.TheoutputsinecircleandfrequencyisTO--outputsinewavecircle,unit:s;TC--externalreferencedclockcircle,unit:s;M--accumulatedsteplengthofphaseregister,constant;fout--outputsinewavefrequency,unit:Hz;fc--externalreferencedclockfrequency,unit:Hz;N--phaseaccumulatordigit,constant.Therelationshipamongthefrequencycontrolword,andtheoutputsignalfrequencyandthereferencedclockfrequencyare:Frequencycontrolwordisdirectlyproportionaltotheoutputsignalfrequency.Inordertodescribeclearly,thesinewaveformisasonevectorturnsaroundphasecircle,thephasecirclematchesalongwithacyclesinewave.Everysamplingpotsinwaveformcorrespondstoaphasedotofthephasecircle.Tosynthesistherequiredfrequencysignal,itneedstoaccomplishthefollowingsteps1.Controllingeverysamplingincrementofphaseandaccumulatingthem(frequencycontrolwordK),output2picumulatedphase(usingphaseaccumulator).2.Converting2piaccumulatingphaseintothecorrespondingsineamplitude,useROMtostorethecorrespondingphase-extentformofsinefunctioningeneral.3.UseDACtochangeextentcodeintothesignalsimulatingvoltage.浙江科技学院毕业设计(论文)(外文翻译)4.ThevoltagesignalthatDACexportsisladderwaveform,therequiredsimulationvoltageoutisachievedafterLPFsmoothing.NumericalcontrolDDSsignalsourcesystemdesignsanalysisSystemusestheSTM32ascontrolcoreandtheAD9850asgenerator.STM32is32-bitARM-basedmicrocontrollerwith128Kbyteflashmemory.ThetwosignaloutputofSTM32canbeachievedbycontrollingAD9850andDAC0832outputsimultaneously.ThesystemdesignsblockdiagramisshowninFig.1.Onesignaloutputcangenerate30MHzsinewaveandrectangularwavebycontrollingAD9850,theotheroutputgenerateanywaveformwithitsfrequencylessthan10KHzbynumericalfrequencymixtureofDAC0832.Fig.1SystemdesignsblockdiagramHardwaredesignAD9850moduleAD9850containstheDDSsystemandhigh-speedcomparator.TheAD9850canrealizetheentirenumericalfrequencycombining.ThecoreoftheprogrammableDDSisthephaseaccumulator,itiscomposedofaADRandaNbitphaseregister,Nisfor24~32.Afterconnectingtotheaccurateclocksourceandwritingthefrequencyphasecontrolword,AD9850cangeneratethefrequency-programmableandphase-programmableoutputofanalogsinewave,whichcanbeusedasthedirectfrequencysignalsourceorbetransferredintorectangularwavethroughhigh-speedcomparator.Withthe125MHzclock,32-bitfrequencycontrolwordcancarryouttheoutputfrequencyresolutionratioofAD9850with0.0291Hz[4].DAC0832moduleThecircuitexportsthephasedatasheettoDAC0832fromSTM32andgetscorrespondingwaveformbyDAconverting.Thestep-by-stepadjustingphaseamountscancreatearbitraryfrequency,thePWMsignalfromtheSTM32transfersintothecorrespondingvoltagebylow-pass浙江科技学院毕业设计(论文)(外文翻译)filter,th