在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,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è)計應(yīng)用 > DS18B20和PIC單片機(jī)通訊源程序

            DS18B20和PIC單片機(jī)通訊源程序

            作者: 時間:2011-02-24 來源:網(wǎng)絡(luò) 收藏
            ORGPIC54
            GOTOMAIN
            ORG0
            ;----------------------
            ;----------------------------
            DELAY22
            MOVLWD'200';DELAY2*250=500mS
            MOVWFCOUNT1
            DE32MOVLWD'250';8*250=2mS
            MOVWFCOUNT2
            DE42NOP;1+2+1=5uS
            DECFSZCOUNT2,1
            GOTODE42
            DECFSZCOUNT1,1
            GOTODE32
            RETLW0
            ;--------------------------------
            ;子程序!!!
            ;********************************
            MAIN
            MOVLW0FFH
            TRISRA
            LOOP
            CALLCONVERT
            CALLDELAY22
            CALLDELAY22
            CALLGET_TEMP

            GOTOLOOP
            ;------------------------
            GET_TEMP
            CALLINI
            MOVLW0CCH
            MOVWFCOMD
            CALLWR1820
            MOVLW0BEH
            MOVWFCOMD
            CALLWR1820
            CALLRE1820
            MOVFTEM_DATE,W
            MOVWFTEM_DATEL
            CALLRE1820
            MOVFTEM_DATE,W
            MOVWFTEM_DATEH
            RETLW0
            ;------------------------
            CONVERT
            CALLINI
            MOVLW0CCH
            MOVWFCOMD
            CALLWR1820
            MOVLW44H
            MOVWFCOMD
            CALLWR1820
            RETLW0

            ;---------DS1820---------
            INI
            ;MOVLWB'00100000'
            MOVLW0
            TRISRA
            BSFRA,3
            NOP
            BCFRA,3
            MOVLWD'200'
            MOVWFCOUNT1
            L0
            DECFSZCOUNT1,1
            GOTOL0
            ;MOVLWB'01100000'
            MOVLW0FH
            TRISRA
            MOVLWD'30'
            MOVWFCOUNT1
            L1
            DECFSZCOUNT1,1
            GOTOL1
            BTFSCRA,3
            GOTOINI
            L2
            MOVLWD'80'
            MOVWFCOUNT1
            L3
            DECFSZCOUNT1,1
            GOTOL3
            BTFSSRA,3
            GOTOL0
            RETLW0
            ;-------------------------
            WR1820
            MOVLW8
            MOVWFCOUNT2
            WR0
            ;MOVLWB'00100000'
            MOVLW0
            TRISRA
            BCFRA,3
            NOP
            NOP
            MOVLW2
            MOVWFCOUNT1
            WR1
            DECFSZCOUNT1,1
            GOTOWR1
            ;MOVLWB'01111111'
            MOVLW0FH
            BTFSCCOMD,0
            BSFRA,3
            BTFSCCOMD,0
            TRISRA
            BCFSTATUS,C
            RRFCOMD,1
            MOVLWD'20'
            MOVWFCOUNT1
            WR2
            DECFSZCOUNT1,1
            GOTOWR2
            BSFRA,3
            ;MOVLWB'01100000'
            MOVLW0FH
            TRISRA
            DECFSZCOUNT2,1
            GOTOWR0
            RETLW0
            ;--------------------------
            RE1820
            MOVLW8
            MOVWFCOUNT2
            RE0
            ;MOVLWB'00100000'
            MOVLW0
            TRISRA
            BCFRA,3
            MOVLW2
            MOVWFCOUNT1
            RE1
            DECFSZCOUNT1,1
            GOTORE1
            ;MOVLWB'01100000'
            MOVLW0FH
            TRISRA
            NOP
            BTFSSRA,3
            BCFSTATUS,C
            BTFSCRA,3
            BSFSTATUS,C
            RRFTEM_DATE,1
            MOVLWD'20'
            MOVWFCOUNT1
            RE2
            DECFSZCOUNT1,1
            GOTORE2
            DECFSZCOUNT2,1
            GOTORE0
            BSFRA,3
            RETLW0
            ;-------------------------
            ;****************************
            ;**************************
            END




            評論


            相關(guān)推薦

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

            關(guān)閉