LIN J2602 Example

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

LIN J2602 Example

Jump to solution
2,202 Views
salmanshaikh
Contributor II

Hi, I am using LIN Stack 'FSL_LIN_2.x_STACK_Package_4.5.9'  with MC9S12XEP100 micro for implementing a master node for LIN J2602 networks. In examples present in stack, there is no example on J2602 example.

If anyone has worked on J2602, Could you please share a reference example?

0 Kudos
1 Solution
1,210 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Salman

Attachment is an example code for implement a master node for LIN J2602.

This example run in EVB9S12EXP100 STARTER KIT REV B.

In this example I use BUS clock 2M, and the calculate of baudrate have big tolerance. It is a limitation of current code. And to work around  with this we can use another bus clock or add a below code to line 1741 of file lin_lld_sci.c.

     a = (tmp+1)*16*lconf_p->baud_rate - MCU_BUS_FREQ;

     b =  MCU_BUS_FREQ - (tmp+1)*16*lconf_p->baud_rate;

     if (a<b) {

      tmp=tmp+1;

     }

In the example I just add these code to make baudrate of lin bus close with true baudrate(10417 bps).


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
7 Replies
1,210 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

FSL_LIN_2.x_STACK_Package_4.5.9 for xwp100 only includes XEP100_Gateway and 9S12XEP100_slave_node.

For xep100, please refer S12VR32_example.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,210 Views
salmanshaikh
Contributor II

Hi Jennie,

My concern is, there is no example for J2602 Protocol.

I checked S12VR32_example, this is also for 2.1 LIN only.

0 Kudos
1,210 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

I contacted LIN development team. I was told they will prepare a demo code for you.

I will send it to you as well as I get it.

Best Regards

Jennie Zhang

0 Kudos
1,211 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Salman

Attachment is an example code for implement a master node for LIN J2602.

This example run in EVB9S12EXP100 STARTER KIT REV B.

In this example I use BUS clock 2M, and the calculate of baudrate have big tolerance. It is a limitation of current code. And to work around  with this we can use another bus clock or add a below code to line 1741 of file lin_lld_sci.c.

     a = (tmp+1)*16*lconf_p->baud_rate - MCU_BUS_FREQ;

     b =  MCU_BUS_FREQ - (tmp+1)*16*lconf_p->baud_rate;

     if (a<b) {

      tmp=tmp+1;

     }

In the example I just add these code to make baudrate of lin bus close with true baudrate(10417 bps).


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,210 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi salman,

The attachments are visible from my side. Can't you see it on your side? see what I see below:

pastedImage_2.png

Anyway, I just sent these files to your email (@gmail.com). Please check it also.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,210 Views
salmanshaikh
Contributor II

Hi Jennie,

Thanks a lot for the mail.

0 Kudos
1,210 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

you are welcome.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos