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.

TMS570LC4357: LIN Framing error

Part Number: TMS570LC4357

Hi,

I am trying to use the TMS570LC4357 in master mode. I send a header and receive a response from another board (an arduino). However, after a few transmissions I get a framing error and transmission stops. I don't understand why the framing error occurs only after a while? I send the response on LIN bus immediately after I receive the header. Both ends use same baud rate. I don't know the internal of the hercules board and how it detects framing error. I have tried sending reponse with 8N1 and 8N2. Both have same issue. Why the hercules board detects a stop bit error?

Thanks,

S

  • Hello Sa,

    Do you check the bus busy flag or NRE flag before sending the response?

  • Hi QJ,

    This is the sending header from TI board:

    while((!(linIsTxReady(lin))) || (lin->FLR & 0x8U == 0x8U));

    linSetLength(lin, 8U); // + checksum
    linSendHeader(lin, linIdentifier);



    This is receiving the response data in TI board:

    if((lin->FLR & LIN_RX_INT) == LIN_RX_INT)
    {
    linSetLength(lin, 8U);
    linGetData(lin, &entry.data[0]);
    }

    I don't know how to check the status of the bus from arduino side? Is it enough to check that the RX pin of the transceiver is idle? How long should it be idle before I send the response data? I find no information about this on LIN specification.

    Thanks,
    S
  • Hello S,

    I don't know the Arduino part. The bit #3 of SCIFLR register is the bus busy bit. The bus busy flag is set on the reception of the first bit of the header and remains set until the header reception is complete, and again is set on the reception of the first bit of the response.

    The TRM recommends to implement the following sequence:

    1. Once the reception of the header is done (poll for RXID flag), wait for the bus busy flag to get set or NRE flag to get set.

    2. If bus busy flag is not set before NRE flag, then it is a true no response case (no data has been transmitted onto the bus).

    3. If bus busy flag gets set, then wait for NRE flag to get set or for successful reception. If NRE flag is set, then in this case a collision has occurred on the bus.

  • Hi QJ,

    How can I clear these flags in case an NRE or FE error occurs?

    Thanks,

    S

  • Hello S,

    The SCIFLR is SCI flags register. Wring 0 to the bit fields of SCIFLG has no effect, but writing 1 to those bit fields will clear those bit to zero.