I am trying to configure LPIT timer for 1ms in s32k146 board. I am not getting the accuarte output. please help me to do this. Is it possible to configure LPIT for 10 ms or whatever time i want .I am attaching the code. Please tell me what should i do and how i can change the timer interrupt time. kindly help me asap.
sorry for late reply
thanks subham dey..
Hi Shubam / Daniel
Hope you Guys doing good .
Recently i am also plan to configure some Timer interrupt , then i got some doubts and referred your inputs .
Now According to my understanding above the issue :
freq is = 40MHZ
can you let me know how LPIT timeout period (TMR_TVAL) value put 400000 for 10MS ?
LPIT0->TMR[0].TVAL = 400000;
for 10 MS ???
please provide steps how you calculated
Thanks in advance.
Hi Gowthaman,
According to the understanding, your system clock frequency is 40 MHz.
LPIT0->TMR[0].TVAL = TIMER0_LOAD_VALUE;
If u want to configure the timer for 10ms then TIMER0_LOAD_VALUE will be
(SPLLDIV2_CLK_FREQ /TIMER0_PERIOD_HZ)
if timer period is 10ms then in Hz it will be 100Hz
hence 40MHz/100=40000000/100=400000
if any query u have u can let me know.
I think it is quite straight-forward, it depends on the LPIT function clock, which is common for all 4 LPIT channels, and the values in TVALn registers which selects a timeout period for each LPIT channel. So, although all the four channels runs at the same clock, each channels can generate an interrupt at a different timeout period.
Please refer to the S32K1xx reference manual for more information.
Thank you,
Regards,
Daniel