中文字幕无码不卡一区二区三区_少妇被又大又粗又爽毛片久久黑人_91精品国产在热久久无毒不卡_久久久久久亚洲综合网站

技術(shù)熱線: 4007-888-234

專(zhuān)注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命

提供開(kāi)發(fā)工具、應(yīng)用測(cè)試 完善的開(kāi)發(fā)代碼案例庫(kù)分享

從全面的產(chǎn)品導(dǎo)入到強(qiáng)大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無(wú)限潛能!

技術(shù)支持

有關(guān)PIC12F629

更新時(shí)間: 2019-03-26

PIC12F629
;1.Master Clear Enable 此項(xiàng)為MCLR<4>選項(xiàng)
;  internal:內(nèi)部自控  External:外部控制
;2.Oscillator:可設(shè)內(nèi)部,外部震蕩<internal,external>
;  如果選NO Clock3腳作I/O口用,否則3腳作CLKOUT
;***********************************
      include
        P1      EQU    2CH
        P2      EQU    2DH
        Y1      EQU    20H          ;Y1,Y2為去抖
        Y2      EQU    21H          ;動(dòng)延時(shí)寄存器
        ADDR    EQU    23H          ;EEPROM地址寄存器
        DATE1   EQU    24H          ;EEPROM數(shù)據(jù)寄存器
        BIT     EQU    25H
        BIT1    EQU    26H
        TUMP    EQU    27H
        TUMP1   EQU    28H
        CB      EQU    29H          ;顯示輸出公用查表量
        SHUA    EQU    2AH          ;刷新用
        SHUA1   EQU    2BH          ;刷新用
        AB      EQU    .1           ;顯示數(shù)據(jù)
        CLK     EQU    .2           ;顯示時(shí)鐘
        AB1     EQU    .4           ;輸出數(shù)據(jù)
        CLK1    EQU    .0           ;輸出時(shí)鐘
        #DEFINE       IN1  GPIO,3   ;按鍵加

  #DEFINE       IN2  GPIO,5   ;按鍵減
        ORG     0000H
        NOP
        BSF     STATUS,RP0
        MOVLW   B’00101000’         ;設(shè)GP5,GP3為輸入
        MOVWF   TRISIO
        BCF     OPTION_REG,7        ;設(shè)GP5弱上拉
        BSF     WPU,5
        MOVLW   0FFH
        MOVWF   OSCCAL              ;設(shè)頻率最好
        BCF     STATUS,RP0
        MOVLW   00H
        MOVWF   ADDR                ;訪問(wèn)EEPROM00H
        CALL    READ                ;EEPROM
        MOVWF   CB
        MOVF    CB,W
        SUBLW   .8
        BTFSC   STATUS,C

 GOTO    MAIN
        CLRF    CB
;********************************************
MAIN
;********************************************
        CALL    XIANSHI             ;初次上電,顯示,輸出
        CALL    SHUCHU
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSS   IN1                 ;兩鍵都松開(kāi),
        GOTO    $-1
        BTFSS   IN2                 ;才能往下跳
        GOTO    $-4
MAI
;**********************************************
;;;;;;;;;;;刷新程序;;;;;;;;;;;;;
        INCF    SHUA
        MOVF    SHUA,W
        XORLW   0FFH
        BTFSS   STATUS,Z
        GOTO    PPP
        CLRF    SHUA
        INCF    SHUA1
        MOVF    SHUA1,W
        XORLW   010H
        BTFSS   STATUS,Z
        GOTO    PPP

 CLRF    SHUA
        CLRF    SHUA1
        CALL    XIANSHI
        CALL    SHUCHU
PPP
;*********************************************
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSC   IN1       ;檢測(cè)加一鍵是否按下?
        GOTO    DEC       ;否,轉(zhuǎn)去減一鍵檢測(cè)
        CALL    DELAY     ;去抖動(dòng)
        BTFSC   IN1
        GOTO    DEC

  MOVF    CB,W
        XORLW   .8
        BTFSS   STATUS,Z
        GOTO    

有關(guān)PIC12F629

點(diǎn)擊次數(shù):276次        更新時(shí)間:2017-12-23

PIC12F629
;1.Master Clear Enable 此項(xiàng)為MCLR<4>選項(xiàng)
;  internal:內(nèi)部自控  External:外部控制
;2.Oscillator:可設(shè)內(nèi)部,外部震蕩<internal,external>
;  如果選NO Clock3腳作I/O口用,否則3腳作CLKOUT
;***********************************
      include
        P1      EQU    2CH
        P2      EQU    2DH
        Y1      EQU    20H          ;Y1,Y2為去抖
        Y2      EQU    21H          ;動(dòng)延時(shí)寄存器
        ADDR    EQU    23H          ;EEPROM地址寄存器
        DATE1   EQU    24H          ;EEPROM數(shù)據(jù)寄存器
        BIT     EQU    25H
        BIT1    EQU    26H
        TUMP    EQU    27H
        TUMP1   EQU    28H
        CB      EQU    29H          ;顯示輸出公用查表量
        SHUA    EQU    2AH          ;刷新用
        SHUA1   EQU    2BH          ;刷新用
        AB      EQU    .1           ;顯示數(shù)據(jù)
        CLK     EQU    .2           ;顯示時(shí)鐘
        AB1     EQU    .4           ;輸出數(shù)據(jù)
        CLK1    EQU    .0           ;輸出時(shí)鐘
        #DEFINE       IN1  GPIO,3   ;按鍵加

  #DEFINE       IN2  GPIO,5   ;按鍵減
        ORG     0000H
        NOP
        BSF     STATUS,RP0
        MOVLW   B’00101000’         ;設(shè)GP5,GP3為輸入
        MOVWF   TRISIO
        BCF     OPTION_REG,7        ;設(shè)GP5弱上拉
        BSF     WPU,5
        MOVLW   0FFH
        MOVWF   OSCCAL              ;設(shè)頻率最好
        BCF     STATUS,RP0
        MOVLW   00H
        MOVWF   ADDR                ;訪問(wèn)EEPROM00H
        CALL    READ                ;EEPROM
        MOVWF   CB
        MOVF    CB,W
        SUBLW   .8
        BTFSC   STATUS,C

 GOTO    MAIN
        CLRF    CB
;********************************************
MAIN
;********************************************
        CALL    XIANSHI             ;初次上電,顯示,輸出
        CALL    SHUCHU
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSS   IN1                 ;兩鍵都松開(kāi),
        GOTO    $-1
        BTFSS   IN2                 ;才能往下跳
        GOTO    $-4
