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.

RM48L950: RM48 L950AZWT

Part Number: RM48L950
Other Parts Discussed in Thread: HALCOGEN

Hello,

I am following the CAN communication video on YouTube. Can anyone tell me how to configure CAN message ID?

Link for the video:- https://www.youtube.com/watch?v=TrKQN-sor-s

Thanks & Regards,

Prathamesh Yawalkar

  • Hello,

    Communication over the CAN bus is done via CAN frames. The CAN frame consists of CANID or Arbitration ID, CAN Data, and CRC. The CAN ID or arbitration ID is used to identify the message and indicate the message's priority. Frames come in two formats -- standard, which uses an 11-bit arbitration ID, and extended, which uses a 29-bit arbitration ID.

    CAN is a peer-to-peer network. When a CAN node is ready to transmit data, it checks to see if the bus is busy and then simply writes a CAN frame onto the network. The CAN frames do not contain addresses of either the transmitting node or any of the intended receiving node(s). Instead, an arbitration ID that is unique throughout the network labels the frame. All nodes on the CAN network receive the CAN frame, and, depending on the arbitration ID of that transmitted frame, each CAN node on the network decides whether to accept the frame.

    If multiple nodes try to transmit a message onto the CAN bus at the same time, the node with the highest priority (lowest arbitration ID) automatically gets bus access. Lower-priority nodes must wait until the bus becomes available before trying to transmit again.

    On RM48, DCAN IF1ARB or DCAN IF2ARB are used to store the arbitration ID for the message.

    For example:

    canREG1->IF1MSK = 0xC0000000U | (uint32)((uint32)((uint32)0x000007FFU & (uint32)0x1FFFFFFFU) << (uint32)0U);
    canREG1->IF1ARB = (uint32)0x80000000U | (uint32)0x40000000U | (uint32)0x20000000U | (uint32)((uint32)((uint32)1U & (uint32)0x1FFFFFFFU) << (uint32)0U);
    canREG1->IF1MCTL = 0x00001000U | (uint32)0x00000000U | (uint32)0x00000000U | (uint32)0x00000000U | (uint32)8U;
    canREG1->IF1CMD = (uint8) 0xF8U;
    canREG1->IF1NO = 1U;

    Please use HALCoGen for peripheral configuration. HALCOGen includes 2 examples for CAN in polling mode and interrupt mode.

    https://www.ti.com/tool/HALCOGEN