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.

LAUNCHXL-F280039C: Classical CAN Communication between three nodes; sending data more than 8 bytes on classical CAN

Part Number: LAUNCHXL-F280039C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello TI Team,

I am working on Classical CAN communication, on LAUNCHXL F280039C development boards.

Wanted to test weather a single Node can act as a transmitter and receiver both on CAN network, how can i achieve this. Also trying to send data more than 8 bytes i.e not happening because it has limit of max 8 bytes. Is there any method to do on CCS IDE.

Also in one case if I want to bombard hundreds of  bytes of data from one node, how can I do this.

Regards

Yash

  • Provide example code to configure mailbox at both TX and RX node. 

  • Yash,

    You can use C2000Ware can_ex5_transmit_receive for this evaluation.  You will need to modify the code slightly for the node to be in receive, transmit, or both.transmit/receive.  Also modify it slightly to ensure that message filtering/masking is enabled so that different message IDs can be received.  Example can_ex8_mask.c illustrates the use of ID masking/filtering.

    Regards,

    Joseph

  • Hi Joseph,

    Thanks, node with both transmitter and receiver is configured and working. 

    I wanted some understanding on few things:

    1. What does "ID Mask" mean in CAN_setupMessageObject() API, I am not clear about its used in the API?

    2. In the case for Acknowledgement, do you know how can we make sure that all the data we have sent is been received successfully through an acknowledgement message in any way from the receiving node and also if the message is lost/not received. 

    3. How can we configure mailboxes/message boxes for our transmit/receiver buffer.

    Regards

    Yash

  • Is there any register/ flag/ macro/ ERROR MESSAGE used for Acknowledgement in CCS IDE, that can be watched in debug session. While transmitting or receiving data from other nodes.

  • Yash,

    The current example in can_ex5 transmits/receives only a specific message ID which is only accepting/sending message ID 0x15555555.  If you are to use three nodes, it makes sense to have IDs other than 0x15555555.  For this you would need ID masking which is basically allowing CAN to accept IDs that are not only  0x15555555.  See can_ex8_mask example and give it a try as this example illustrates how to receive multiple message IDs.

    Not sure what you meant about Acknowledgement in CCS IDE, did you mean the ACK that a receiving node sends out when a frame is received?  This will not be visible in CCS.  You can only view this with CAN analyzer or a oscilloscope with CAN frame decoding capability

    Regards,

    Joseph

  • Hi Joseph,

      See can_ex8_mask example and give it a try as this example illustrates how to receive multiple message IDs.

    The masking part is tested and done. 

    did you mean the ACK that a receiving node sends out when a frame is received? 

    Yes, I checked it on oscilloscope, it's visible. 

    Can you please tell me, how can I implement a functionality where the receiving node will acknowledge the transmitting node in case of- 

    (i) data has been successfully received and transmitting node should stop sending data,

    (ii) data that has not been received/lost the receiving node should send the ACK to transmitter node, based on this ACK the transmitter will again transmit the data.

    3. How can we configure mailboxes/message boxes for our transmit/receiver buffer.

    Can you clarify this also.

    Thanks & Regards,

    Yash

  • Hi Yash,

    Can you please tell me, how can I implement a functionality where the receiving node will acknowledge the transmitting node in case of- 

    (i) data has been successfully received and transmitting node should stop sending data,

    (ii) data that has not been received/lost the receiving node should send the ACK to transmitter node, based on this ACK the transmitter will again transmit the data.

    JC: You cannot program this in the receiving node.  ACK is automatically sent by a node when it successfully receives a frame.  If the transmitting node will attempt on resending the CAN frame if it has not received an ACK signal from any node.  Check the transmitting node to make sure it is not in a loop that keeps sending the same frame over and over again.

    3. How can we configure mailboxes/message boxes for our transmit/receiver buffer.

    JC: Use API function  CAN_setupMessageObject().

    Example for a Receive mailbox setup:

    CAN_setupMessageObject(CANA_BASE, MAILBOX1, 0x15555555,CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_RX, 0,CAN_MSG_OBJ_RX_INT_ENABLE, MSG_DATA_LENGTH);

    Example for a Transmit mailbox setup:

    CAN_setupMessageObject(CANA_BASE, MAILBOX2, 0x15555555,CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_TX, 0,
    CAN_MSG_OBJ_TX_INT_ENABLE, MSG_DATA_LENGTH);

    There are 32 available mailboxes which can either be used as receive, transmit or combination of both.

    Regards,

    Joseph

  • Hi Joseph,

    Understood the concept for ACK and mailboxes. 

    There are 32 available mailboxes which can either be used as receive, transmit or combination of both.

    How can i set the mailbox as the combination of both TX and RX. 

    Did you mean this single "CAN_setupMessageObject()" API can be set for both TX & RX?

    Regards,

    Yash

  • Yash,

    Sorry, I did not make this clear.  All 32 mailboxes can be assigned as receive or all 32 mailboxes can be assigned as transmit, or combination of both like 20 transmit and 12 receive.  API "CAN_setupMessageObject()" is used to set mailboxes as RX or TX using either argument CAN_MSG_OBJ_TYPE_RX or CAN_MSG_OBJ_TYPE_TX.

    Regards,

    Joseph

  • Joseph,

    Thanks, all doubts are clear now.

    Regards,

    Yash