MAI
;**********************************************
;;;;;;;;;;;刷新程序;;;;;;;;;;;;;
        INCF    SHUA
        MOVF    SHUA,W
        XORLW   0FFH
        BTFSS   STATUS,Z
        GOTO    PPP
        CLRF    SHUA
        INCF    SHUA1
        MOVF    SHUA1,W
        XORLW   010H
        BTFSS   STATUS,Z
        GOTO    PPP

 CLRF    SHUA
        CLRF    SHUA1
        CALL    XIANSHI
        CALL    SHUCHU
PPP
;*********************************************
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSC   IN1       ;檢測(cè)加一鍵是否按下?
        GOTO    DEC       ;否,轉(zhuǎn)去減一鍵檢測(cè)
        CALL    DELAY     ;去抖動(dòng)
        BTFSC   IN1
        GOTO    DEC

  MOVF    CB,W
        XORLW   .8
        BTFSS   STATUS,Z
        GOTO    

有關(guān)PIC12F629

點(diǎn)擊次數(shù):276次        更新時(shí)間:2017-12-23

PIC12F629
;1.Master Clear Enable 此項(xiàng)為MCLR<4>選項(xiàng)
;  internal:內(nèi)部自控  External:外部控制
;2.Oscillator:可設(shè)內(nèi)部,外部震蕩<internal,external>
;  如果選NO Clock3腳作I/O口用,否則3腳作CLKOUT
;***********************************
      include
        P1      EQU    2CH
        P2      EQU    2DH
        Y1      EQU    20H          ;Y1,Y2為去抖
        Y2      EQU    21H          ;動(dòng)延時(shí)寄存器
        ADDR    EQU    23H          ;EEPROM地址寄存器
        DATE1   EQU    24H          ;EEPROM數(shù)據(jù)寄存器
        BIT     EQU    25H
        BIT1    EQU    26H
        TUMP    EQU    27H
        TUMP1   EQU    28H
        CB      EQU    29H          ;顯示輸出公用查表量
        SHUA    EQU    2AH          ;刷新用
        SHUA1   EQU    2BH          ;刷新用
        AB      EQU    .1           ;顯示數(shù)據(jù)
        CLK     EQU    .2           ;顯示時(shí)鐘
        AB1     EQU    .4           ;輸出數(shù)據(jù)
        CLK1    EQU    .0           ;輸出時(shí)鐘
        #DEFINE       IN1  GPIO,3   ;按鍵加

  #DEFINE       IN2  GPIO,5   ;按鍵減
        ORG     0000H
        NOP
        BSF     STATUS,RP0
        MOVLW   B’00101000’         ;設(shè)GP5,GP3為輸入
        MOVWF   TRISIO
        BCF     OPTION_REG,7        ;設(shè)GP5弱上拉
        BSF     WPU,5
        MOVLW   0FFH
        MOVWF   OSCCAL              ;設(shè)頻率最好
        BCF     STATUS,RP0
        MOVLW   00H
        MOVWF   ADDR                ;訪問(wèn)EEPROM00H
        CALL    READ                ;EEPROM
        MOVWF   CB
        MOVF    CB,W
        SUBLW   .8
        BTFSC   STATUS,C

 GOTO    MAIN
        CLRF    CB
;********************************************
MAIN
;********************************************
        CALL    XIANSHI             ;初次上電,顯示,輸出
        CALL    SHUCHU
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSS   IN1                 ;兩鍵都松開(kāi),
        GOTO    $-1
        BTFSS   IN2                 ;才能往下跳
        GOTO    $-4
MAI
;**********************************************
;;;;;;;;;;;刷新程序;;;;;;;;;;;;;
        INCF    SHUA
        MOVF    SHUA,W
        XORLW   0FFH
        BTFSS   STATUS,Z
        GOTO    PPP
        CLRF    SHUA
        INCF    SHUA1
        MOVF    SHUA1,W
        XORLW   010H
        BTFSS   STATUS,Z
        GOTO    PPP

 CLRF    SHUA
        CLRF    SHUA1
        CALL    XIANSHI
        CALL    SHUCHU
PPP
;*********************************************
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSC   IN1       ;檢測(cè)加一鍵是否按下?
        GOTO    DEC       ;否,轉(zhuǎn)去減一鍵檢測(cè)
        CALL    DELAY     ;去抖動(dòng)
        BTFSC   IN1
        GOTO    DEC

  MOVF    CB,W
        XORLW   .8
        BTFSS   STATUS,Z
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}6
        CLRF    CB
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
        INCF    CB           ;對(duì)查表量加一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN1
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
DEC     MOVF    CB,W
        XORLW   .0
        BTFSS   STATUS,Z      ;是否減到0?
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}2           ;否,轉(zhuǎn)去減一鍵檢測(cè)
        GOTO    MAI           ;是,不再減一
        BTFSC   IN2           ;減一鍵檢測(cè)
        GOTO    MAI
        CALL    DELAY         ;去抖動(dòng)
        BTFSC   IN2

 GOTO    MAI
        DECF    CB            ;對(duì)查表量減一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN2
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
;***************************************
DELAY;去抖動(dòng)延時(shí)程序
        MOVLW   0FFH
        MOVWF   Y1
M2      MOVLW   06FH
        MOVWF   Y2
M1      DECFSZ  Y2

 GOTO    M1
        DECFSZ  Y1
        GOTO    M2
        RETURN
;**************************************
DELAY1  MOVLW   0FFH
        MOVWF   P1
Q2
        MOVLW   0FFH
        MOVWF   P2
Q1
        DECFSZ  P2
        GOTO    Q1
        DECFSZ  P1
        GOTO    Q2
        RETURN
;**************************************
XIANSHI;數(shù)碼管顯示
        MOVF    CB,W
        CALL    SHUMA
        MOVWF   TUMP
        MOVLW   .8
        MOVWF   BIT
LOOP    BCF     GPIO,CLK
        BTFSC   TUMP,0
        BSF     GPIO,AB
        BTFSS   TUMP,0
        BCF     GPIO,AB
        RRF     TUMP,F
        BSF     GPIO,CLK
        DECFSZ  BIT
        GOTO    LOOP
        RETURN
;**************************************

SHUCHU;輸出處理
        MOVF    CB,W
        CALL    CHU
        MOVWF   TUMP1
        MOVLW   .8
        MOVWF   BIT1
