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.

TMS470MF06607: CAN received message object id

Part Number: TMS470MF06607
Other Parts Discussed in Thread: HALCOGEN

hi sir,

i am using TMS470MF06607 microcontroller.

i did the CAN communication successfully. i try to receive data from any message object id . i can receive any message object id also.

can you please tell me, from where i can get the received message object id. i want to know the full frame of the received data.

regards

Arun Kumar.N

  • Did you use HALCoGen? If so, you can call the function canGetID() after you call canGetData(). The actual message ID is returned in the IF2ARB register on a read operation.
  • hi sir,

    yes. i am using the HALCOGEN. the halcogen generated the code. in that can.c file canGetID() this function is not available. if i try to use that means i got the error. can you please tell me the solution for this .


    regards
    Arun Kumar.N
  • Would show the lines of code you tried to use? and what error you see?
    Are you using an OS?
  • Hello,

    Please this function to get CAN ID. The code uses IF2 for data RX, and IF1 for data TX.:

    uint32_t canGetID(canBASE_t *node, uint32_t messageBox)
    {
        uint32_t   msgBoxID  = 0U;

        /** - Wait until IF2 is ready for use */
        while (node->IF2STAT & 0x80);

        /** - Configure IF2 for
        *     - Message direction - Read
        *     - Data Read
        *     - Clears NewDat bit in the message object.
        */
        node->IF2CMD = 0x20U;

        /** - Copy data into IF2 */
        node->IF2NO = messageBox;

        /** - Wait until data are copied into IF2 */
        while (node->IF2STAT & 0x80);

        /* Read Message Box ID from Arbitration register. */
        msgBoxID = (node->IF2ARB & 0x1FFFFFFFU);

        return msgBoxID;
    }