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.

TMS320F28379D: DCAN - how to receive all message IDs? Can receive a particular one, but not when it changes.

Part Number: TMS320F28379D
Other Parts Discussed in Thread: TMS320F28335, C2000WARE

Hello,

I am working on implementing CAN in a custom board.  The custom board i(with TMS320F28379D) s connected through CAN to an older custom board containing TMS320F28335.

I can receive and transmit CAN messages, but when I changed the Message ID to a different one, I cannot receive it anymore.

This is the setup:

CAN_setupMessageObject(CANA_BASE, objID, CAN_RX_MSG_ID,
CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0x0,
CAN_MSG_OBJ_RX_INT_ENABLE, MSG_DATA_LENGTH);

So I can vary CAN_RX_MSG_ID to various values and will be able to receive messages with that particular message ID. 

My understanding though with the message ID mask of 0x0, any message ID will be received.  Where is the setting to ignore message ID?

Thank you.

  • My understanding though with the message ID mask of 0x0, any message ID will be received.  Where is the setting to ignore message ID?

    Your understanding is correct. There is no "setting" as such. All you need to is to write a "0" in all the mask bits. Please take a look at C2000ware example can_ex10_Mask.c. Explanation can be found in my Application report http://www.ti.com/lit/sprace5

  • Hareesh,

    Thank you so much for replying.  I have read through your Application report, as well as the examples (can_ex10_mask.c as well as the other CAN examples).  I still cannot get it to receive whatever message IDs.

    In your ex10.c:

    CAN_setupMessageObject(CANA_BASE, RX_MSG_OBJ_ID, 0x1F9FFFFA,
    CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_RX, 0x1F000000,
    (CAN_MSG_OBJ_USE_ID_FILTER | CAN_MSG_OBJ_NO_FLAGS),
    MSG_DATA_LENGTH);

    That means message IDs of 0x1Fxxxxxx  will be accepted, correct?  

    If  the flags does not have CAN_MSG_OBJ_USE_ID_FILTER then does it matter what the mask (0x1F000000 in the example) or the message ID (0x1F9FFFFA in the example) are?

    Thank you.

  • That means message IDs of 0x1Fxxxxxx  will be accepted, correct? 

    Correct. Are you not seeing this?

    If  the flags does not have CAN_MSG_OBJ_USE_ID_FILTER then does it matter what the mask (0x1F000000 in the example) or the message ID (0x1F9FFFFA in the example) are?

    The mask does not matter but the MSGID matters. If you don't use the mask, then the MSGID of the received frame must match bit-for-bit with the MSGID stored in the message object.

  • Hareesh,

    Thank you!  I thought if the flag does not have CAN_MSG_OBJ_USE_ID_FILTER, and message ID mask is 0 that means no filtering, all message IDs being received.  It turns out that I need to have that in the flag and put message ID mask 0.

    This works:

    CAN_setupMessageObject(CANA_BASE, RX_MSG_OBJ_ID, CAN_RX_MESSAGE_ID,
    CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0x00000000,
    (CAN_MSG_OBJ_RX_INT_ENABLE | CAN_MSG_OBJ_USE_ID_FILTER), MSG_DATA_LENGTH);

    Thank you so much for your help!