日本a√视频在线,久久青青亚洲国产,亚洲一区欧美二区,免费g片在线观看网站

        <style id="k3y6c"><u id="k3y6c"></u></style>
        <s id="k3y6c"></s>
        <mark id="k3y6c"></mark>
          
          

          <mark id="k3y6c"></mark>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 52單片機(jī)定時(shí)器2實(shí)現(xiàn)1s中斷

          52單片機(jī)定時(shí)器2實(shí)現(xiàn)1s中斷

          作者: 時(shí)間:2012-10-08 來源:網(wǎng)絡(luò) 收藏
          include    // 要寫,不能寫//--------默認(rèn)為16位自動(dòng)重載方式------------//void main(){/* T2定時(shí)器溢出預(yù)載值,溢出16次就是1s65536-62500=3036,即0x0bdc */RCAP2H=0x0B;RCAP2L=0xDC; ET2=1;    //  允許T2中斷EA=1;     // 開總中斷TR2=1;    // 啟動(dòng)T2while(1);  //等待溢出中斷}void t2 ( ) interrupt 5{static unsigned char count;            TF2=0;   // 溢出標(biāo)志必須軟件清0count++;if(count==16) {count=0;P1=~P1;  }}


          評論


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

          關(guān)閉