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

<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è)計應(yīng)用 > PHILIPS 51LPC系列單片機解析方案

        PHILIPS 51LPC系列單片機解析方案

        作者: 時間:2012-06-20 來源:網(wǎng)絡(luò) 收藏

        void speed(s){ /*電機轉(zhuǎn)換控制子程序*/

        uchar pulsecount, pulseduration=0;

        uint i=0;

        uint j=0;

        if (((CMP10x02))!(CMP20x02)/*查詢比較器*/

        {for (i=0;i

        {for(j=0;j210;j++) ;} /*延時觸發(fā)*/

        CMP1=CMP10xfc;

        CMP2=CMP20xfc;

        pulsecount=1;

        {P1=P10xfe;

        pulseduration=12; /*觸發(fā)脈沖寬度*/

        while(pulseduration){pulseduration- -;}

        P1=P1|0x01;

        pulsecount- -;

        }

        }

        }

        void Initcomparatior(void){ //初始化P87LPC761//

        PT0AD=0x6f; /*禁止P0口的數(shù)字功能*/

        P0=0xff;

        P0M1=0x2a; /*P01,P03,P05設(shè)為高阻輸入*/

        P0M2=0xd5; /*P00,P04,P06設(shè)為推挽方式*/

        P1=0xff;

        P1M1=0x82; /*P17用于VZC檢測*/

        P1M2=0x05;

        CMP1=0x34;

        CMP2=0x34;

        }

        void main(void)

        {uchar pulsecount ,pulseduration=0x00;

        uint j;i=0;

        SP=0x5f;EA=0;

        TH0=-(28/256);

        TL0=-(28%256);

        TF0=0;EA=0;TR0=0;

        ET0=1;CMP1=CMP2=0;

        Initcomparator();

        CMP1=CMP10xfc;

        CMP2=CMP20xfc;s=0;

        while(P1_1) {;}

        while(!P1_1){;}

        while(P10x80){};

        while(!(P10x80)){};

        while(P10x80){}

        while(!(P10x80)){};

        while(P10x80){};

        P1=P10xfe; //啟動電機

        while(1)

        {if(P1_1= =0) {

        x=0;

        while (!x){;}

        if(P1_1=0)

        {P1=0xff;s=s+1;} //停止電機

        if(s= =8){s=0;}

        while(!P1_1){;} //等待釋放按鍵

        while(P10x80){};

        while(!(P10x80)){};

        while(P10x80)();

        whie(!(P10x80)){};

        while(P10x80){};

        P1=P10xfe;} //啟動電機

        EA=1;TR0=1;

        speed(s); }

        } //結(jié)束


        上一頁 1 2 3 下一頁

        關(guān)鍵詞: 解析 方案 單片機 系列 51LPC PHILIPS

        評論


        相關(guān)推薦

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

        關(guān)閉