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
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.
Many Thanks Kevin!
any other help?
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!
Can you specify the problem you are having?
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.
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.
yeah,I am still engage in the LIN send &receive part, could you share your program or flow chart?
Hello. my code is still very much work in progress, but i have every thing working
My rough flow chart is above, let me know if your still having difficulty.
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?
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,
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?
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.
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 ...
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. :)
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
I'm looking for a basic LIN master implementation, if anyone has anything they can share that would be greatly appreciated.
Please log in to post a reply.
mbed, the fastest way to prototype with ARM based microcontrollers.
^ back to top