Re: 有關中斷副程式的問題~
|
||||
---|---|---|---|---|
初級會員
|
對吼~@@"我把它改成下面這行就會產生中斷了。感謝!感謝!
ConfigIntTimer1( T1_INT_PRIOR_7 & T1_INT_ON ) ;
發表於: 2009/10/11 14:37
|
|||
|
Re: 有關中斷副程式的問題~
|
||||
---|---|---|---|---|
資深會員
|
>ConfigIntTimer1( T1_INT_PRIOR_7 & T1_INT_OFF ) ;
這樣會有中斷喔?
發表於: 2009/10/10 19:34
|
|||
不要問我哪裡來,我只是個流浪天涯的工程師
|
||||
|
Re: 有關中斷副程式的問題~
|
||||
---|---|---|---|---|
初級會員
|
不好意思,少貼一張! @@~
Attach file: (0.00 KB)
發表於: 2009/10/10 18:05
|
|||
|
Re: 有關中斷副程式的問題~
|
||||
---|---|---|---|---|
資深會員
|
中斷旗標?清除沒?
發表於: 2009/10/10 11:38
|
|||
不要問我哪裡來,我只是個流浪天涯的工程師
|
||||
|
有關中斷副程式的問題~
|
||||
---|---|---|---|---|
初級會員
|
請問一下:
為何程式執行時,雖然中斷部分IFS0(0x008)有產生,但不會跳到Timer1中斷副程式中去執行,而是Timer1繼續往下計時。是否有些參數尚未設定到呢? 謝謝! 謝謝! #define __dsPIC30F4011__ #include <p30F4011.h> #include <timer.h> #define FCY 7372800*2 unsigned int i=1 ; _FOSC(CSW_FSCM_OFF & XT_PLL8); _FWDT(WDT_OFF); _FBORPOR(PBOR_OFF & MCLR_EN); _FGS(CODE_PROT_OFF); void _ISR _T1Interrupt(void) //Timer1中斷副程式 { i+=1; if ( i==1 ) { PORTB=0x0062; } if ( i==2 ) { PORTB=0x0046; } IFS0bits.T1IF=0; } int main( void ) { ConfigIntTimer1( T1_INT_PRIOR_7 & T1_INT_OFF ) ; ADPCFG = 0xffff ; TRISB = 0x0000 ; OpenTimer1( T1_ON & T1_IDLE_STOP & T1_GATE_OFF &T1_PS_1_1 & T1_SYNC_EXT_OFF & T1_SOURCE_INT , (FCY)/10 ) ; while(1) { } } Attach file: (0.00 KB) (0.00 KB)
發表於: 2009/10/9 20:23
|
|||
|