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.

TMS320F280049: RXIDMASK setting for LIN

Part Number: TMS320F280049


Hi,

One question about F280049 LIN setting in SPRUI33B.

On below picture, when HGENCTRL = 1, mask = 1 is not used for the filtering criterion. 

On table 27-36, when HGENCTRL is set to 1, it must set RXIDMASK to 0xFF.

How to set it? Thanks.

  • Hi Daniel,

    You can set RXIDMASK to 0xFF by just writing into LINMASK.RXIDMASK register.

    Are you not able to write into it?

    Regards,
    Nirav
  • Hi Nirav,

    The problem is we don't know how to set LINMASK.RXIDMASK and D-Slave-Task byte.

    a. We need to receive only but not respond with two frames 0x01 (PID=0xC1) and 0x06 (PID=0x06).
    b. The reported message has two frames 0x03 (PID=0x03) and 0x05 (PID=0x85).

    At the same time, the example in the manual that seems to be wrong. Is the calculation result not 0x6B?
  • HI Nirav,

    Is there suggestion about above question? Thanks.
  • Hi Daniel,

    Which example are you referring to?

    Regards,

    Nirav

  • Hi Daniel,

    Do you want to do filtering using ID-Byte or ID-SlaveTask byte?

    Just to be clear on my understanding on your point a " We need to receive only but not respond with two frames 0x01 (PID=0xC1) and 0x06 (PID=0x06)"
    - Do you mean that you want to receive only 2 frames with PID=0xC1 and PID=0x06 and filter out the rest?

    Also, can you please provide more details, on point b "The reported message has two frames 0x03 (PID=0x03) and 0x05 (PID=0x85)"?

    Regards,
    Nirav
  • Hi Nirav,

    We changed it based on lin_ex1_loopback_interrupts example.

    Customer control unit is a LIN slave node. They receive the control message from CAR ECM.

    The message written by master has two frames (6 bits), 0×06 (000110b) and 0×01 (000001b), After adding two checking bits, their PID (8 bits) are 0×06 (unchanged) and 0xC1,

    The message read by the master has two ×03 (000011b) and 0×05 (000101b), and their corresponding PID is 0×03 (unchanged) and 0x85.

    What we're doing now is to run send and receive in two separate task. When master writes, it only receive 0×06 and 0×01 two frames. When master reads, it only receive the frame headers of ×03 and 0×05.

    We need set LINMASK.RXIDMASK and ID-Slave-Task bytes to help filter. Sorry for we don't know how to set ID-Slave-Task byte.

    Besides, we want to know the difference between TXMASK and RXMASK?

    Does it use RXMASK to filter when master writes, filter by TXMASK when master read?

    Thanks a lot.
  • Hi Daniel,

    Thanks for detail information. Based on that if I understand correctly the Master is going to write 2 frames i.e. PID 0xC1 and 0x06 which LIN slave node has to read and match to process the data, correct?

    Difference between RXIDMASK is TXIDMASK is whenever their is a match in the ID due to RXIDMASK interrupt for RX will be enable (RXENA flag is 1), and you can process that in RX ISR, whereas if their is a match due to TXIDMASK interrupt for TX will be enable (TXENA flag is 1) and you can process that in TX ISR.

    Yes, RXIDMASK is to filter when Master writes and filter by TXIDMASK when master reads.

    Let me get back with you on how to configure ID-Slave-Task byte in couple of days after checking with experts here.

    Regards,

    Nirav

  • Hi Nirav,

    Thanks for your help. F280049 is slave node, vehicle is master node.

    Customer hope to only receive the frame that is 0xC1 and 0x06, and make response to master when frames is 0x03 and 0x85.

    For other frames, It is filtered and don't to receive.

    The question is how to set TXIDMASK and RXIDMASK separately.

    We find both TXIDMASK and  RXIDMASK will work to filter the frames when working.

    Refer to the below picture, TX also handle the SCIRXSHF register.

    Besides, looking forward more comments about ID-Slave-Task byte configuration later.

  • Hi Daniel,

    From what you described, F280049 acts as a slave node. Based on my understanding:  

    - To receive frame 0xC1 and 0x6, you need to set the LINMASK.RXIDMASK = 0xC7

    - To transmit frame 0x85 and 0x3, you need to set the LINMASK.TXIDMASK = 0x86

    - ID-Slave-Task-Byte needs to be set to 0x1 (i.e. LINID.IDSLAVETASKBYTE = 0x1), whose value is same for RX and TX.

    Please try this out and let me know if you still have any questions.

    Regards,

    Nirav

  • Hi Nirav,

    It can't completely filter the message according to your configuration.  But it can be used to identify the ID in future.

    There is a new question about how to use LIN interruption.

    1.  Can I use LIN_INTERRUPT_LINE0 and LIN_INTERRUPT_LINE1 at the same time?

    2.  Can I use the interrupt vector at the same time, as shown in below table.

    When I send and receive alternately, the send data is incorrect.

  • Hi Daniel,

    Here are answers to  your questions:

    1. No, you cannot get interrupts on both lines at the same time, since the interrupt flags can be mapped to 1 line at a time.

    2. Did not quite understand your questions, but yes you can enable all the interrupt flags at the same time. Any interrupt flag set out of all will give an interrupt to PIE depending on whether mapped to Line0 or Line1. Line0 and Line1 have separate channels mapped on Pie.

    Regards,

    Nirav

  • Hi Daniel,

    Is this issue resolved? If yes, please close this thread.

    Regards,

    Nirav