Dear Friend,
I am using MKE16Z MCU in my project. In that, I am using LPIT0 for periodic interrupt operation. I have taken the code reference from the SDK example.
Interrupt operation is not working, but the LPIT0 counter is running. Also, LPIT0 counter interrupt operation flag is set. Even I have enabled the interrupt in NVIC vectors.
SDK Version: 2.11.0
IDE Version : 11.5.0
Thank in advance.
Sorry but can i have your code to configure LPIT please? I have tried but cant make it work. I set PCS,CGC and then turn on M_CEN, but i still not get access to configure the rest of the module like MSR, SETTEN, CLRTEN, TCTRL
Hi,
I suppose that you do not enable interrupt. Pls add the lines:
__NVIC_EnableIRQ(PIT_CH0_IRQn);
__NVIC_SetPriority(PIT_CH0_IRQn,0x00);
__asm("cpsie i");
Pls have a try
Hope it is helpful
BR
Xiangjun Rong
Hello Xiangjun,
Thanks for your reply.
I will try your solution. Also, I have come up with one more solution,
I have removed a grounding resistor on Pin no.33(PTD2).
Previously it was pulled to the ground by a 22kohm resistor, after removing it the Interrupt started working.
BR
Kumar Balaji