LOOP1   BCF     GPIO,CLK1
        BTFSC   TUMP1,0
        BSF     GPIO,AB1
        BTFSS   TUMP1,0
        BCF     GPIO,AB1
        RRF     TUMP1,F
        BSF     GPIO,CLK1
        DECFSZ  BIT1
        GOTO    LOOP1
        RETURN
;**************************************
SHUMA;數(shù)碼管顯示碼
       ADDWF   2,1
       RETLW   001H
       RETLW   037H
       RETLW   042H
       RETLW   012H
       RETLW   034H
       RETLW   018H
       RETLW   008H
       RETLW   033H
       RETLW   000H
;*************************************

CHU   ;輸出子程序
      ADDWF   2,1
      RETLW   B’11111111’
      RETLW   B’11111110’
      RETLW   B’11111101’
      RETLW   B’11111011’
      RETLW   B’11110111’
      RETLW   B’11101111’
      RETLW   B’11011111’
      RETLW   B’10111111’
      RETLW   B’01111111’
;*************************************
;        EEPROM讀寫(xiě)程序
;*************************************
READ    BSF     STATUS,RP0
        MOVF    ADDR,W
        MOVWF   EEADR
        BSF     EECON1,RD
        MOVF    EEDATA,W
        RETURN
;*************************************
WRITE
        BSF     STATUS,RP0
        BTFSC   EECON1,WR
        GOTO    $-1

   MOVF    ADDR,W
        MOVWF   EEADR
        MOVF    DATE1,W
        MOVWF   EEDATA
        BSF     EECON1,WREN
        MOVLW   55H
        MOVWF   EECON2
        MOVLW   0AAH
        MOVWF   EECON2
        BSF     EECON1,WR
        BCF     EECON1,WREN
        BCF     STATUS,RP0
        RETURN
;**************************************
        END

 


6
        CLRF    CB
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
        INCF    CB           ;對(duì)查表量加一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN1
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
DEC     MOVF    CB,W
        XORLW   .0
        BTFSS   STATUS,Z      ;是否減到0?
        GOTO    

有關(guān)PIC12F629

點(diǎn)擊次數(shù):276次        更新時(shí)間:2017-12-23

PIC12F629
;1.Master Clear Enable 此項(xiàng)為MCLR<4>選項(xiàng)
;  internal:內(nèi)部自控  External:外部控制
;2.Oscillator:可設(shè)內(nèi)部,外部震蕩<internal,external>
;  如果選NO Clock3腳作I/O口用,否則3腳作CLKOUT
;***********************************
      include
        P1      EQU    2CH
        P2      EQU    2DH
        Y1      EQU    20H          ;Y1,Y2為去抖
        Y2      EQU    21H          ;動(dòng)延時(shí)寄存器
        ADDR    EQU    23H          ;EEPROM地址寄存器
        DATE1   EQU    24H          ;EEPROM數(shù)據(jù)寄存器
        BIT     EQU    25H
        BIT1    EQU    26H
        TUMP    EQU    27H
        TUMP1   EQU    28H
        CB      EQU    29H          ;顯示輸出公用查表量
        SHUA    EQU    2AH          ;刷新用
        SHUA1   EQU    2BH          ;刷新用
        AB      EQU    .1           ;顯示數(shù)據(jù)
        CLK     EQU    .2           ;顯示時(shí)鐘
        AB1     EQU    .4           ;輸出數(shù)據(jù)
        CLK1    EQU    .0           ;輸出時(shí)鐘
        #DEFINE       IN1  GPIO,3   ;按鍵加

  #DEFINE       IN2  GPIO,5   ;按鍵減
        ORG     0000H
        NOP
        BSF     STATUS,RP0
        MOVLW   B’00101000’         ;設(shè)GP5,GP3為輸入
        MOVWF   TRISIO
        BCF     OPTION_REG,7        ;設(shè)GP5弱上拉
        BSF     WPU,5
        MOVLW   0FFH
        MOVWF   OSCCAL              ;設(shè)頻率最好
        BCF     STATUS,RP0
        MOVLW   00H
        MOVWF   ADDR                ;訪問(wèn)EEPROM00H
        CALL    READ                ;EEPROM
        MOVWF   CB
        MOVF    CB,W
        SUBLW   .8
        BTFSC   STATUS,C

 GOTO    MAIN
        CLRF    CB
;********************************************
MAIN
;********************************************
        CALL    XIANSHI             ;初次上電,顯示,輸出
        CALL    SHUCHU
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSS   IN1                 ;兩鍵都松開(kāi),
        GOTO    $-1
        BTFSS   IN2                 ;才能往下跳
        GOTO    $-4
MAI
;**********************************************
;;;;;;;;;;;刷新程序;;;;;;;;;;;;;
        INCF    SHUA
        MOVF    SHUA,W
        XORLW   0FFH
        BTFSS   STATUS,Z
        GOTO    PPP
        CLRF    SHUA
        INCF    SHUA1
        MOVF    SHUA1,W
        XORLW   010H
        BTFSS   STATUS,Z
        GOTO    PPP

 CLRF    SHUA
        CLRF    SHUA1
        CALL    XIANSHI
        CALL    SHUCHU
PPP
;*********************************************
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSC   IN1       ;檢測(cè)加一鍵是否按下?
        GOTO    DEC       ;否,轉(zhuǎn)去減一鍵檢測(cè)
        CALL    DELAY     ;去抖動(dòng)
        BTFSC   IN1
        GOTO    DEC

  MOVF    CB,W
        XORLW   .8
        BTFSS   STATUS,Z
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}6
        CLRF    CB
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
        INCF    CB           ;對(duì)查表量加一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN1
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
DEC     MOVF    CB,W
        XORLW   .0
        BTFSS   STATUS,Z      ;是否減到0?
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}2           ;否,轉(zhuǎn)去減一鍵檢測(cè)
        GOTO    MAI           ;是,不再減一
        BTFSC   IN2           ;減一鍵檢測(cè)
        GOTO    MAI
        CALL    DELAY         ;去抖動(dòng)
        BTFSC   IN2

 GOTO    MAI
        DECF    CB            ;對(duì)查表量減一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN2
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
;***************************************
DELAY;去抖動(dòng)延時(shí)程序
        MOVLW   0FFH
        MOVWF   Y1
M2      MOVLW   06FH
        MOVWF   Y2
M1      DECFSZ  Y2

 GOTO    M1
        DECFSZ  Y1
        GOTO    M2
        RETURN
;**************************************
DELAY1  MOVLW   0FFH
        MOVWF   P1
Q2
        MOVLW   0FFH
        MOVWF   P2
