外文以及翻译-基于单片机的电子琴设计.docx
《外文以及翻译-基于单片机的电子琴设计.docx》由会员分享,可在线阅读,更多相关《外文以及翻译-基于单片机的电子琴设计.docx(7页珍藏版)》请在冰点文库上搜索。
外文资料原文
Microcontroller-baseddesignandmanufacture
(1)MCU
Amicrocontroller(orMCU)isacomputer-on-a-chip.Itisatypeofmicroprocessoremphasizingself-sufficiencyandcost-effectiveness,incontrasttoageneral-purposemicroprocessor(thekindusedinaPC).
Themajorityofcomputersystemsinusetodayareembeddedinothermachinery,suchastelephones,clocks,appliances,vehicles,andinfrastructure.Anembeddedsystemusuallyhasminimalrequirementsformemoryandprogramlengthandmayrequiresimplebutunusualinput/outputsystems.Forexample,mostembeddedsystemslackkeyboards,screens,disks,printers,orotherrecognizableI/Odevicesofapersonalcomputer.Theymaycontrolelectricmotors,relaysorvoltages,andreadswitches,variableresistorsorotherelectronicdevices.Often,theonlyI/Odevicereadablebyahumanisasinglelight-emittingdiode,andseverecostorpowerconstraintscaneveneliminatethat.
Incontrasttogeneral-purposeCPUs,microcontrollersdonothaveanaddressbusoradatabus,becausetheyintegratealltheRAMandnon-volatilememoryonthesamechipastheCPU.Becausetheyneedfewerpins,thechipcanbeplacedinamuchsmaller,cheaperpackage.
Integratingthememoryandotherperipheralsonasinglechipandtestingthemasaunitincreasesthecostofthatchip,butoftenresultsindecreasednetcostoftheembeddedsystemasawhole.(EvenifthecostofaCPUthathasintegratedperipheralsisslightlymorethanthecostofaCPU+externalperipherals,havingfewerchipstypicallyallowsasmallerandcheapercircuitboard,andreducesthelaborrequiredtoassembleandtestthecircuitboard).Thistrendleadstodesign.
Amicrocontrollerisasingleintegratedcircuit,commonlywiththefollowingfeatures:
centralprocessingunit-rangingfromsmallandsimple4-bitprocessorstosophisticated32-or64-bitprocessors
input/outputinterfacessuchasserialports(UARTs)
otherserialcommunicationsinterfaceslikePC,SerialPeripheralInterfaceandControllerAreaNetworkforsysteminterconnectperipheralssuchastimersandwatchdogRAMfordatastorageROM,EPROM,EEPROMorFlashmemoryforprogramstorageclockgenerator-oftenanoscillatorforaquartztimingcrystal,resonatororRCcircuitmanyincludeanalog-to-digitalconverters.
ThisintegrationdrasticallyreducesthenumberofchipsandtheamountofwiringandPCBspacethatwouldbeneededtoproduceequivalentsystemsusingseparatechipsandhaveprovedtobehighlypopularinembeddedsystemssincetheirintroductioninthe1970s.
SomemicrocontrollerscanaffordtouseaHarvardarchitecture:
separatememorybusesforinstructionsanddata,allowingaccessestotakeplaceconcurrently.
Thedecisionofwhichperipheraltointegrateisoftendifficult.TheMicrocontrollervendorsoftentradeoperatingfrequenciesandsystemdesignflexibilityagainsttime-to-marketrequirementsfromtheircustomersandoveralllowersystemcost.Manufacturershavetobalancetheneedtominimizethechipsizeagainstadditionalfunctionality.
Microcontrollerarchitecturesareavailablefrommanydifferentvendorsinsomanyvarietiesthateachinstructionsetarchitecturecouldrightlybelongtoacategoryoftheirown.Chiefamongthesearethe8051,Z80andARMderivatives.[citationneeded]
Amicrocontroller(alsoMCUorpC)isafunctionalcomputersystem-on-a-chip.Itcontainsaprocessorcore,memory,andprogrammableinput/outputperipherals.
MicrocontrollersincludeanintegratedCPU,memory(asmallamountofRAM,programmemory,orboth)andperipheralscapableofinputandoutput.
Itemphasizeshighintegration,incontrasttoamicroprocessorwhichonlycontainsaCPU(thekindusedinaPC).Inadditiontotheusualarithmeticandlogicelementsofageneralpurposemicroprocessor,themicrocontrollerintegratesadditionalelementssuchasread-writememoryfordatastorage,read-onlymemoryforprogramstorage,Flashmemoryforpermanentdatastorage,peripherals,andinput/outputinterfaces.Atclockspeedsofaslittleas32KHz,microcontrollersoftenoperateatverylowspeedcomparedtomicroprocessors,butthisisadequatefortypicalapplications.Theyconsumerelativelylittlepower(milliwattsorevenmicrowatts),andwillgenerallyhavetheabilitytoretainfunctionalitywhilewaitingforaneventsuchasabuttonpressorinterrupt.Powerconsumptionwhilesleeping(CPUclockandperipheralsdisabled)maybejustnanowatts,makingthemidealforlowpowerandlonglastingbatteryapplications.
Microcontrollersareusedinautomaticallycontrolledproductsanddevices,suchasautomobileenginecontrolsystems,remotecontrols,officemachines,appliances,powertools,andtoys.Byreducingthesize,cost,andpowerconsumptioncomparedtoadesignusingaseparatemicroprocessor,memory,andinput/outputdevices,microcontrollersmakeiteconomicaltoelectronicallycontrolmanymoreprocesses.
Themajorityofcomputersystemsinusetodayareembeddedinothermachinery,suchasautomobiles,telephones,appliances,andperipheralsforcomputersystems.Thesearecalledembeddedsystems.Whilesomeembeddedsystemsareverysophisticated,manyhaveminimalrequirementsformemoryandprogramlength,withnooperatingsystem,andlowsoftwarecomplexity.Typicalinputandoutputdevicesincludeswitches,relays,solenoids,LEDs,smallorcustomLCDdisplays,radiofrequencydevices,andsensorsfordatasuchastemperature,humidity,lightleveletc.Embeddedsystemsusuallyhavenokeyboard,screen,disks,printers,orotherrecognizableI/Odevicesofapersonalcomputer,andmaylackhumaninteractiondevicesofanykind.
Itismandatorythatmicrocontrollersproviderealtimeresponsetoeventsintheembeddedsystemtheyarecontrolling.Whencertaineventsoccur,aninterruptsystemcansignaltheprocessortosuspendprocessingthecurrentinstructionsequenceandtobeginaninterruptserviceroutine(ISR).TheISRwillperformanyprocessingrequiredbasedonthesourceoftheinterruptbeforereturningtotheoriginalinstructionsequence.Possibleinterruptsourcesaredevicedependent,andoftenincludeeventssuchasaninternaltimeroverflow,completingananalogtodigitalconversion,alogiclevelchangeonaninputsuchasfromabuttonbeingpressed,anddatareceivedonacommunicationlink.Wherepowerconsumptionisimportantasinbatteryoperateddevices,interruptsmayalsowakeamicrocontrollerfromalowpowersleepstatewheretheprocessorishalteduntilrequiredtodosomethingbyaperipheralevent.
Microcontrollerprogramsmustfitintheavailableon-chipprogrammemory,sinceitwouldbecostlytoprovideasystemwithexternal,expandable,memory.Compilersandassemblylanguageareusedtoturnhigh-levellanguageprogramsintoacompactmachinecodeforstorageinthemicrocontroller'smemory.Dependingonthedevice,theprogrammemorymaybepermanent,read-onlymemorythatcanonlybeprogrammedatthefactory,orprogrammemorymaybefield-alterableflashorerasableread-onlymemory.
Sinceembeddedprocessorsareusuallyusedtocontroldevices,theysometimesneedtoacceptinputfromthedevicetheyarecontrolling.Thisisthepurposeoftheanalogtodigitalconverter.Sinceprocessorsarebuilttointerpretandprocessdigitaldata,i.e.IsandOs,theywon'tbeabletodoanythingwiththeanalogsignalsthatmaybebeingsenttoitbyadevice.Sotheanalogtodigitalconverterisusedtoconverttheincomingdataintoaformthattheprocessorcanrecognize.Thereisalsoadigitaltoanalogconverterthatallowstheprocessortosenddatatothedeviceitiscontrolling.
Inadditiontotheconverters,manyembeddedmicroprocessorsincludeavarietyoftimersaswell.OneofthemostcommontypesoftimersistheProgrammableIntervalTimer,orPITforshort.APITjustcountsdownfromsomevaluetozero.Onceitreacheszero,itsendsaninterrupttotheprocessorindicatingthatithasfinishedcounting.Thisisusefulfordevicessuchasthermostats,whichperiodicallytestthetemperaturearoundthemtoseeiftheyneedtoturntheairconditioneron,theheateron,etc.
TimeProcessingUnitorTPUforshort.Isessentiallyjustanothertimer,butmoresophisticated.Inadditiontocountingdown,theTPUcandetectinputevents,generateoutputevents,andotherusefuloperations.
DedicatedPulseWidthModulation(PWM)blockmakesitpossiblefortheCPUtocontrolpowerconverters,resistiveloads,motors,etc.,withoutusinglotsofCPUresourcesintighttimerloops.
UniversalAsynchronousReceiver/Transmitter(UART)blockmakesitpossibletoreceiveandtransmitdataoveraseriallinewithverylittleloadontheCPU.
ForthosewantingethemetonecanuseanexternalchiplikeCrystalSemiconductorCS8900A,RealtekRTL8019,orMicrochipENC28J60.Allofthemalloweasyinterfacingwithlowpincount.
(2)Externaloscillatorandcrystal
Externalcrystalisasimpleandstraightforwardconnectionwiththechipandtheloadcapacitanceofthecrystalpart,checkthedatasheet,usually,however,theoscillatorfrequencyandthechipcanbedirectlyconnectedtopins,withoutdecouplingcapacitor.Tendtorequireahighfrequencyoscillatorcapacitor,ifyouareveryluckytohaveaccurateTTLorCMOSleveloscillator,itjustneedstobeconnectedtoXINpin,closeOscillatorusingOSCOff,XOUTcanalsobeavacantground.
Digitallycontrolledoscillatorbyconnectingaresistorintheexternaloscillator,I'mnotsure,butyouwill,sothatwecaninthisconfigurationusinganexternaldigitalvoltmetertestexecutionoscillationiscorrect,thiswillbeverycheap,simpleandmorereliabletouseon-chiposcillatorsufficientlyaccurate.I'msureinthefuturethere