Using LPIT instead of LPTMR for linstack timer callback

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

Using LPIT instead of LPTMR for linstack timer callback

589 Views
Francesco_Solito
Contributor II

Good morning

I'm using a S32K118 evaluation board. I'm using the lin stack slave example and it works fine. It uses the LPTMR to call the lin_lld_timeout_service(LI0) and besides it is used in the PORT IRQ for the autobaud rate function.

Now I need to use LPTMR for another timebase (I need a slow timer) and so I tried to replace it for lin stack with LPIT channel 0.

I adapded the get counter function and the lin0TimerGetTimeIntervalCallback0, but it seems that it doesn't work. The autobaud rate does not complete successully.

Can you help me understanding why? Could you try to setup an example with LPIT for lin stack and share it here?

Please I would also like to understand what is the difference between External and Internal trigger for LPIT. (at the moment I still don't understand if it is a free running or if some trigger is triggering the LPIT).

Is it correct the idea to use the LPTMR to make a slow timebase (100ms) that works also in low power mode? Or should do I use the LPO_CLK?

Is the autobaud function necessary or can I avoid it?

Please let me know as soon as possible, in particular for LPIT usage.

Kind regards,

Francesco Solito

0 Kudos
Reply
2 Replies

530 Views
cuongnguyenphu
NXP Employee
NXP Employee

Hi,
Which SW package you're using and where you get the example of Lin stack as your describe?
Under MCAL layer and RTD package, we only provide examples along with the SW package that help you configure and use MCAL API for Lin. So I am not sure that we can help to implement your Lin stack

0 Kudos
Reply

513 Views
Francesco_Solito
Contributor II

Hello

Fortunately I solved by myself, but to be honest I was expected to receive an example with LPIT instead of LPTMR, just to help me. Anyway it is no more necessary for me.

For the community, I write here how I solved:

I'm using SDK RTM 4.0.1 and I started from the lin stack slave example. The LPTMR counts upward, while LPIT counts downward. So when I understood this, I adapted the timeout callback according to the downward counting method and then the autobaud procedure complete successfully with LPIT, and then the LIN works fine.

Kind regards,

Francesco

0 Kudos
Reply