Q1
        DECFSZ  P2
        GOTO    Q1
        DECFSZ  P1
        GOTO    Q2
        RETURN
;**************************************
XIANSHI;數(shù)碼管顯示
        MOVF    CB,W
        CALL    SHUMA
        MOVWF   TUMP
        MOVLW   .8
        MOVWF   BIT
LOOP    BCF     GPIO,CLK
        BTFSC   TUMP,0
        BSF     GPIO,AB
        BTFSS   TUMP,0
        BCF     GPIO,AB
        RRF     TUMP,F
        BSF     GPIO,CLK
        DECFSZ  BIT
        GOTO    LOOP
        RETURN
;**************************************

SHUCHU;輸出處理
        MOVF    CB,W
        CALL    CHU
        MOVWF   TUMP1
        MOVLW   .8
        MOVWF   BIT1
LOOP1   BCF     GPIO,CLK1
        BTFSC   TUMP1,0
        BSF     GPIO,AB1
        BTFSS   TUMP1,0
        BCF     GPIO,AB1
        RRF     TUMP1,F
        BSF     GPIO,CLK1
        DECFSZ  BIT1
        GOTO    LOOP1
        RETURN
;**************************************
SHUMA;數(shù)碼管顯示碼
       ADDWF   2,1
       RETLW   001H
       RETLW   037H
       RETLW   042H
       RETLW   012H
       RETLW   034H
       RETLW   018H
       RETLW   008H
       RETLW   033H
       RETLW   000H
;*************************************

CHU   ;輸出子程序
      ADDWF   2,1
      RETLW   B’11111111’
      RETLW   B’11111110’
      RETLW   B’11111101’
      RETLW   B’11111011’
      RETLW   B’11110111’
      RETLW   B’11101111’
      RETLW   B’11011111’
      RETLW   B’10111111’
      RETLW   B’01111111’
;*************************************
;        EEPROM讀寫(xiě)程序
;*************************************
READ    BSF     STATUS,RP0
        MOVF    ADDR,W
        MOVWF   EEADR
        BSF     EECON1,RD
        MOVF    EEDATA,W
        RETURN
;*************************************
WRITE
        BSF     STATUS,RP0
        BTFSC   EECON1,WR
        GOTO    $-1

   MOVF    ADDR,W
        MOVWF   EEADR
        MOVF    DATE1,W
        MOVWF   EEDATA
        BSF     EECON1,WREN
        MOVLW   55H
        MOVWF   EECON2
        MOVLW   0AAH
        MOVWF   EECON2
        BSF     EECON1,WR
        BCF     EECON1,WREN
        BCF     STATUS,RP0
        RETURN
;**************************************
        END

 


2           ;否,轉(zhuǎn)去減一鍵檢測(cè)
        GOTO    MAI           ;是,不再減一
        BTFSC   IN2           ;減一鍵檢測(cè)
        GOTO    MAI
        CALL    DELAY         ;去抖動(dòng)
        BTFSC   IN2

 GOTO    MAI
        DECF    CB            ;對(duì)查表量減一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN2
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
;***************************************
DELAY;去抖動(dòng)延時(shí)程序
        MOVLW   0FFH
        MOVWF   Y1
M2      MOVLW   06FH
        MOVWF   Y2
M1      DECFSZ  Y2

 GOTO    M1
        DECFSZ  Y1
        GOTO    M2
        RETURN
;**************************************
DELAY1  MOVLW   0FFH
        MOVWF   P1
Q2
        MOVLW   0FFH
        MOVWF   P2
Q1
        DECFSZ  P2
        GOTO    Q1
        DECFSZ  P1
        GOTO    Q2
        RETURN
;**************************************
XIANSHI;數(shù)碼管顯示
        MOVF    CB,W
        CALL    SHUMA
        MOVWF   TUMP
        MOVLW   .8
        MOVWF   BIT
LOOP    BCF     GPIO,CLK
        BTFSC   TUMP,0
        BSF     GPIO,AB
        BTFSS   TUMP,0
        BCF     GPIO,AB
        RRF     TUMP,F
        BSF     GPIO,CLK
        DECFSZ  BIT
        GOTO    LOOP
        RETURN
;**************************************

SHUCHU;輸出處理
        MOVF    CB,W
        CALL    CHU
        MOVWF   TUMP1
        MOVLW   .8
        MOVWF   BIT1
LOOP1   BCF     GPIO,CLK1
        BTFSC   TUMP1,0
        BSF     GPIO,AB1
        BTFSS   TUMP1,0
        BCF     GPIO,AB1
        RRF     TUMP1,F
        BSF     GPIO,CLK1
        DECFSZ  BIT1
        GOTO    LOOP1
        RETURN
;**************************************
SHUMA;數(shù)碼管顯示碼
       ADDWF   2,1
       RETLW   001H
       RETLW   037H
       RETLW   042H
       RETLW   012H
       RETLW   034H
       RETLW   018H
       RETLW   008H
       RETLW   033H
       RETLW   000H
;*************************************

CHU   ;輸出子程序
      ADDWF   2,1
      RETLW   B’11111111’
      RETLW   B’11111110’
      RETLW   B’11111101’
      RETLW   B’11111011’
      RETLW   B’11110111’
      RETLW   B’11101111’
      RETLW   B’11011111’
      RETLW   B’10111111’
      RETLW   B’01111111’
;*************************************
;        EEPROM讀寫(xiě)程序
;*************************************
READ    BSF     STATUS,RP0
        MOVF    ADDR,W
        MOVWF   EEADR
        BSF     EECON1,RD
        MOVF    EEDATA,W
        RETURN
;*************************************
WRITE
        BSF     STATUS,RP0
        BTFSC   EECON1,WR
        GOTO    $-1

   MOVF    ADDR,W
        MOVWF   EEADR
        MOVF    DATE1,W
        MOVWF   EEDATA
        BSF     EECON1,WREN
        MOVLW   55H
        MOVWF   EECON2
        MOVLW   0AAH
        MOVWF   EECON2
        BSF     EECON1,WR
        BCF     EECON1,WREN
        BCF     STATUS,RP0
        RETURN
;**************************************
        END

 


6
        CLRF    CB
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
        INCF    CB           ;對(duì)查表量加一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN1
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
DEC     MOVF    CB,W
        XORLW   .0
        BTFSS   STATUS,Z      ;是否減到0
        GOTO    

有關(guān)PIC12F629

點(diǎn)擊次數(shù):276次        更新時(shí)間:2017-12-23

