Re: MCC18中的中断返回 为什么用return而不用retfie
|
||||
---|---|---|---|---|
新會員
|
多谢指点,看了资料确实如此
加了中断宣告指令,编译后为retfie返回 我原来的程序中用到了串口,A/D,timer2三个中断,主程序中只有几个nop指令。运行以后,程序并没有飞掉,是偶然看反编译指令才发现的
發表於: 2007/3/19 18:15
|
|||
|
Re: MCC18中的中断返回 为什么用return而不用retfie
|
||||
---|---|---|---|---|
版主
|
1. 因為 0x0008 與 0x0018 的空間很小所以用 goto 將成是轉移出來到一般的程式空間處理。
2. 須用此方式宣告 :
#pragma code hi_vector=0x0008 // 設定中斷進入點
或用此方式宣告 Low Priority Interrupt routine : #pragma interruptlow func-name 你的程式中對中斷宣告有錯所以被當作一般的 function 來看。 可以到這裡下載 W410 C18 講義看看第五章之說明 : http://www.microchip.com.tw/material.htm
發表於: 2007/3/19 16:22
|
|||
|