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: how to get the received CAN data id

Part Number: TMS470MF06607
Other Parts Discussed in Thread: HALCOGEN

hi ,

i am using TMS470MF06607 microcontroller. i generated the startup code using the HALCOGEN CODE GENERATOR.

i make my code to receive all CAN id data's. i disabled the masking .

i get the data properly. but i dont know how to get the id of that particular data.

can you please suggest me how can i get the receiving data id.

note

what ever the code generated by the halcogen in that one i don't have any functions like  canGetID() .

regards

Arun Kumar.N

  • HalCoGen should have created a function (canGetID). FYI, 11bit IDs are supplied left shifted 18 bits.
  • Hello Arun,

    This is the function to read CAN ID:

    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;

    }

  • hi,


    thank you for your valid suggestion. it's help's a lot.


    thanks & regards
    Arun Kumar.N