MPC5674F PIT interrupt cycle

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MPC5674F PIT interrupt cycle

跳至解决方案
972 次查看
nuaa_zp
Contributor I

Hi,

I ran the example code(XPC567XFKIT-PinToggleStationery-V0_4.zip) on MPC567XKIT516-PT Development board . It ran normal,But I found that the PIT interrupt cycle is not 1s while the code is set to 1s, this is original code, I have not changed.as follows:

static void PIT3_init(void)

{

/* define 1 second interval based on frequency */

#if defined(CORE_CLOCK_264MHz)

#define PIT_interval_1s 26400000 

#elif defined(CORE_CLOCK_200MHz) 

#define PIT_interval_1s 20000000 

#elif defined(CORE_CLOCK_150MHz) 

#define PIT_interval_1s 15000000 

#else // 60MHz

#define PIT_interval_1s 6000000 

#endif

/* 30: MDIS = 0 to enable clock for PITs. */ 

/* 31: FRZ = 1 for Timers stopped in debug mode */ 

PIT.MCR.R = 0x00000001; 

PIT.CH[3].LDVAL.R = PIT_interval_1s - 1; 

/* clear the TIF flag */  PIT.CH[3].TFLG.R = 0x00000001; 

/* 30: TIE = 1 for interrupt request enabled */ 

/* 31: TEN = 1 for timer active */

PIT.CH[3].TCTRL.R = 0x00000003;

}

Could you give me some advice? thank you!

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
767 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

there was few mistakes in the example, now it is corrected, see 

https://community.nxp.com/docs/DOC-102744

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
1 回复
768 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

there was few mistakes in the example, now it is corrected, see 

https://community.nxp.com/docs/DOC-102744

BR, Petr

0 项奖励
回复