Re: 中斷high level 與 low level使用的問題
|
||||
---|---|---|---|---|
版主
|
在中斷裡有計算的部份會使用到 Temp Data 所以有可能你在做加法的動作時動到了Temp Data 而影響到其它的程式。
看一下以前的討論是否可以解決: http://www.microchip.com.tw/modules/n ... t_id=19706#forumpost19706 User 自行定義的變數 : #pragma interrupt high_interrupt_service_routine save=myint 儲存自訂的 myint 變數 pragma interrupt high_interrupt_service_routine save=section("mydata") 儲存自訂變數節區 mydata 的變數 #pragma interrupt high_interrupt_service_routine nosave=section(".tmpdata") 儲存 temp data 區的資料
發表於: 2009/6/26 12:02
|
|||
|
Re: 中斷high level 與 low level使用的問題
|
||||
---|---|---|---|---|
高級會員
|
版主你好:
一、我使用的是C語言。 二、Low Priority Interrupt 與 High Priority Interrupt 沒有相同的變數。 三、low priority Interrupt內的timer0有使用的計count的功能是32bit的變數做加一的動作。 有那些是要注意的呢?
發表於: 2009/6/26 11:27
|
|||
|
Re: 中斷high level 與 low level使用的問題
|
||||
---|---|---|---|---|
版主
|
1. 你用 C or Assembly 寫?
2. Low Priority Interrupt 有沒有與 High Priority Interrupt 使用相同的變數? 3. 如果是用 C 寫,中斷裡有沒有使用到計算的功能 (Temp_Data)?
發表於: 2009/6/24 10:08
|
|||
|
中斷high level 與 low level使用的問題
|
||||
---|---|---|---|---|
高級會員
|
如題:
我使用的是18f8622 我在low設定了timer0、中斷間隔是10ms 4MHZ、四倍頻 TMR0H = 0xFF; TMR0L = 0x62; 將timer0一直開著。 high level上接收uart1 的接收資料。 感覺在high level接收uart資料的時候、 接收到timer0的中斷、在low未執行完又收到high level的中斷之後的程式梁程時很容易造成reset 或當機(整個資料都亂掉) 請問一下high low level 的中斷在用的時候有什麼要注意的嗎?
發表於: 2009/6/23 15:34
|
|||
|