中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 51片內(nèi)定時(shí)器的應(yīng)用

        51片內(nèi)定時(shí)器的應(yīng)用

        作者: 時(shí)間:2011-10-09 來源:網(wǎng)絡(luò) 收藏


        利用定時(shí)/計(jì)數(shù)器T1產(chǎn)生定時(shí)時(shí)鐘,由P1口
        控制8個(gè)發(fā)光二極管,使8個(gè)指示燈依次一個(gè)
        一個(gè)閃動(dòng),閃動(dòng)頻率為10次/秒(8個(gè)燈依次
        亮一遍為一個(gè)周期),循環(huán).
        晶振:12MHz
        stone
        2009 04 10
        **********************************/

        #includereg52.h>
        #includeintrins.h>
        #define uchar unsigned char
        #define uint unsigned int
        #define led P0
        uint temp,t=0;
        void main()
        {
        EA=1;
        ET1=1;
        TMOD=0x10;
        TH1=-50000/256;
        TL1=-50000/256;
        TR1=1;

        temp=0xfe;
        while(1)
        {
        if(t%2==0)
        {
        led=temp;
        if(t==20)
        {
        t=0;
        temp=_crol_(temp,1);
        }
        }
        if(t%2==1)
        {
        led=0xff;
        }
        }
        }

        void time() interrupt 3
        {
        TH1=-50000/256;
        TL1=-50000/256;
        t++;
        }



        關(guān)鍵詞: 51 片內(nèi)定時(shí)器

        評(píng)論


        相關(guān)推薦

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

        關(guān)閉