Re: 請問C18可以只用低(0x18)的中斷嗎?
|
||||
---|---|---|---|---|
資深會員
|
大家好:
使用MPLAB V8.10, 我想IPEN=0;是使用高(0x08)中斷=16F中斷. 我想請問版主,為何我使用軟體模擬或ICD2時; 於WATCH視窗看TMR1H和TMR1L,卻只有TMR1L 能看到變化而TMR1H卻不變,能幫忙否解說! Thanks.
發表於: 2008/7/7 11:01
|
|||
|
請問C18可以只用低(0x18)的中斷嗎?
|
||||
---|---|---|---|---|
資深會員
|
大家好:
使用p18f4423 相關設定如下=> void init_cpu(void) { ... //一些I/O設定 RCON=0X00; //IPEN=0; IPR1=0; IPR2=0; INTCON2=0XF0; INTCON3=0X00; TMR1IE=1; //只致能TMR1中斷 PR2=0XFF; CCPR1L=0; CCPR2L=0; INTCON=0XC0; //GIE=1,PEIE=1 } //--------------------------------------------------------------------- #pragma code InterruptVectorLow = 0x18 void InterruptVectorLow (void) { _asm goto InterruptHandlerLow //jump to interrupt routine _endasm } // Low priority interrupt routine #pragma code #pragma interruptlow InterruptHandlerLow void InterruptHandlerLow (void) { if(TMR1IF) { TMR1IF=0; TMR1L=(65536-time1_base)%256; TMR1H=(65536-time1_base)/256; { //--------------------------------------------------------------------- // High priority interrupt vector #pragma code InterruptVectorHigh = 0x08 void InterruptVectorHigh (void) { _asm goto InterruptHandlerHigh //jump to interrupt routine _endasm } //--------------------------------------------------------------------- // High priority interrupt routine #pragma code #pragma interrupt InterruptHandlerHigh // void InterruptHandlerHigh (void) { //沒有功能,只是測試 } 我的問題=> 1.一開始是高(0x08)中斷沒有寫,不知到程式執行到那兒? 2.加了高(0x08)中斷後為何一直執行高(0x08)中斷呢? 不解;因我已將高(0x08)中斷除能,為何還會進入高(0x08)中斷? 煩請先進幫忙解說,Thanks.
發表於: 2008/7/7 9:19
|
|||
|