PIC12F629
;1.Master Clear Enable 此項(xiàng)為MCLR<4>選項(xiàng)
;  internal:內(nèi)部自控  External:外部控制
;2.Oscillator:可設(shè)內(nèi)部,外部震蕩<internal,external>
;  如果選NO Clock3腳作I/O口用,否則3腳作CLKOUT
;***********************************
      include
        P1      EQU    2CH
        P2      EQU    2DH
        Y1      EQU    20H          ;Y1,Y2為去抖
        Y2      EQU    21H          ;動(dòng)延時(shí)寄存器
        ADDR    EQU    23H          ;EEPROM地址寄存器
        DATE1   EQU    24H          ;EEPROM數(shù)據(jù)寄存器
        BIT     EQU    25H
        BIT1    EQU    26H
        TUMP    EQU    27H
        TUMP1   EQU    28H
        CB      EQU    29H          ;顯示輸出公用查表量
        SHUA    EQU    2AH          ;刷新用
        SHUA1   EQU    2BH          ;刷新用
        AB      EQU    .1           ;顯示數(shù)據(jù)
        CLK     EQU    .2           ;顯示時(shí)鐘
        AB1     EQU    .4           ;輸出數(shù)據(jù)
        CLK1    EQU    .0           ;輸出時(shí)鐘
        #DEFINE       IN1  GPIO,3   ;按鍵加

  #DEFINE       IN2  GPIO,5   ;按鍵減
        ORG     0000H
        NOP
        BSF     STATUS,RP0
        MOVLW   B’00101000’         ;設(shè)GP5,GP3為輸入
        MOVWF   TRISIO
        BCF     OPTION_REG,7        ;設(shè)GP5弱上拉
        BSF     WPU,5
        MOVLW   0FFH
        MOVWF   OSCCAL              ;設(shè)頻率最好
        BCF     STATUS,RP0
        MOVLW   00H
        MOVWF   ADDR                ;訪問(wèn)EEPROM00H
        CALL    READ                ;EEPROM
        MOVWF   CB
        MOVF    CB,W
        SUBLW   .8
        BTFSC   STATUS,C

 GOTO    MAIN
        CLRF    CB
;********************************************
MAIN
;********************************************
        CALL    XIANSHI             ;初次上電,顯示,輸出
        CALL    SHUCHU
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSS   IN1                 ;兩鍵都松開(kāi),
        GOTO    $-1
        BTFSS   IN2                 ;才能往下跳
        GOTO    $-4
MAI
;**********************************************
;;;;;;;;;;;刷新程序;;;;;;;;;;;;;
        INCF    SHUA
        MOVF    SHUA,W
        XORLW   0FFH
        BTFSS   STATUS,Z
        GOTO    PPP
        CLRF    SHUA
        INCF    SHUA1
        MOVF    SHUA1,W
        XORLW   010H
        BTFSS   STATUS,Z
        GOTO    PPP

 CLRF    SHUA
        CLRF    SHUA1
        CALL    XIANSHI
        CALL    SHUCHU
PPP
;*********************************************
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSC   IN1       ;檢測(cè)加一鍵是否按下?
        GOTO    DEC       ;否,轉(zhuǎn)去減一鍵檢測(cè)
        CALL    DELAY     ;去抖動(dòng)
        BTFSC   IN1
        GOTO    DEC

  MOVF    CB,W
        XORLW   .8
        BTFSS   STATUS,Z
        GOTO    

有關(guān)PIC12F629

點(diǎn)擊次數(shù):276次        更新時(shí)間:2017-12-23

PIC12F629
;1.Master Clear Enable 此項(xiàng)為MCLR<4>選項(xiàng)
;  internal:內(nèi)部自控  External:外部控制
;2.Oscillator:可設(shè)內(nèi)部,外部震蕩<internal,external>
;  如果選NO Clock3腳作I/O口用,否則3腳作CLKOUT
;***********************************
      include
        P1      EQU    2CH
        P2      EQU    2DH
        Y1      EQU    20H          ;Y1,Y2為去抖
        Y2      EQU    21H          ;動(dòng)延時(shí)寄存器
        ADDR    EQU    23H          ;EEPROM地址寄存器
        DATE1   EQU    24H          ;EEPROM數(shù)據(jù)寄存器
        BIT     EQU    25H
        BIT1    EQU    26H
        TUMP    EQU    27H
        TUMP1   EQU    28H
        CB      EQU    29H          ;顯示輸出公用查表量
        SHUA    EQU    2AH          ;刷新用
        SHUA1   EQU    2BH          ;刷新用
        AB      EQU    .1           ;顯示數(shù)據(jù)
        CLK     EQU    .2           ;顯示時(shí)鐘
        AB1     EQU    .4           ;輸出數(shù)據(jù)
        CLK1    EQU    .0           ;輸出時(shí)鐘
        #DEFINE       IN1  GPIO,3   ;按鍵加

  #DEFINE       IN2  GPIO,5   ;按鍵減
        ORG     0000H
        NOP
        BSF     STATUS,RP0
        MOVLW   B’00101000’         ;設(shè)GP5,GP3為輸入
        MOVWF   TRISIO
        BCF     OPTION_REG,7        ;設(shè)GP5弱上拉
        BSF     WPU,5
        MOVLW   0FFH
        MOVWF   OSCCAL              ;設(shè)頻率最好
        BCF     STATUS,RP0
        MOVLW   00H
        MOVWF   ADDR                ;訪問(wèn)EEPROM00H
        CALL    READ                ;EEPROM
        MOVWF   CB
        MOVF    CB,W
        SUBLW   .8
        BTFSC   STATUS,C

 GOTO    MAIN
        CLRF    CB
;********************************************
MAIN
;********************************************
        CALL    XIANSHI             ;初次上電,顯示,輸出
        CALL    SHUCHU
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSS   IN1                 ;兩鍵都松開(kāi),
        GOTO    $-1
        BTFSS   IN2                 ;才能往下跳
        GOTO    $-4
MAI
;**********************************************
;;;;;;;;;;;刷新程序;;;;;;;;;;;;;
        INCF    SHUA
        MOVF    SHUA,W
        XORLW   0FFH
        BTFSS   STATUS,Z
        GOTO    PPP
        CLRF    SHUA
        INCF    SHUA1
        MOVF    SHUA1,W
        XORLW   010H
        BTFSS   STATUS,Z
        GOTO    PPP

 CLRF    SHUA
        CLRF    SHUA1
        CALL    XIANSHI
        CALL    SHUCHU
