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.

CAN identifier and messagebox

Other Parts Discussed in Thread: HALCOGEN

Hello,

I'm using the Hercules Safety MCU XRM57LHDK.

I'm using standard identifier (11 bits) and I've configured the CAN1 interface in HalCoGen and messagebox1: id = 0x301 and mask  = 0x000003FF.

I can detect frames with ID = 0x301, but I want to change the identifier and DLC dynamically, because I need more than 64 different identifiers (there are 64 messageboxes defined in HalCoGen). And it's not practical to edit all 64 messageboxes.

What is the solution to this problem? I think I've to make changes in the IF1ARB register, but I'm not sure.


Is there anyone who has a possible solution? It would be very appreciated.

Kind regards,

Jason

  • Hi Jason,

    Below post may be of help to you.

  • Hello Vishwanath Reddy,

    Thanks for the link.

    I found my problem. I'm using 11 bit identifier. So when i want for example 0x291 as identifier, I have to shift it 18 bits to the left, just like this:

    canUpdateID(canREG1, canMESSAGE_BOX2, 0x291 << 18);

    But I wanted the messagebox the be in transmit mode so I had the change the direction bit to.
    I changed the code to:

    canUpdateI(canREG1, canMESSAGE_BOX2, 0xA91 << 18);

    And it works! When I transmit data from canMESSAGE_BOX2, I receive a response from the sensor.
    Now I can dynamically change the identifier from each messagebox.

    Thanks for your help.

    Kind regards,
    Jason