Browsing this Thread:
1 Anonymous Users
|
Interrupt疑問
|
|
新會員
Joined
: 2009/4/23 13:24 最後登入時間
: 2009/7/22 7:59
Group:
註冊會員
Level : 3 HP : 0 / 55 MP : 6 / 2418 EXP : 20
|
各位先進你們好 我在使用中斷的時候遇到的問題 不知該如何解決 假設我的code如下
unsigned char stage; main () { switch (stage) { case 1: work(); break; case 2: empty(); break; default: welcome(); break; } U1STAbits.UTXEN = 1; //Enable Transmit IEC0bits.U1TXIE = 1; //Enable Transmit Interrupt IEC0bits.U1RXIE = 1; //Enable Receive Interrupt }
void _ISR _U1RXInterrupt() { _U1RXIF = 0; int i; for(i = 0; i < (sizeof temp) ; i++ ) { temp[i] = UART2GetChar(); } stege = 1; }
我發現在Interrupt function的stage = 1 好像沒有任何作用 不曉得該如何處理才好 單步執行只看的到stage的值又消失了 感謝各位的指教
發表於: 2009/7/16 14:39
|
|
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.