PPP
;*********************************************
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSC   IN1       ;檢測(cè)加一鍵是否按下?
        GOTO    DEC       ;否,轉(zhuǎn)去減一鍵檢測(cè)
        CALL    DELAY     ;去抖動(dòng)
        BTFSC   IN1
        GOTO    DEC

  MOVF    CB,W
        XORLW   .8
        BTFSS   STATUS,Z
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}6
        CLRF    CB
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
        INCF    CB           ;對(duì)查表量加一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN1
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
DEC     MOVF    CB,W
        XORLW   .0
        BTFSS   STATUS,Z      ;是否減到0?
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}2           ;否,轉(zhuǎn)去減一鍵檢測(cè)
        GOTO    MAI           ;是,不再減一
        BTFSC   IN2           ;減一鍵檢測(cè)
        GOTO    MAI
        CALL    DELAY         ;去抖動(dòng)
        BTFSC   IN2

 GOTO    MAI
        DECF    CB            ;對(duì)查表量減一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN2
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
;***************************************
DELAY;去抖動(dòng)延時(shí)程序
        MOVLW   0FFH
        MOVWF   Y1
M2      MOVLW   06FH
        MOVWF   Y2
M1      DECFSZ  Y2

 GOTO    M1
        DECFSZ  Y1
        GOTO    M2
        RETURN
;**************************************
DELAY1  MOVLW   0FFH
        MOVWF   P1
Q2
        MOVLW   0FFH
        MOVWF   P2
Q1
        DECFSZ  P2
        GOTO    Q1
        DECFSZ  P1
        GOTO    Q2
        RETURN
;**************************************
XIANSHI;數(shù)碼管顯示
        MOVF    CB,W
        CALL    SHUMA
        MOVWF   TUMP
        MOVLW   .8
        MOVWF   BIT
LOOP    BCF     GPIO,CLK
        BTFSC   TUMP,0
        BSF     GPIO,AB
        BTFSS   TUMP,0
        BCF     GPIO,AB
        RRF     TUMP,F
        BSF     GPIO,CLK
        DECFSZ  BIT
        GOTO    LOOP
        RETURN
;**************************************

SHUCHU;輸出處理
        MOVF    CB,W
        CALL    CHU
        MOVWF   TUMP1
        MOVLW   .8
        MOVWF   BIT1
LOOP1   BCF     GPIO,CLK1
        BTFSC   TUMP1,0
        BSF     GPIO,AB1
        BTFSS   TUMP1,0
        BCF     GPIO,AB1
        RRF     TUMP1,F
        BSF     GPIO,CLK1
        DECFSZ  BIT1
        GOTO    LOOP1
        RETURN
;**************************************
SHUMA;數(shù)碼管顯示碼
       ADDWF   2,1
       RETLW   001H
       RETLW   037H
       RETLW   042H
       RETLW   012H
       RETLW   034H
       RETLW   018H
       RETLW   008H
       RETLW   033H
       RETLW   000H
;*************************************

CHU   ;輸出子程序
      ADDWF   2,1
      RETLW   B’11111111’
      RETLW   B’11111110’
      RETLW   B’11111101’
      RETLW   B’11111011’
      RETLW   B’11110111’
      RETLW   B’11101111’
      RETLW   B’11011111’
      RETLW   B’10111111’
      RETLW   B’01111111’
;*************************************
;        EEPROM讀寫(xiě)程序
;*************************************
READ    BSF     STATUS,RP0
        MOVF    ADDR,W
        MOVWF   EEADR
        BSF     EECON1,RD
        MOVF    EEDATA,W
        RETURN
;*************************************
WRITE
        BSF     STATUS,RP0
        BTFSC   EECON1,WR
        GOTO    $-1

   MOVF    ADDR,W
        MOVWF   EEADR
        MOVF    DATE1,W
        MOVWF   EEDATA
        BSF     EECON1,WREN
        MOVLW   55H
        MOVWF   EECON2
        MOVLW   0AAH
        MOVWF   EECON2
        BSF     EECON1,WR
        BCF     EECON1,WREN
        BCF     STATUS,RP0
        RETURN
;**************************************
        END

 


6
        CLRF    CB
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
        INCF    CB           ;對(duì)查表量加一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN1
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
DEC     MOVF    CB,W
        XORLW   .0
        BTFSS   STATUS,Z      ;是否減到0?
        GOTO    

有關(guān)PIC12F629

點(diǎn)擊次數(shù):276次        更新時(shí)間:2017-12-23

PIC12F629
;1.Master Clear Enable 此項(xiàng)為MCLR<4>選項(xiàng)
;  internal:內(nèi)部自控  External:外部控制
;2.Oscillator:可設(shè)內(nèi)部,外部震蕩<internal,external>
;  如果選NO Clock3腳作I/O口用,否則3腳作CLKOUT
;***********************************
      include
        P1      EQU    2CH
        P2      EQU    2DH
        Y1      EQU    20H          ;Y1,Y2為去抖
        Y2      EQU    21H          ;動(dòng)延時(shí)寄存器
        ADDR    EQU    23H          ;EEPROM地址寄存器
        DATE1   EQU    24H          ;EEPROM數(shù)據(jù)寄存器
        BIT     EQU    25H
        BIT1    EQU    26H
        TUMP    EQU    27H
        TUMP1   EQU    28H
        CB      EQU    29H          ;顯示輸出公用查表量
        SHUA    EQU    2AH          ;刷新用
        SHUA1   EQU    2BH          ;刷新用
        AB      EQU    .1           ;顯示數(shù)據(jù)
        CLK     EQU    .2           ;顯示時(shí)鐘
        AB1     EQU    .4           ;輸出數(shù)據(jù)
        CLK1    EQU    .0           ;輸出時(shí)鐘
        #DEFINE       IN1  GPIO,3   ;按鍵加

  #DEFINE       IN2  GPIO,5   ;按鍵減
        ORG     0000H
        NOP
        BSF     STATUS,RP0
        MOVLW   B’00101000’         ;設(shè)GP5,GP3為輸入
        MOVWF   TRISIO
        BCF     OPTION_REG,7        ;設(shè)GP5弱上拉
        BSF     WPU,5
        MOVLW   0FFH
        MOVWF   OSCCAL              ;設(shè)頻率最好
        BCF     STATUS,RP0
        MOVLW   00H
        MOVWF   ADDR                ;訪問(wèn)EEPROM00H
        CALL    READ                ;EEPROM
        MOVWF   CB
        MOVF    CB,W
        SUBLW   .8
        BTFSC   STATUS,C

 GOTO    MAIN
        CLRF    CB
