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?
Solved! Go to Solution.
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!
-----------------------------------------------------------------------------------------------------------------------
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!
-----------------------------------------------------------------------------------------------------------------------
Hi Jennie,
My concern is, there is no example for J2602 Protocol.
I checked S12VR32_example, this is also for 2.1 LIN only.
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
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!
-----------------------------------------------------------------------------------------------------------------------
Hi salman,
The attachments are visible from my side. Can't you see it on your side? see what I see below:
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!
-----------------------------------------------------------------------------------------------------------------------
Hi Jennie,
Thanks a lot for the mail.
you are welcome.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------