在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 利用stm32f103的TIM2實(shí)現(xiàn)精確延時(shí)

            利用stm32f103的TIM2實(shí)現(xiàn)精確延時(shí)

            作者: 時(shí)間:2016-11-19 來源:網(wǎng)絡(luò) 收藏
            void TIM_ResetCounter(TIM_TypeDef * TIMx)
            {TIMx->CNT = 0;}void TIM2_Delay_ms(unsigned int cms){unsigned short temp = 0;TIM_TimeBaseInitTypeDef  TIM_TimeBaseStructure;TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);TIM_TimeBaseStructure.TIM_Prescaler = 36000 - 1;TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Down;TIM_TimeBaseStructure.TIM_Period = cms * 2;TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);TIM_Cmd(TIM2, ENABLE);do{temp = TIM_GetCounter(TIM2);}while(temp != 0x01);/*此處不能計(jì)數(shù)到0*/TIM_Cmd(TIM2, DISABLE);TIM_ResetCounter(TIM2);/*將計(jì)數(shù)寄存器的值恢復(fù)為0是必須的*/}


            關(guān)鍵詞: stm32f103TIM2精確延

            評(píng)論


            技術(shù)專區(qū)

            關(guān)閉