S32K116 LPIT high frequency interrupt

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

S32K116 LPIT high frequency interrupt

1,498 次查看
rjmalmeida0
Contributor III

Hi, i'm trying to toggle a pin at a frequency higher than 1MHz using the LPIT. I've configured the Sys, Bus and peripheral clock to the SOSC @ 40MHz configured frequency (as seen on printscreen). The issue appears when  I try to configure the LPIT to interrupt every 40 ticks (or periods). The frequency of the pin toggle should be 1MHz but it goes down to 500kHz (approx). And when I put values lower than 40, the frequency slowly goes up from the 500kHz, at every lower value. Am I missing something? Below is my configuration inside main function and the ISR.

int main(void) {
 /* Write your local variable definition here */
 /* Initialize system and peripheral clocks */
 CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
   g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
 CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);
 /* Initialize Pin settings*/
 PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
 /* Install interrupt */
 INT_SYS_InstallHandler(LPIT0_IRQn, &LPIT_ISR, (isr_t *) 0);
 /* Enable interrupt */
 INT_SYS_EnableIRQ(LPIT0_IRQn);
 /* Initialize LPIT Timer */
 LPIT_DRV_Init(INST_LPIT1, &lpit1_InitConfig);
 LPIT_DRV_InitChannel(INST_LPIT1, 0U, &lpit1_ChnConfig0);
 LPIT_DRV_StartTimerChannels(INST_LPIT1, (1 << 0U));

 for (;;){}

  return exit_code;
} 

void LPIT_ISR(void)
{
 PTB->PTOR = (((uint32_t)(((uint32_t)((1 << 13U)))<<GPIO_PTOR_PTTO_SHIFT))&GPIO_PTOR_PTTO_MASK);
 /* Clear LPIT channel flag */
 LPIT0->MSR = (1 << 0U);
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Thanks in advance

标签 (1)
标记 (3)
0 项奖励
回复
1 回复

1,194 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Rui, 

Could you please share your project with me so I can reproduce the behavior you mentioned and make some tests on my side? 

Best regards, 

Victor 

0 项奖励
回复