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.

CCS/EK-TM4C129EXL: SPI to CAN FD SBC + LIN Transceiver BoosterPack with EK-TM4C129EXL

Expert 1660 points
Part Number: EK-TM4C129EXL

Tool/software: Code Composer Studio

hello all i have ultra sonic sensor with lin protocol and i need to read it's data so i connected SPI to CAN FD SBC + LIN Transceiver BoosterPack from TI with booster-pack1 of EK-TM4C129EXL . 

any recommendations in how to use lin protocol ?

is there any supported C code

  • Hi Ahmad,

    Unfortunately I'm not aware of any supported C code from TI to implement a LIN interface using this device.  You may want to reference the previous discussion in this thread for some more info, though:

    Regards,
    Max

  • We don't have LIN driver C code. The low level functions in TivaWare for the UART can be used to configure the baudrate, send and receive characters. The LIN protocol would need to be implemented in software.

    Here is a good overall LIN application note. If using the TM4C129 as the master node, setting the baud rate is easy. 

    http://www.ti.com/lit/an/slla383/slla383.pdf

  • thanks  and Bob for your informations

    1)Bob sorry but what do you mean by The LIN protocol would need to be implemented in software.

    2)can i use  the existing UART API with the LIN Standard (despite break condition which is a little longer for LIN (14 bit )than it is for standard Uart.)

    i am using  TM4C129 as the master node, how to set the baud rate and sync break for LIN protocol . i followed the http://www.ti.com/lit/an/slla383/slla383.pdf but couldn't find my answers.

    as i mentioned above i am also connected SPI to CAN FD SBC + LIN Transceiver BoosterPack from TI  with TM4C129 in order to use LIN driver , i connected LIN signal data of the sensor with LIN-TERM of the transceiver. and Transceiver BoosterPack  with BoosterPack1 of   TM4C129  (LIN UARX with PC5 (U7Tx) ,LIN UATX with PC4(U7Rx) )

  • Hi AHMAD,

      Bob is out of the office for the rest of the week. As already noted by Bob, the TM4C129 does not support the LIN port. I'm not a LIN expert but I found the below example LIN message format. I think what Bob was saying is that as the UART port receives the character, your software will need to decipher what part of the LIN message it is. Your software will build a software-based state machine. It will first needs to decipher the sync break field and the SDEL fields, perhaps by polling the UART_RX pin for duration specified by the LIN protocol. Once the sync break and SDEL are detected by your software state machine it will move to the next state waiting the UART to receive characters. When the UART receives a character 0x55, your software will need to know that it is part of the sync field coming in the message header. the state machine will again move to the next state waiting for the ID field. When the next UART character is received it will determine what ID field of the LIN message it is intending. I think this is all we can provide in the absence of the LIN support on the TM4C129 device. 

  • Hello Charles,

    thanks so much for the given informations

    i have struggles in how to send the sys break over UART (its 13bit in addition to 1 bit for delimiter)

    like if i have the following LIN frame: Break+Syns(0x55)+PID(0x78)+Data1(0x01)+Data2(0x00)+checksum(0x86);

    and i initialize a byte array to send this packet over uart

    x={break(value),0x55,0x78,0x01,0x00,0x86};

  • Hi Ahmad,

      As you know the UART and the LIN are two different protocols. You can't make a UART frame with 13 dominant bits. I think you might want to consider using a GPIO to create the Sync break field and have an external mux to switch between the GPIO and the UART_TX to drive the LIN_TX pin. 

  • i read in the ek-tm4c129exl datasheet that the uart generate a BREAK
    Register 7: UART Line Control (UARTLCRH), offset 0x02C on page 1310

  • Hi,

      You have found something that I never used before, What did you see when you apply the break command? Looks like you can use the below API to control the break. Please note that you need to assert the break for at least two frames by software according to the datasheet. Let us know how it goes. If you can get it to work then it will benefit the community who are looking for the same solution.