stm32定时器指南

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

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

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

资源描述

February2012DocID022500Rev11/27AN4013ApplicationnoteSTM32F1xx,STM32F2xx,STM32F4xx,STM32L1xxtimeroverview1IntroductionThisdocument:●presentsanoverviewofthetimerperipheralsintheSTM32F1xx,STM32F2xx,STM32F4xxandSTM32L1xxmicrocontrollerfamilies,●describesthevariousmodesandspecificfeaturesofthetimers,suchasclocksources,●explainshowtousetheavailablemodesandfeatures,●explainshowtocomputethetimebaseineachconfiguration,●describesthetimersynchronizationsequencesandtheadvancedfeaturesformotorcontrolapplications,inadditiontothebasictimermodes.Foreachmode,typicalconfigurationsarepresentedandexamplesofhowtousethemodesareprovided.Intherestofthisdocument(unlessotherwisespecified),thetermSTM32xxisusedtorefertoSTM32F1xx,STM32F2xx,STM32F4xxandSTM32L1xxmicrocontrollerfamilies.:●Generalpurposetimersareusedinanyapplicationforoutputcompare(timinganddelaygeneration),one-pulsemode,inputcapture(forexternalsignalfrequencymeasurement),sensorinterface(encoder,hallsensor)...●Advancedtimers:thesetimershavethemostfeatures.Inadditiontogeneralpurposefunctions,theyincludeseveralfeaturesrelatedtomotorcontrolanddigitalpowerconversionapplications:threecomplementarysignalswithdeadtimeinsertion,emergencyshut-downinput.●Oneortwochanneltimers:usedasgeneralpurposetimerswithalimitednumberofchannels.●Oneortwochanneltimerswithcomplementaryoutput:sameasprevioustype,buthavingadeadtimegeneratorononechannel.Thisallowshavingcomplementarysignalswithatimebaseindependentfromtheadvancedtimers.●Basictimershavenoinput/outputsandareusedeitherastimebasetimersorfortriggeringtheDACperipheral.Table1summarizestheSTM32familytimers.Table2presentsageneraloverviewoftimerfeatures.OverviewAN40134/27DocID022500Rev1Table1.STM32familytimersTimertypeSTM32F101/102/103/105/107familiesSTM32F100familySTM32L1familySTM32F2andSTM32F4familiesAdvancedTIM1TIM1TIM1TIM8TIM8Generalpurpose16-bitTIM2TIM2TIM2TIM3TIM3TIM3TIM3TIM4TIM4TIM4TIM4TIM5TIM532-bitTIM2TIM5BasicTIM6TIM6TIM6TIM6TIM7TIM7TIM7TIM71-channelTIM10TIM10TIM10TIM11TIM11TIM11TIM13TIM13TIM13TIM14TIM14TIM142-channelTIM9TIM9TIM9TIM12TIM12TIM121-channelwithonecomplementaryoutputTIM152-channelwithonecomplementaryoutputTIM16TIM17AN4013OverviewDocID022500Rev15/27Table2.TimerfeaturesoverviewTimertypeCounterresolutionCountertypeDMAChannelsComp.channelsSynchronizationMasterconfig.Slaveconfig.Advanced16bitup,downandcenteralignedYes43YesYesGeneralpurpose16bit32bit(1)up,downandcenteralignedYes40YesYesBasic16bitupYes00YesNo1-channel16bitupNo10Yes(OCsignal)No2-channel16bitupNo20YesYes1-channelwithonecomplementaryoutput16bitupYes11Yes(OCsignal)No2-channelwithonecomplementaryoutput16bitupYes21NoYes1.TIM2andTIM5are32-bitcounterresolutionintheSTM32F2andSTM32F4families.BasictimermodesAN40136/27DocID022500Rev13BasictimermodesBasictimerscanbeprogrammedtoworkinoneofthefollowingconfigurations.3.1ClockinputsourcesThetimercanbesynchronizedbyseveralclockssimultaneously:●Internalclock●Externalclock–Externalmode1(TI1orTI2pins)–Externalclockmode2(ETRpin)–Internaltriggerclock(ITRx)3.1.1InternalclockThetimerisclockedbydefaultbytheinternalclockprovidedfromtheRCC.Toselectthisclocksource,theSMCR_SMS(ifpresent)bitsshouldbereset.3.1.2ExternalclockTheexte

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

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

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

×
保存成功