• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: RS232 接收端問題
#4
資深會員
資深會員


查看用戶資訊
嗯...如果不是清除RCIF的問題的話那我就不知道了
用 RETURN 對啦
因為一開始是用呼叫的
START:
CALL GET_DATA
所以最後用RETURN回去

發表於: 2006/3/17 15:17
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: RS232 接收端問題
#3
版主
版主


查看用戶資訊
goto GET_Rx 怎會用 return 回去呢? 這樣程式就當掉了,改成 goto GET_DATA

另外 RCIF 是無法直接清除的,只要去讀取 REREG 就會自動將 RCIF 清為 0

發表於: 2006/3/17 14:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: RS232 接收端問題
#2
資深會員
資深會員


查看用戶資訊
你接收完資料後沒有清除 PIR1,RCIF
所以要開始接收下一筆資料時
還沒接收完成你的程式就以為已經完成而執行 GET_RX
當然收不到第二筆資料

發表於: 2006/3/17 8:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


RS232 接收端問題
#1
高級會員
高級會員


查看用戶資訊
list p=16f877a
#include <p16f877A.inc>

TEMP    EQU    0X20

    ORG    0x00
    NOP

INITIAL
:
    
BANKSEL    TRISC
    BCF    TRISC
,6
    BSF    TRISC
,7
    MOVLW    .129
    MOVWF    SPBRG
    BANKSEL    TXSTA
    MOVLW    
B'00000100'
    
MOVWF    TXSTA
    BANKSEL    RCSTA
    BSF    RCSTA
,CREN
    BSF    RCSTA
,SPEN

START
:
    
CALL    GET_DATA
    NOP
    NOP
    
GOTO    START

GET_DATA
:
    
BANKSEL    PIR1
    BTFSC    PIR1
,RCIF
    
GOTO    GET_RX
    
GOTO    GET_DATA
GET_RX            
    BANKSEL    RCREG
    MOVF    RCREG
,W
    MOVWF    TEMP
    
RETURN

    
END

主控端 連續送2筆8BIT資料到接收端

觀察 TEMP暫存器

卻發現只收到第一筆資料 第二筆資料都收不到

想請問一下 程式哪邊露了什麼 還是少打了什麼

感謝

發表於: 2006/3/17 2:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------