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 Communication Not Showing Any Signals

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hello,

I have a few questions about configuration of LIN communication for the TMS570LC4357. I have looked through the documentation for the LIN communication and I am confused as to why I am only seeing any signal changes when calling the linSendHeader() function. I know that the linSetLength() function must be called before sending LIN data with the linSend() function, but does this function need to be called every time, or only when there is going to be a change in the length of data sent? Also, if the maximum number of bytes that can be sent by the linSend() function is 8, how is the checksum supposed to be sent after 8 bytes of data? Is the checksum sent by calling the linSend() function again and manually sending the checksum?

Thank You

  • Hi Lan,

    but does this function need to be called every time, or only when there is going to be a change in the length of data sent?

    No need to be call this function every time and can be call only when there is going to be change in the length.

    Also, if the maximum number of bytes that can be sent by the linSend() function is 8, how is the checksum supposed to be sent after 8 bytes of data?

    Yes, maximum number of bytes that can be sent is 8 only. If you need to send checksum after 8 bytes then you just need to change the length to your checksum length and should send checksum and after sending checksum again you need to reconfigure length to the data length.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    That is what I thought, but even though I have LIN set up in HALCOGEN with the correct baud rate, interrupts enabled, etc. I do not see any activity on the LIN bus except for the header being sent. I've tried both using and not using the linSendWakupSignal() function, made sure to call the linInit() function, but I never see any data sent from the linSend() function. 

    In addition to this, I cannot seem to trigger an interrupt upon receiving a LIN message on the bus from another dev board even though I have called linEnableNotification() and enabled the notifications in HALCOGEN. Is there something else to call besides that function that is necessary for interrupts? 

    I also saw in the technical reference manual that an ID interrupt will be triggered when an ID of 0x3E is received, but later on in the manual it says that setting the RX mask to 0xFF in HALCOGEN and setting HGEN CTRL to 1 (which is what I have set up) will allow a match in all cases. Is there something special about the 0x3E ID? I have also tried getting and ID based interrupt to no avail.

    Thank You,

    Ian

  • Hi Ian,

    That is what I thought, but even though I have LIN set up in HALCOGEN with the correct baud rate, interrupts enabled, etc. I do not see any activity on the LIN bus except for the header being sent. I've tried both using and not using the linSendWakupSignal() function, made sure to call the linInit() function, but I never see any data sent from the linSend() function. 

    I tested below loopback example, and it is working fine, i mean i was able to receive the data into the receive buffers without any issues.

    LIN_Example_LC4357.zip

    Can you please take it as reference and compare your code?

    In addition to this, I cannot seem to trigger an interrupt upon receiving a LIN message on the bus from another dev board even though I have called linEnableNotification() and enabled the notifications in HALCOGEN. Is there something else to call besides that function that is necessary for interrupts? 

    By default, the interrupts will be in disabled state, you should also call the below function to enable the interrupts.

    _enable_interrupt_();

    And also make sure this,

    For LIN1 the default functioning is LIN only so there won't require any pin configurations but if you are using LIN2 then you should also make sure to configure pin to LIN functionality on respective PINS.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thank you very much for the LIN example code. It was a huge help in getting LIN set up for my project.

    I have set up my code similar to yours. The only differences between your code and mine that I have found are that I have the RX interrupt enabled and that my baud rate is 9.6kHz. I managed to both send and receive data, but for some reason I cannot cause an interrupt on the reception of a LIN message. I do not see that _enable_interrupt_() function in the generated code of either my project, or the LIN example project. Are we using the same environments for our code? 

    Thanks & Regards,

    Ian

  • Hi Ian,

    Do one thing,

    Just go through the "Help Topics" section in HALCoGen

    And here there is an example "Lin_Digital_Loopback_Interrupts"

    And follow the step by step instructions given in this example:

    In this example we can see they enabled and using LIN_RX interrupt.

    And you can find the corresponding example code as well:

    Follow the steps and it should work.

    --

    Thanks & regards,
    Jagadish.

  • It worked! Thank you very much. I was able to send & receive data, and trigger an interrupt upon reception of data. Thank you very much for your patience and help.

    Thanks & Regards,

    Ian