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

<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)用 > 單片機閃爍燈設(shè)計

        單片機閃爍燈設(shè)計

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

        ;*************************************************
        ;* 本程序是一個LED燈的循環(huán)程序,用INT鍵來切換*
        ;* 模式 *www.dangdangdz.com
        ;*************************************************
        include p16f877.inc>
        ;*----
        MODESEL equ 20h
        MODESELB equ 21h
        Count equ 22h
        Count1 equ 23h
        Count2 equ 24h
        PORTDB equ 25h

        本文引用地址:http://www.antipu.com.cn/article/170991.htm

        ;*-----

        org 0
        goto start
        org 4
        goto ISR

        org 10
        start
        clrf PORTD ;清D口
        movlw 00h
        movwf MODESEL ;初始化模式選擇寄存器
        movwf MODESELB
        movlw b'10010000'
        movwf INTCON ;初始化中斷控制
        bsf STATUS,RP0
        clrf TRISD ;設(shè)D口全為輸出
        movlw b'10111111'
        OPTION ;選擇INT下降沿有效

        bcf STATUS,RP0
        call FMsel
        movwf PORTDB
        movwf PORTD
        main btfsc PORTB,0 ;
        goto $+6 ;
        call Delay ; 按鍵去抖動
        btfsc PORTB,0
        goto $+3 ; /
        call FMsel ;/
        movwf PORTDB
        movf MODESELB,W ;
        movwf MODESEL ;
        call LongDelay
        bcf STATUS,C
        rlf PORTDB,1
        btfsc STATUS,C
        bsf PORTDB,0
        movf PORTDB,W
        movwf PORTD
        goto main

        ;*----------
        Delay ; call指令占用2個指令周期
        clrf Count ; 清 Count占用1個指令周期
        Dloop
        decfsz Count,f ; 這兩行指令將延時
        goto Dloop ; (256 * 3) -1 個指令周期
        return ; return占用2個指令周期

        ;*----------------
        LongDelay
        clrf Count
        clrf Count1
        movlw 0x01
        movwf Count2
        LDloop
        decfsz Count,f
        goto LDloop
        decfsz Count1,f
        goto LDloop
        decfsz Count2,f
        goto LDloop
        return


        上一頁 1 2 下一頁

        關(guān)鍵詞: 設(shè)計 閃爍 單片機

        評論


        相關(guān)推薦

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

        關(guān)閉