Re: 請問C18高低中斷,Compiler為何會更改暫存器(ACCESS)!
|
||||
---|---|---|---|---|
版主
|
使用 C18 中斷處理是很簡單的,只要先弄清楚你要的高低中斷設定及在中動程式裡有沒有使用到C18的tempdata(中斷裡有做額外的加減乘除計算)來決定要不要儲存 Tempdata。正確使用中動的說明可以參考 W401 C18 RTC 教材裡的第五章的說明。
http://www.microchip.com.tw/modules/n ... php?topic_id=5107&forum=1 Auto : 使指 Local variable 或函數的參數傳遞使用 FSR2 所指到的 Stack 來做參數的傳遞。 Static : 不使用RAM 堆疊傳遞參數,使用沒有使用的 RAM 直接做 區域變數及函數的參數傳遞。 Overlay : ??
發表於: 2008/9/18 10:13
|
|||
|
Re: 請問C18高低中斷,Compiler為何會更改暫存器(ACCESS)!
|
||||
---|---|---|---|---|
資深會員
|
大家好:
問題已解決: #pragma interruptlow InterruptHandlerLow nosave=section(".tmpdata") Thanks.
發表於: 2008/9/18 9:57
|
|||
|
Re: 請問C18高低中斷,Compiler為何會更改暫存器(ACCESS)!
|
||||
---|---|---|---|---|
資深會員
|
大家好:
我想我的問題應是stack overflow, 所以應是C18使用軟體stack的關係. 那麼我該如何不使用軟體stack呢? 於Build option...內有一設定如下: Default storage class : Auto Static Overlay 請問上面三個差別為何? 煩請各位先進解說,Thanks.
發表於: 2008/9/17 11:11
|
|||
|
請問C18高低中斷,Compiler為何會更改暫存器(ACCESS)!
|
||||
---|---|---|---|---|
資深會員
|
大家好:
1. TMR0IE=1; //低中斷 TMR1IE=1; //高中斷 使用C18高低中斷,為何會將:如INTCON2的值改變掉? 將INTCON2的TMR0IE=0; 2. 而且PC會亂跑,不知為何? 程式長度為0x179F,卻會跑到0x2C5E或0x3478... 我該怎麼處理較好? 煩請各位先進解說. Thanks.
發表於: 2008/9/16 14:00
|
|||
|