Browsing this Thread:
1 Anonymous Users
|
dsPIC30F4011-Change Notification問題
|
|
新會員
Joined
: 2007/9/21 16:32 最後登入時間
: 2020/10/26 10:28
Group:
註冊會員
Level : 1 HP : 0 / 2 MP : 1 / 135 EXP : 10
|
您好: 我APP020的實驗版,晶片是dsPIC30F4011,我使用到Change Notification功能,我使用RB4(CN6)腳位做訊號改變量測,訊號改變會產生中斷,然而使用其他腳位(如:CN7、CN5、CN4...)皆無法產生中斷。
程式如下: #define __dsPIC30F4011__ #include <p30F4011.h> #include <timer.h> #include "C30EVM_LCD.h" #define FCY 7372800*2
_FOSC(CSW_FSCM_OFF & XT_PLL8); _FWDT(WDT_OFF); _FBORPOR(PBOR_OFF & MCLR_EN); _FGS(CODE_PROT_OFF);
int Count=0; char My_String1[]="Count: " ;
void Show_CN(void);
void _ISR _CNInterrupt(void) { IFS0bits.CNIF=0; Count++; }
int main(void) { ADPCFG=0xffff; TRISBbits.TRISB4=1; //改為TRISBbits.TRISB5=1;-->無法使用 CNEN1bits.CN6IE=1; //改為CNEN1bits.CN7IE;-->無法使用 IFS0bits.CNIF=0; IPC3|=0x7000; IEC0bits.CNIE=1;
OpenLCD( ) ;
setcurLCD(0,0) ; putrsLCD( My_String1 ) ; while(1) { Show_CN(); } }
void Show_CN(void) { setcurLCD(6,0) ; put_Num_LCD(Count) ; }
謝謝~
發表於: 2009/4/14 16:47
|
|
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.