在线时间28 小时
UID2074361
注册时间2015-9-23
NXP金币0
该用户从未签到
注册会员

- 积分
- 184
- 最后登录
- 2017-12-17
|
芯片 MPC5745R, PIT配置如下PIT_0.MCR.B.MDIS = 0; // Clock for standard PIT timers is enabled.
PIT_0.MCR.B.FRZ = 0; // Timers continue to run in Debug mode
uint32_t cnt_value=(uint32_t)(Clock_Freq*ExpectedTimeBase)-1;
PIT_0.TIMER[Channel].LDVAL.R=cnt_value;
PIT_0.TIMER[Channel].TCTRL.B.CHN = 0;
PIT_0.TIMER[Channel].TCTRL.B.TIE = 1;
PIT_0.TIMER[Channel].TFLG.B.TIF = 0;
PIT_0.TIMER[Channel].TCTRL.B.TEN=1;
INTC配置如下
xcptn_xmpl (); /* Configure and Enable Interrupts */
//Choose software (HVEN=0) or hardware (HVEN=1) vector mode
INTC_0.BCR.R = 0x00000000;
//Set INTC ISR vector table base addr.
INTC_0.IACKR[0].B.VTBA = (uint32_t) &IntcIsrVectorTable[0];
/***************Set priorities********************************************/
//Set priorities - PIT
switch(PIT_WD_CH){
case 0 : INTC_0.PSR[226].B.PRIN = 12; break;
case 1 : INTC_0.PSR[227].B.PRIN = 12; break;
case 2 : INTC_0.PSR[228].B.PRIN = 12; break;
case 3 : INTC_0.PSR[229].B.PRIN = 12; break;
}
INTC_0.CPR[0].B.PRI = 0;
// Enable external interrupts
asm(" wrteei 1");
中断intc_SW_mode_isr_vectors_MPC574xR.c函数 中 在 226向量号定义中断服务函数
(uint32_t) &ISR226_PIT0_CH0, /* Vector # 226 Periodic Interrupt Timer (PIT0) PIT_0_TFLG0[TIF] */
然后一直进不去中断服务函数
大神给指点指点有什么问题
|
|