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

<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)用 > ADC0809模數(shù)轉(zhuǎn)換器的C51功能函數(shù)

        ADC0809模數(shù)轉(zhuǎn)換器的C51功能函數(shù)

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

        //啟動A/D轉(zhuǎn)換函數(shù):StartADC()

        void StartADC(uchar Address)

        {

        PinC = (bit) (Address 0x04); //C最高位

        PinB = (bit) (Address 0x02);

        PinA = (bit) (Address 0x01); //以上3句輸出地址CBA

        PinSTART = 0; //啟動AD0809進行A/D轉(zhuǎn)換

        }

        //等待A/D轉(zhuǎn)換結(jié)束函數(shù):WaitADCEnd()

        void WaitADCEnd(void)

        {

        while(!PinEOC) ; //讀入轉(zhuǎn)換結(jié)束信號EOC,=1返回。

        }

        //讀取A/D轉(zhuǎn)換后的數(shù)據(jù)函數(shù):ReadData()

        uint ReadData(void)

        {

        uint temp;

        WaitADCEnd(); //調(diào)用 等待A/D轉(zhuǎn)換結(jié)束 函數(shù)。

        PinOE = 0; //OE腳 經(jīng)非門=1 讀入數(shù)據(jù)。

        nNop(2);

        temp = PinData 0xff;

        return(temp); // 返回數(shù)值是 A/D轉(zhuǎn)換后的數(shù)字量。

        }

        程序功能:

        (1) 啟動ADC0809進行A/D轉(zhuǎn)換;

        (2) 等待A/D轉(zhuǎn)換結(jié)束;

        (3) A/D轉(zhuǎn)換結(jié)束后讀入數(shù)據(jù)。

        模數(shù)轉(zhuǎn)換器相關(guān)文章:模數(shù)轉(zhuǎn)換器工作原理




        評論


        相關(guān)推薦

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

        關(guān)閉