Problem in LPIT configure

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

Problem in LPIT configure

2,647 Views
subham_dey
Contributor II

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.

Tags (3)
6 Replies

2,456 Views
gowthaman_krish
Contributor II

sorry for late reply

thanks subham dey..

0 Kudos
Reply

2,456 Views
gowthaman_krish
Contributor II

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.

0 Kudos
Reply

2,456 Views
subham_dey
Contributor II

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.

2,456 Views
subham_dey
Contributor II

Thanks Danial for replying. can u kindly tell me how do u calculate??

and if i want to configure 3 timer in different interrupt at together value then how to do it??

2,456 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi subham.dey@embitel.com,

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

2,456 Views
subham_dey
Contributor II

Thanks Daniel. I understood the concept..Now it works fine.