Atmel Studio & ASF开发入门

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

2015爱特梅尔中国大学技术巡回讲座(一)APPLICATIONNOTEAtmelAN-6397:SAMD21DMACTrainingASFPROJECTDOCUMENTATIONIntroductionThedatatransferbetweenmemoriesandperipheralsisanessentialpartofmicrocontrollerbaseddesigns.Normally,theCPUofthemicrocontrollermanagesthedatatransferbetweenvariousperipheralsandmemory.ThedrawbackinthiscaseisthattheCPUwillhavetouseconsiderableamountofprocessingtimetomanagethisdatatransfer.WiththeintroductionofDirectMemoryAccessController(DMAC),thememoriesandperipheralscantransferdatadirectlywithoutCPUintervention.ThiswillreducetheCPUusagefordatatransfer.ThenCPUcanbeutilisedtodootherprocessing.TheCPUcanbeinlowpowermodeforlongertimetosavemorepower.ItalsoenableshighdatatransferratesasthereisnoCPUoverhead.Thishands-ontrainingmaterialwilldemonstratetheuseofDMACforthedatatransferbetweenperipheralandmemory.TheanalogvoltagemeasuredusingADCwillbetransferredtothedatabufferininternalSRAM.ThecodedevelopedforthistrainingwillusetheADCininputscanmodethatwillscanmultipleADCchannels.WithoutDMA,theCPUreadsADCresultfromADCregisterandthenCPUwritesthatdatatointernalSRAM.ButwithDMAC,theADCreadingswillbetransferreddirectlytomultipledatabuffersinSRAM,withoutCPUintervention.6397-MCU-05/2014TableofContentsAtmelAN-6397:SAMD21DMACTraining[APPLICATIONNOTE]6397-MCU-05/20142Introduction.........................................................................................11.PrerequisitesandIconkeyIdentifiers..........................................31.1.Prerequisites..............................................................................31.2.IconKeyIdentifiers.....................................................................32.SA2.1.MD21DMAC..........................................................................4SAMD21DMACFeatures............................................................42.2.DMABasics...............................................................................42.3.DMATransferFormatsintheSAMD21..........................................52.3.1.Beat.............................................................................52.3.2.Burst............................................................................52.3.3.Block............................................................................52.3.4.Transaction....................................................................52.4.Triggers....................................................................................52.4.1.SoftwareTrigger.............................................................52.4.2.EventTriggers...............................................................52.4.3.DedicatedPeripheraltriggers............................................52.5.DMATransferDescriptors............................................................52.5.1.DMACInteractionwithDescriptor......................................63.ADCInputScanmethod..............................................................73.1.InputScanandDMA...................................................................73.2.InputScanOrder........................................................................73.3.InputScanConsiderations............................................................74.HardwareandSoftwareSetup.....................................................94.1.HardwareSetup.........................................................................94.2.GettingStarted.........................................................................104.3.ClockConfiguration...................................................................145.DMACSoftwareExample...........................................................165.1.SoftwareDescription..................................................................165.2.AddingDriversusingASFwizard.................................................165.3.ADCconfiguration.....................................................................205.3.1.ADCInputScanConfiguration.........................................215.4.DMAconfiguration.....................................................................235.4.1.ConfiguretheDMAChannel...........................................245.4.2.TheTransferDescriptors................................................265.4.3.Interrupts.....................................................................315.5.ConfigureUSARTforDebugprinting............................................335.6.ProcessingADCResults............................................................346.Summary.....................................................................................376.1.Summaryoftasks.....................................................................376.2.Improvements...........................................................................376.3.ClockSystemConfiguration........................................................376.4.ApplicationProgramflow............................................................376.5.CodeSummary.........................................................................38AtmelAN-6397:SAMD

1 / 46
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功