LIN (Local Interconnect network) Help

05 Mar 2011

I am Currently working on making a Mbed Based Lin slave using the Uart. Has any one experimented with this?

I have managed to receive messages but struggling to send a response to a message Id

Any help would be appreciated

Many thanks

Ben

05 Mar 2011

In case you don't have the official LIN specification it can be obtained for free here, you just need to give then your name and email address. The copy you download is then watermarked with your email address.

http://www.lin-subbus.org/

06 Mar 2011

Many Thanks Kevin! any other help?

06 Mar 2011

I have not used LIN yet. I just downloaded the specification this week and started reading about it. Sorry I can't help you more than pointing to the specification. Maybe someone else can. Good luck!

09 Mar 2011

Can you specify the problem you are having?

13 Mar 2011

I am working on the LIN communication,but don't know how to make the lin driver for the source code.I have already studied the LIN Specification, but still donnot have any idea. Hope your guide&help.

19 Mar 2011

Are you still having Problems? i Have a master and a slave working but there my no means perfect having difficulties with the slave sending more than 3 data bits, after receiving a PID.

20 Mar 2011

yeah,I am still engage in the LIN send &receive part, could you share your program or flow chart?

26 Mar 2011

Hello. my code is still very much work in progress, but i have every thing working /media/uploads/brad2ers/4d8c5df8-6b78-467e-9077-7c6e0a425dc9.jpeg My rough flow chart is above, let me know if your still having difficulty.

07 Aug 2012

is the mbed capable to send a sync break? i'm using an autobaud slave on the other side that uses the U karacter sync. But can't manage to make the mbed push out a sync break. Anyone an id?

22 Aug 2012

Ben Bradbury wrote:

Hello. my code is still very much work in progress, but i have every thing working /media/uploads/brad2ers/4d8c5df8-6b78-467e-9077-7c6e0a425dc9.jpeg My rough flow chart is above, let me know if your still having difficulty.

Hi, Ben One thing I don't understand from your LIN flow chart: how do you count the break bit time? (how does the slave detect a break ?) Seems a little confusing for me to use those serial APIs for this :(. I'm new to both LIN and mbed. Any help would be appreciated, Thanks,

22 Aug 2012

the count needs to be long enough for the slave to "see" once the hardware condition is fulfilled the break was a succes, even if you hold him for 10 seconds. I don't think it will cause problems because the real baud sync starts @ the following rising edge. so even if that edge arrives next week. That would also be ok. You just need to hold the break condition long enough, depending on the clock speed / fetch cycle of your slave. Anyone, correct me if i'm wrong.

btw no one any id to send a sync break from the mbed?

22 Aug 2012

Thanks Tom, wish I could also help you with your problem... I think I understand what you mean, just need to keep the break time as long as enough. but for the slave, how does it "see" this is a one-week long sync break signal received and now it needs to receive the sync field ? I mean, we can't use readable() to detect that this condition has happened, right? Thanks again for your response.

zhoujian

26 Aug 2012

have a look at this. http://www.specifications.nl/lin/lin_UK.php?requestedpage=1 LIN has been made to work perfect with high performance, lowcost & low power hardware. In normal conditions the bus is idle and the slaves are in some kind of sleep mode. Mostly those slaves clock's are also down to save power. In my case i use a small pic controller. I wake him up to do something and than he goes to sleep automatically. The break generates a (interrupt on change) for my slave. So he come's out of deep sleep. sync's himself on the U character (autobaud) Read's the message, does the action and goes back to sleep.

TO wake up those slaves and actually receive a message we have to make sure everyone is online and listening. So we pull down the transmit pin long enough ( 11 chars @ least ) to let the slave know he should wake-up. and get ready to sync himself on the U char you send as first byte.

I only implement LIN as far as i need it. I only use the break and sync as for the rest of the message i don't follow any rules as they are described. I don't need it. Fact is. My pic controller can actually send a LIN sync break. I don't find any commando for MBED to do the same. So i wrote some code that fakes a break sync. It's just strange we don't have a command for it ...

Tom

28 Aug 2012

Thanks again tom, I think you can access to the registre level of LPC 1768 to fully manager the signal you want: please reference LPC17X user manual page 306: Chapter 14: LPC17xx UART0/2/3, you can find that the bit Break control active in UART Line Control Registre can generate logic 0 on the TXD outpin.

However, if you want another way to send a break signal, you can simply divide the baudrate of LIN to half and send a 0x00 byte, by this, the slaves on the line can also detecte it as a break signal as their baudrates are two times faster than the master, after sent the break, just reset the baudrate of master to normal for the transmission of the other bytes (SYNC, ID...)...

hope this helps. :)

zhoujian

16 Dec 2012

Hello, I am also interested in lin-bus protocol for a mbed. As I see there exists a discussion about this topic since 2011. Does there exist a driver that anybody would give to me? That would be very nice. Thank you. Best regards, frank muenzner

12 Apr 2013

I'm looking for a basic LIN master implementation, if anyone has anything they can share that would be greatly appreciated.

20 Feb 2014

Any update on the LIN master implementation? I'm also interested!

25 Oct 2014

I too am interested in the ability to communicate LIN and this seems to be the only discussion I can find on it.

10 Oct 2019

I purchased LIN transceiver chip to get data from the door( i.e closed or open) of the car and for other applications , i have two queries

1. How can we connect LIN pin of chip to vehicle, because OBD connector in vehicle doesn't have LIN pin in it.

2. How to get slave address of ECU's connected via LIN bus, i have gone through specification of LIN protocol didn't get clarity from it.