• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 203_PRC其中LAB3的問題(PIC24FJ128GA010)
#3
版主
版主


查看用戶資訊
問題一:

.for(i = 0; i < 0xFFFF; i++);
請大大解釋這行的意思
謝謝

ANS: Delay

問題二:

IPC2bits.T3IP = 4; // ###
IPC7bits.T5IP = 2; // ###
為什麼設4,2 ???????
是什麼意思?

ANS: 設定該週邊的中斷優先權值,0~7 的等級在與 CPU 的中斷等級比較,大於 CPU 的設定才會允許中斷發生。


問題三: 同問題一。

發表於: 2008/11/28 8:07
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 203_PRC其中LAB3的問題(PIC24FJ128GA010)
#2
中級會員
中級會員


查看用戶資訊

發表於: 2008/11/28 2:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


203_PRC其中LAB3的問題(PIC24FJ128GA010)
#1
新會員
新會員


查看用戶資訊
我有三個問題

問題一:

.for(i = 0; i < 0xFFFF; i++);
請大大解釋這行的意思
謝謝

問題二:

IPC2bits.T3IP = 4; // ###
IPC7bits.T5IP = 2; // ###
為什麼設4,2 ???????
是什麼意思?


問題三:

void __attribute__((interrupt,no_auto_psv)) _T3Interrupt()
{
long int i = 0;
IFS0bits.T3IF = 0; //Clear Timer3 interrupt flag bit

PORTAbits.RA0 = 1;

for(i = 0; i< 0x2000 ; i++)//這一段看不懂
//為什麼設定成2000?
{
}

PORTAbits.RA0 = 0;

}


以下是問題二之程式碼





case 1: //S3 Pressed
SRbits.IPL = 0;

//##########################################
// STEP 1:
// set Timer 3 interrupt priority level higher than Timer 5
//##########################################

IPC2bits.T3IP = 4; // ###
IPC7bits.T5IP = 2; // ###

break;


case 2: //S6 Pressed
SRbits.IPL = 0;

//##########################################
// STEP 2:
// set Timer 5 interrupt priority level higher than Timer 3
//##########################################

IPC2bits.T3IP = 2; // ###
IPC7bits.T5IP = 4; // ###

break;


case 3: //S5 Pressed
SRbits.IPL = 3;

//##########################################
// STEP 3:
// set the CPU interrupt priority level higher than Timer 5
// and lower than Timer3
//##########################################

IPC2bits.T3IP = 4; // ###
IPC7bits.T5IP = 2; // ###

break;


case 4:

//##########################################
// STEP 4:
// set the CPU interrupt priority level higher than both the Timers
//##########################################

SRbits.IPL = 5; // ###

break;


}

IEC0bits.T3IE = 1; // Re-enable Timer 3 interrupt
IEC1bits.T5IE = 1; // Re-enable Timer 5 interrupt
}

}

發表於: 2008/11/27 21:17

Edited by kuo_628 on 2008年11月27日 23:11:03
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







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.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------