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


Browsing this Thread:   1 Anonymous Users






Re: 使用timer中斷 如何知道usart有接收?
#7
版主
版主


查看用戶資訊
RCIF 只是用來判斷是否UART的接收中斷,若不是還可以判斷其它的中斷其耗找出是誰產生的中斷。

發表於: 2007/9/13 15:23
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 使用timer中斷 如何知道usart有接收?
#6
新會員
新會員


查看用戶資訊
參照:

Ryang 寫到:
低優先權的基本設定看起來是沒有錯。

一個中斷進入點 (例如 : 高優先權) 可以支援好幾種周邊中斷,只要進入中斷後立即檢查各周邊的中斷其耗就可以知道是誰發生了中斷。


所以是判斷RCIF是否為1來判斷是不是接收中斷嗎?

發表於: 2007/9/12 17:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 使用timer中斷 如何知道usart有接收?
#5
版主
版主


查看用戶資訊
低優先權的基本設定看起來是沒有錯。

一個中斷進入點 (例如 : 高優先權) 可以支援好幾種周邊中斷,只要進入中斷後立即檢查各周邊的中斷其耗就可以知道是誰發生了中斷。

發表於: 2007/9/11 10:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 使用timer中斷 如何知道usart有接收?
#4
新會員
新會員


查看用戶資訊
已經知道為什麼不能用高優先中斷了,原來是程式別的地方已經有在使用,所以我現在想要使用低優先權中斷,以下是我的中斷前置設定
IPEN=1
RCIP=0
RCIE=1
GIEH=1
GIEL=1
這樣設定對嗎?

發表於: 2007/9/10 20:11
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 使用timer中斷 如何知道usart有接收?
#3
新會員
新會員


查看用戶資訊
#pragma code isr_high_code= 0x0008

void isr_high_direct(void)
{
_asm //begin in-line assembly
goto isr_high //go to isr_high function
_endasm //end in-line assembly
}
#pragma code


#pragma interrupt isr_high
void isr_high(void)
{
Rec_Data=ReadUSART(); // Get RS-232 data

}
#pragma code

這是我之前使用的中斷方式,但是無法過link,會出現以下錯誤
Error - section 'isr_high_code' can not fit the absolute section. Section 'isr_high_code' start=0x00000008, length=0x00000006

所以現在才想使用timer的方法,我使用的mcu是18F4620

發表於: 2007/9/10 19:42
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 使用timer中斷 如何知道usart有接收?
#2
資深會員
資深會員


查看用戶資訊
為何不用RCIF中斷?

發表於: 2007/9/10 19:10
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


使用timer中斷 如何知道usart有接收?
#1
新會員
新會員


查看用戶資訊
之前有試過用高優先權中斷來判斷是否有接收資料,但是link一直無法過

所以現在想使用timer定時產生中斷來檢查usart是否有接收到資料,請問怎樣才可以知道usart有接收到資料呢?

發表於: 2007/9/10 18:35
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... ]

教育訓練中心

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