;********************************************
MAIN
;********************************************
        CALL    XIANSHI             ;初次上電,顯示,輸出
        CALL    SHUCHU
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSS   IN1                 ;兩鍵都松開(kāi),
        GOTO    $-1
        BTFSS   IN2                 ;才能往下跳
        GOTO    $-4
MAI
;**********************************************
;;;;;;;;;;;刷新程序;;;;;;;;;;;;;
        INCF    SHUA
        MOVF    SHUA,W
        XORLW   0FFH
        BTFSS   STATUS,Z
        GOTO    PPP
        CLRF    SHUA
        INCF    SHUA1
        MOVF    SHUA1,W
        XORLW   010H
        BTFSS   STATUS,Z
        GOTO    PPP

 CLRF    SHUA
        CLRF    SHUA1
        CALL    XIANSHI
        CALL    SHUCHU
PPP
;*********************************************
        BSF     STATUS,RP0
        MOVLW   B’00101000’
        MOVWF   TRISIO
        BCF     STATUS,RP0
        BTFSC   IN1       ;檢測(cè)加一鍵是否按下?
        GOTO    DEC       ;否,轉(zhuǎn)去減一鍵檢測(cè)
        CALL    DELAY     ;去抖動(dòng)
        BTFSC   IN1
        GOTO    DEC

  MOVF    CB,W
        XORLW   .8
        BTFSS   STATUS,Z
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}6
        CLRF    CB
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
        INCF    CB           ;對(duì)查表量加一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN1
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
DEC     MOVF    CB,W
        XORLW   .0
        BTFSS   STATUS,Z      ;是否減到0
        GOTO    {D_L_技術(shù)支持_內(nèi)容瀏覽}2           ;否,轉(zhuǎn)去減一鍵檢測(cè)
        GOTO    MAI           ;是,不再減一
        BTFSC   IN2           ;減一鍵檢測(cè)
        GOTO    MAI
        CALL    DELAY         ;去抖動(dòng)
        BTFSC   IN2

 GOTO    MAI
        DECF    CB            ;對(duì)查表量減一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN2
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
;***************************************
DELAY;去抖動(dòng)延時(shí)程序
        MOVLW   0FFH
        MOVWF   Y1
M2      MOVLW   06FH
        MOVWF   Y2
M1      DECFSZ  Y2

 GOTO    M1
        DECFSZ  Y1
        GOTO    M2
        RETURN
;**************************************
DELAY1  MOVLW   0FFH
        MOVWF   P1
Q2
        MOVLW   0FFH
        MOVWF   P2
Q1
        DECFSZ  P2
        GOTO    Q1
        DECFSZ  P1
        GOTO    Q2
        RETURN
;**************************************
XIANSHI;數(shù)碼管顯示
        MOVF    CB,W
        CALL    SHUMA
        MOVWF   TUMP
        MOVLW   .8
        MOVWF   BIT
LOOP    BCF     GPIO,CLK
        BTFSC   TUMP,0
        BSF     GPIO,AB
        BTFSS   TUMP,0
        BCF     GPIO,AB
        RRF     TUMP,F
        BSF     GPIO,CLK
        DECFSZ  BIT
        GOTO    LOOP
        RETURN
;**************************************

SHUCHU;輸出處理
        MOVF    CB,W
        CALL    CHU
        MOVWF   TUMP1
        MOVLW   .8
        MOVWF   BIT1
LOOP1   BCF     GPIO,CLK1
        BTFSC   TUMP1,0
        BSF     GPIO,AB1
        BTFSS   TUMP1,0
        BCF     GPIO,AB1
        RRF     TUMP1,F
        BSF     GPIO,CLK1
        DECFSZ  BIT1
        GOTO    LOOP1
        RETURN
;**************************************
SHUMA;數(shù)碼管顯示碼
       ADDWF   2,1
       RETLW   001H
       RETLW   037H
       RETLW   042H
       RETLW   012H
       RETLW   034H
       RETLW   018H
       RETLW   008H
       RETLW   033H
       RETLW   000H
;*************************************

CHU   ;輸出子程序
      ADDWF   2,1
      RETLW   B’11111111’
      RETLW   B’11111110’
      RETLW   B’11111101’
      RETLW   B’11111011’
      RETLW   B’11110111’
      RETLW   B’11101111’
      RETLW   B’11011111’
      RETLW   B’10111111’
      RETLW   B’01111111’
;*************************************
;        EEPROM讀寫(xiě)程序
;*************************************
READ    BSF     STATUS,RP0
        MOVF    ADDR,W
        MOVWF   EEADR
        BSF     EECON1,RD
        MOVF    EEDATA,W
        RETURN
;*************************************
WRITE
        BSF     STATUS,RP0
        BTFSC   EECON1,WR
        GOTO    $-1

   MOVF    ADDR,W
        MOVWF   EEADR
        MOVF    DATE1,W
        MOVWF   EEDATA
        BSF     EECON1,WREN
        MOVLW   55H
        MOVWF   EECON2
        MOVLW   0AAH
        MOVWF   EECON2
        BSF     EECON1,WR
        BCF     EECON1,WREN
        BCF     STATUS,RP0
        RETURN
;**************************************
        END

 


2           ;否,轉(zhuǎn)去減一鍵檢測(cè)
        GOTO    MAI           ;是,不再減一
        BTFSC   IN2           ;減一鍵檢測(cè)
        GOTO    MAI
        CALL    DELAY         ;去抖動(dòng)
        BTFSC   IN2

 GOTO    MAI
        DECF    CB            ;對(duì)查表量減一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN2
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
;***************************************
DELAY;去抖動(dòng)延時(shí)程序
        MOVLW   0FFH
        MOVWF   Y1
M2      MOVLW   06FH
        MOVWF   Y2
M1      DECFSZ  Y2

 GOTO    M1
        DECFSZ  Y1
        GOTO    M2
        RETURN
;**************************************
DELAY1  MOVLW   0FFH
        MOVWF   P1
Q2
        MOVLW   0FFH
        MOVWF   P2
Q1
        DECFSZ  P2
        GOTO    Q1
        DECFSZ  P1
        GOTO    Q2
        RETURN
;**************************************
XIANSHI;數(shù)碼管顯示
        MOVF    CB,W
        CALL    SHUMA
        MOVWF   TUMP
        MOVLW   .8
        MOVWF   BIT
LOOP    BCF     GPIO,CLK
        BTFSC   TUMP,0
        BSF     GPIO,AB
        BTFSS   TUMP,0
        BCF     GPIO,AB
        RRF     TUMP,F
        BSF     GPIO,CLK
        DECFSZ  BIT
        GOTO    LOOP
        RETURN
