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

技術(shù)熱線(xiàn): 4007-888-234
設(shè)計(jì)開(kāi)發(fā)

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

開(kāi)發(fā)工具

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

技術(shù)支持

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

新品推廣

提供新的芯片及解決方案,提升客戶(hù)產(chǎn)品競(jìng)爭(zhēng)力

新聞中心

提供最新的單片機(jī)資訊,行業(yè)消息以及公司新聞動(dòng)態(tài)

PIC16F877單片機(jī) Boot-Loader 使用范例程式

更新時(shí)間: 2019-03-22
閱讀量:2309

單片機(jī)代理商深圳英銳恩分享PIC16F877單片機(jī) Boot-Loader 使用范例程式。

LIST P=16f877

    include


LoopVar1    EQU 0x20
LoopVar2    EQU 0x21

    org 0x100
    goto    Prog_Main

Vector
    org 0x104
    goto    ISRs

Delay
    clrf    LoopVar1
    clrf    LoopVar2
Delay2
    nop
    nop
    nop
    nop
    nop
    nop
    decfsz  LoopVar2,F
    goto    Delay2
    decfsz  LoopVar1,F
    goto    Delay2
    return  

ISRs                ;
    nop
    retfie
   end

boot877。。。。。。。。。。。。。。。。。。。。。。。。。。。

;************************************************
;* 876UART3.ASM                                 *

;************************************************

        list p=16f877
        #include
 
 
;********************************************************************

w_temp          EQU     0x71
status_temp     EQU     0x72
pclath_temp     EQU     0x73
USART_Ptr       EQU     0x74

Temp1           EQU     H'75'   ; The Registers for Boot Load !!
Temp2           EQU     H'76'
F_ADDRH         EQU     H'77'
F_ADDRL         EQU     H'78'
F_DATAH         EQU     H'79'
F_DATAL         EQU     H'7a'
F_Cntr          EQU     H'7b'
;************************************************************************ 

 ;***************************************************************************

 ORG 0X004
      
                movwf   w_temp            ; save off current W register contents
                movf    STATUS,w          ; move status register into W register
                movwf   status_temp       ; save off contents of STATUS register
                movf    PCLATH,W
                movwf   pclath_temp

  clrf PCLATH  ; !! Clear PCLATH , will set all Table to First 256 word !!

movlw   B'10101000'
        movwf   TXSTA

        bsf     PIE1,RCIE

        BANKSEL RCSTA
        movlw   B'10110000'
        movwf   RCSTA
       
        bcf     CTS_CTRL         ; Enable receive from PC
        bsf     INTCON,GIE
        bsf     INTCON,PEIE

        movlw   BUF_OF_RECEIVE
        movwf   FSR

 movlw   (OK_String-Wait_String)
        call    USART_Message

        goto    0x100

;*****************************************************************************************
;****   The Message Table contain the characters of each information !!
;***************************************************************************************** 

Msg_Table:
                addwf   PCL,F
Wait_String:    DT      "Ready",0x0d,0x0a
Unknow_String:  DT      "Unknow?",0x0d,0x0a
OK_String:      DT      "OK",0x0d,0x0a
Reset_String:   DT      "Reset",0x0d,0x0a
;*****************************************************************************************
;************   End of Message !!       **************************************************
;*****************************************************************************************

Boot_Main:
        
        bcf     INTCON,GIE ; Disable Receive Interrupt

        BANKSEL PIR1
Wait_HEX_Line:

btfss   PIR1,RCIF
        goto    Wait_HEX_Line
        movf    RCREG,W

        xorlw   ':'
        btfss   STATUS,Z
        goto    Wait_HEX_Line

        movlw   0xa0            ; Initial The Buffer Address !!
        movwf   FSR
        movlw   ':'
        movwf   INDF
        incf    FSR,F

Wait_RCIF2
        btfss   PIR1,RCIF
        goto    Wait_RCIF2
        movf    RCREG,W
 
        movwf   INDF
        incf    FSR,F
        xorlw   0x0d
        btfsc   STATUS,Z
        goto    Line_OK
        goto    Wait_RCIF2
 
;************************************************************************************

;****   For Intel HEX format
;****   :BBAAAATTHHHH ........HHCC
;****   Where   BB      the two digit Byte Number BB/2 is the total word of this line 
;****           AAAA    Address
;****           TT      Record Type
;****           HH      The Data
;****           CC      The Checksum of the data bytes of this line
;****           !!      Ignor the first 256 byte of .HEX file
;*************************************************************************************
Line_OK
        bsf     CTS_CTRL         ; Inhibit Transmit     
        movlw   0x0a
        movwf   INDF
       
        movlw   0xa1
        movwf   FSR

石泉县| 丹寨县| 南开区| 长寿区| 杂多县| 四会市| 辉县市| 石河子市| 新巴尔虎左旗| 景宁| 哈巴河县| 象山县| 崇仁县| 呼和浩特市| 德保县| 望谟县| 巍山| 贞丰县| 格尔木市| 开远市| 新野县| 井冈山市| 安塞县| 威海市| 自治县| 合山市| 洪雅县| 彭泽县| 三都| 永川市| 英德市| 高阳县| 曲麻莱县| 荔浦县| 青阳县| 淳化县| 荥经县| 龙州县| 毕节市| 永嘉县| 永寿县|