This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LIN Driver

Hi ,

We are creating a project on the Tiva TM4C123GH6PZI / Stellaris LM4F232H5QC ,which should have LIN bus for communication , the physical layer interface with the micro controller is done by an TPIC 1021 chip from TI , is there any software API/Driver Library to interface this controller with the LIN bus on firmware using 'c', the controllers UART as is doesnt support LIN mode as suggested by this post . Any suggestions on how to implement LIN on firmware using 'c'??

Regards

Abhay

  • Abhay,

    According to this document (http://www.ti.com/lit/an/spma035d/spma035d.pdf) section 14.1 LIN is supported on the TM4C123 product line. However upon further digging I cannot find a chip that supports it. It appears that the initial intent was to support LIN but somewhere between planning and production it got removed. As it stands there is no hardware support for LIN, though you may be able to emulate the functionality through software via the UART since it is a serial channel.

    Regards,

    -Austin

  • Austin,

    I guess that leaves us with no choice except to do things on the firmware side and emulate LIN , does TI have its version of the standard LIN API's for Tiva micros , if it does please provide a copy with some examples , if not please provide some examples for emulating LIN through the UART or at least let me know where i may find them .

    Regards

    Abhay

  • Abhay,

    To the best of my knowledge there are no LIN API's as part of Stellarisware/Tivaware. I do not have any examples. I would suggest using the existing UART API with checks for the LIN Standard. From the breif reading I've done it looks like LIN is just a specialized serial packet, so you should be able to use the UART to do LIN, youw ill just need extra checks for headers, tails, and any other special formatting. All that falls to you.

    Best of luck,

    -Austin

  • I will be facing the same issue. So far the only challenge I see is creating the break condition which is a little longer for LIN than it is for standard Uart. It should probably work to temporarily lower the Baudrate and sending a 0xff. As I have seen in online examples changing the Baudrate on the fly should be no issue.

    Maybe TI wouled be so kind as to comment on my thoughts.

  • Hello Martin,

    Yes, the Baud Rate can be changed on the fly. But to be on the safer side, it would be good to disable the Transmitter, change the baud rate and then re-enable it.

    Regards

    Amit

  • Martin Bertsche said:
    challenge I see is creating the break condition which is a little longer for LIN than it is for standard Uart.

    Might the addition of this vendor's mini logic, "Or gate" - one input driven by UART_TX & the 2nd by a GPIO - resolve your "widened, break condition" - w/out MCU peripheral nor SW protest?  (same can be accomplished via 2 switching diodes & pull down R - although signal will not be as neat/clean.)

    This method "trades" hardware addition for "intact" UART SW.

  • I am assuming from your discription you are acting as the LIN master?  As I recall the spec the slaves had to measure and adapt to the master's baud rate.

    Robert