;**************************************

SHUCHU;輸出處理
        MOVF    CB,W
        CALL    CHU
        MOVWF   TUMP1
        MOVLW   .8
        MOVWF   BIT1
LOOP1   BCF     GPIO,CLK1
        BTFSC   TUMP1,0
        BSF     GPIO,AB1
        BTFSS   TUMP1,0
        BCF     GPIO,AB1
        RRF     TUMP1,F
        BSF     GPIO,CLK1
        DECFSZ  BIT1
        GOTO    LOOP1
        RETURN
;**************************************
SHUMA;數(shù)碼管顯示碼
       ADDWF   2,1
       RETLW   001H
       RETLW   037H
       RETLW   042H
       RETLW   012H
       RETLW   034H
       RETLW   018H
       RETLW   008H
       RETLW   033H
       RETLW   000H
;*************************************

CHU   ;輸出子程序
      ADDWF   2,1
      RETLW   B’11111111’
      RETLW   B’11111110’
      RETLW   B’11111101’
      RETLW   B’11111011’
      RETLW   B’11110111’
      RETLW   B’11101111’
      RETLW   B’11011111’
      RETLW   B’10111111’
      RETLW   B’01111111’
;*************************************
;        EEPROM讀寫(xiě)程序
;*************************************
READ    BSF     STATUS,RP0
        MOVF    ADDR,W
        MOVWF   EEADR
        BSF     EECON1,RD
        MOVF    EEDATA,W
        RETURN
;*************************************
WRITE
        BSF     STATUS,RP0
        BTFSC   EECON1,WR
        GOTO    $-1

   MOVF    ADDR,W
        MOVWF   EEADR
        MOVF    DATE1,W
        MOVWF   EEDATA
        BSF     EECON1,WREN
        MOVLW   55H
        MOVWF   EECON2
        MOVLW   0AAH
        MOVWF   EECON2
        BSF     EECON1,WR
        BCF     EECON1,WREN
        BCF     STATUS,RP0
        RETURN
;**************************************
        END

 


2           ;否,轉(zhuǎn)去減一鍵檢測(cè)
        GOTO    MAI           ;是,不再減一
        BTFSC   IN2           ;減一鍵檢測(cè)
        GOTO    MAI
        CALL    DELAY         ;去抖動(dòng)
        BTFSC   IN2

 GOTO    MAI
        DECF    CB            ;對(duì)查表量減一
        CALL    XIANSHI
        CALL    SHUCHU
        BTFSS   IN2
        GOTO    $-1
        MOVF    CB,W
        MOVWF   DATE1
        CALL    WRITE
        GOTO    MAIN
;***************************************
DELAY;去抖動(dòng)延時(shí)程序
        MOVLW   0FFH
        MOVWF   Y1
M2      MOVLW   06FH
        MOVWF   Y2
M1      DECFSZ  Y2

 GOTO    M1
        DECFSZ  Y1
        GOTO    M2
        RETURN
;**************************************
DELAY1  MOVLW   0FFH
        MOVWF   P1
Q2
        MOVLW   0FFH
        MOVWF   P2
Q1
        DECFSZ  P2
        GOTO    Q1
        DECFSZ  P1
        GOTO    Q2
        RETURN
;**************************************
XIANSHI;數(shù)碼管顯示
        MOVF    CB,W
        CALL    SHUMA
        MOVWF   TUMP
        MOVLW   .8
        MOVWF   BIT
LOOP    BCF     GPIO,CLK
        BTFSC   TUMP,0
        BSF     GPIO,AB
        BTFSS   TUMP,0
        BCF     GPIO,AB
        RRF     TUMP,F
        BSF     GPIO,CLK
        DECFSZ  BIT
        GOTO    LOOP
        RETURN
;**************************************

SHUCHU;輸出處理
        MOVF    CB,W
        CALL    CHU
        MOVWF   TUMP1
        MOVLW   .8
        MOVWF   BIT1
LOOP1   BCF     GPIO,CLK1
        BTFSC   TUMP1,0
        BSF     GPIO,AB1
        BTFSS   TUMP1,0
        BCF     GPIO,AB1
        RRF     TUMP1,F
        BSF     GPIO,CLK1
        DECFSZ  BIT1
        GOTO    LOOP1
        RETURN
;**************************************
SHUMA;數(shù)碼管顯示碼
       ADDWF   2,1
       RETLW   001H
       RETLW   037H
       RETLW   042H
       RETLW   012H
       RETLW   034H
       RETLW   018H
       RETLW   008H
       RETLW   033H
       RETLW   000H
;*************************************

CHU   ;輸出子程序
      ADDWF   2,1
      RETLW   B’11111111’
      RETLW   B’11111110’
      RETLW   B’11111101’
      RETLW   B’11111011’
      RETLW   B’11110111’
      RETLW   B’11101111’
      RETLW   B’11011111’
      RETLW   B’10111111’
      RETLW   B’01111111’
;*************************************
;        EEPROM讀寫(xiě)程序
;*************************************
READ    BSF     STATUS,RP0
        MOVF    ADDR,W
        MOVWF   EEADR
        BSF     EECON1,RD
        MOVF    EEDATA,W
        RETURN
;*************************************
WRITE
        BSF     STATUS,RP0
        BTFSC   EECON1,WR
        GOTO    $-1

   MOVF    ADDR,W
        MOVWF   EEADR
        MOVF    DATE1,W
        MOVWF   EEDATA
        BSF     EECON1,WREN
        MOVLW   55H
        MOVWF   EECON2
        MOVLW   0AAH
        MOVWF   EECON2
        BSF     EECON1,WR
        BCF     EECON1,WREN
        BCF     STATUS,RP0
        RETURN
;**************************************
        END

 



404
返回首頁(yè) |  返回上一頁(yè)
木兰县| 曲沃县| 景德镇市| 宁明县| 永顺县| 沁水县| 辽源市| 沐川县| 瑞金市| 山丹县| 永城市| 桂阳县| 玛纳斯县| 彝良县| 蒲城县| 开鲁县| 长海县| 桦川县| 睢宁县| 浦县| 岳阳县| 磐石市| 道孚县| 榆林市| 敦煌市| 威海市| 英德市| 吴桥县| 白城市| 和顺县| 崇州市| 万源市| 奎屯市| 磴口县| 昔阳县| 布尔津县| 太白县| 晋城| 平舆县| 卢湾区| 武山县|