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-F280025C: CAN Mailboxes

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

From what I have experienced during the last month with the CAN examples provided in C2000Ware it does not seems like the Mailboxes (MessageObject's) can be set to receive information from different message identifiers (msgID).

Can I set up a MessageObject (Mailbox) to receive messages from every device on the CAN bus?

Regards,

Wilson

  • Hi Wilson,

    Are you setting up message filtering perhaps and setting the mask bits for the message objects?  If you do not use message filtering and not set up the mask bits, then CAN should be able to receive all messages from every node in the CAN bus.

    Regards,

    Joseph

  • Joseph,

    Thanks for your answer. I am a bit confused because of the msgID field. So, even if I define a specific msgID if I do not set message filtering and mask bits, can that message object(mailbox) still accept any incoming frame?

    Regards,

    Wilson

  • Wilson,

    Yes, if you do not set message filtering and mask bits, theat mailbox or object can accept any incoming frame.

    Regards,

    Joseph

  • Joseph,

    It is not working for me. The following are three different message objects that I set to test:

    CAN_setupMessageObject(CAN_BASE, 1, 0x01FF00, CAN_MSG_FRAME_EXT,
                               CAN_MSG_OBJ_TYPE_RX, 0, CAN_MSG_OBJ_NO_FLAGS,
                               MSG_DATA_LENGTH);

    CAN_setupMessageObject(CAN_BASE, 2, 0x24000FE, CAN_MSG_FRAME_EXT,
                               CAN_MSG_OBJ_TYPE_RX, 0, CAN_MSG_OBJ_NO_FLAGS,
                               MSG_DATA_LENGTH);            // msgID 0x24000FE test to receive from the DiagTool

    CAN_setupMessageObject(CAN_BASE, 3, 0xC00000, CAN_MSG_FRAME_EXT,
                               CAN_MSG_OBJ_TYPE_RX, 0, CAN_MSG_OBJ_NO_FLAGS,
                               MSG_DATA_LENGTH);

    At least I send a message to the exact msgID the message objects are not accepting an income frame. The problem is that we are using dynamic msgID, so our system should be able to accept every income frame without regard to the msgID.

    So, at this point, we are able to process frames that are sent with the msgID 0x01FF00, 0x24000FE, and 0xC00000.

    Am I wrong?

    Regards,

    Wilson

  • Wilson,

    Can you try to OR CAN_MSG_OBJ_USE_EXT_FILTER (_EXT_ is for the extended ID which you are using) with argument CAN_MSG_OBJ_NO_FLAGS like below?

    CAN_setupMessageObject(CAN_BASE, 1, 0x01FF00, CAN_MSG_FRAME_EXT,
                               CAN_MSG_OBJ_TYPE_RX, 0, CAN_MSG_OBJ_NO_FLAGS||CAN_MSG_OBJ_USE_EXT_FILTER,
                               MSG_DATA_LENGTH);

    Since mask is set to '0', then object will accept all incoming frames.  I think this is what you need.  Using dynamic ID should not be a problem.  You can use the mask data (currently '0') as well to filter a range of message IDs to accept based on msgID set.  For instance, if you set mask data to be 0x1FFFFFFF, then object 1 will only accept messages from msgID 0x01FF00.  If you set mask to be 0x1FFFFCFF, then object 1 will only receive messages from msgIDs 0x01FF00, 0x01FE00, 0x01FD00 and 0x01FC00.

    Regards,

    Joseph