Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

TMS320F280039C: Question on LIN RX/TX/IDSLAVETASK Calculation

Part Number: TMS320F280039C

Dear whom may it concern,

I am having problem setting RX/TX/IDSLAVETASK for my LIN communication.

I found a thread calculating 1 RX and 2 TX mask ID.

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/903676/tms320f280049-rxmask-calculation-issue-when-using-a-lin/3340637?tisearch=e2e-sitesearch&keymatch=LIN%25252525252520IDSLAVETASKBYTE#3340637

However, I need to calculate 2 RX and 3 TX mask ID.

Below pic is what I have so far.

I have no idea what to do with TXMASK and I am not sure if I got RXMASK AND IDSLAVETAKEBYTE correct.

If there is any document that I can refer to this problem, please let me know.

Also I want to know the formula to calculate RXMASK / TXMASK / IDSLAVETASKBYTE.

Thank you.

Sincerely,

Min Oh

  • Hi Min,

    Thanks for your question. Could you provide whether or not you're wanting your master device to transmit frame as a publisher (meaning it has BOTH PID and Data Byte sent)? Or if you're wanting the master device to only send PID (and wait for response without sending any data bytes)?

      

    Regards,

    Vince

  • Hi, Vince

    My master device is sending both PID and Data Byte.

    Thank you for your quick answer.

    Sincerely,

    Min Oh

  • Hi Seongmin,

    Thanks for your follow-up. So I've attached an Excel version of the mask calculation for your use. Please note, it is UNTESTED AND UNVERIFIED. This should not be used in production without thorough review and testing.

    It visualizes how the masks affect the reading of the ID bytes, and how it compares it to the TASKBYTE. Basically, this is a way to visualize what is happening and to show the formulas used. Again, I do not verify that any of these formulas are 100% correct. But this should be a good starting point for understanding how the masks work.

    /cfs-file/__key/communityserver-discussions-components-files/171/lin_5F00_mask_5F00_calculation_5F00_updated.xlsm

    Regards,

    Vince

  • Hi, Vince

    Thank you for your kind solution.

    However, the rx mask filter pass through 0x37 when I calcuate as below.

    Please let me know if I am using the calculator wrong.

    Thank you.

    Sincerely,

    Min Oh

  • Hi Min,

    Did you modify the calculator at all? My calculator is showing different than what you have taken screenshot of:

    Regards,

    Vince

  • Hi, Vince

    For the setting [slave: F7, rx: F7, tx: F5], my code works as below.

    For this setting, all tx settings are irregularly responding.

    TX masking occationally pass through ID 12, 37, 22 where I want it to respond regularly.

    And for setting [slave: F7, rx: F6, tx: F5], my code works as below.

    For this setting, TX ID 12, 22 respond regularly, but ID 37 is irregularly responding.

    I am using below code to check and build TX frame.

    Please let me know if I am doing something wrong.

    Thank you.

    Sincerely,

    Min Oh

  • Hi Min Oh,

    I am not sure what you mean by the following:

    For this setting, all tx settings are irregularly responding.

    TX masking occationally pass through ID 12, 37, 22 where I want it to respond regularly.

    The way you have defined the TX masks originally, what you mentioned is happening is the correct functionality.

    TX mask is supposed to pass through all three IDs: 12, 22, 37. Any of these three IDs will pass through the TX mask. Isn't that the original request in this thread? That is how the mask is supposed to work. Anything that passes through the mask (12, 22, 37) will trigger the TX.

      

    How do you want these to actually respond?

      

    Regards,

    Vince

  • Hi, Vince,

    If you look at the picture #1, each frame is responding 100 ms period.

    Since there are 5 frames (2 RX / 3 TX) it should be responding every 500 ms as you can see in the Time stamp.

    However, the RED Transmit Error is happening for TX ID : 12 / 22 / 37(marked as yellow) where I want it to be responding regularly on frame request(100 ms).

    Picture #1 is [slave: F7, rx: F7, tx: F5] setting.

    [Picture #1]

    On the other hand, if you look at the picture #2, it is responding to Tx ID (12 and 22) regularly (marked as blue) but 37 is responding irregulary(marked as yellow).

    Picture #2 is [slave: F7, rx: F6, tx: F5] setting.

    [Picture #2]

    I am wondering if I have set my setting wrong.

    I was trying the second option because first option was not working.

    Below is my lin setting.

    Please tell me if I have set something wrong in order for your mask to work correctly.

    Thank you.

    Sincerely,

    Min Oh

  • Hi Min,

    Thanks for your follow-up. Based on the picture you have, you actually want the "Solution - 1 or Solution - 3" options for Slave/Rx/Tx: IDSLAVETASKBYTE=0x13, RXMASK=0xE4, TXMASK=0xF5. This is because that section of the calculator is for when the master sends transmit frame as a subscriber (Only has PID). Your LIN frames appears to be "master as subscriber", not "master as publisher".

    "Solution - 2" is master as Publisher, so it won't work for what you're doing. Please use the "Solution - 1 or Solution - 3" options instead.

    Regards,

    Vince