MPC5674F PIT interrupt cycle

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5674F PIT interrupt cycle

Jump to solution
775 Views
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!

Labels (1)
Tags (1)
0 Kudos
1 Solution
570 Views
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

View solution in original post

0 Kudos
1 Reply
571 Views
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 Kudos