Re: 203_PRC其中LAB3的問題(PIC24FJ128GA010)
|
||||
---|---|---|---|---|
中級會員
|
發表於: 2008/11/28 2:29
|
|||
|
203_PRC其中LAB3的問題(PIC24FJ128GA010)
|
||||
---|---|---|---|---|
新會員
|
我有三個問題
問題一: .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
|
|||
|