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.

TMDXRM46HDK: Connecting ISR for CAN Message Received

Part Number: TMDXRM46HDK
Other Parts Discussed in Thread: HALCOGEN, RM46L852

I've created an empty project for the RM46L852 and pointed HalCoGen at the project directory.

Using HalCoGen, I've selected the example code for CAN bus demonstration of interrupt-driven detection of a received message.

The source file name is example_canIntCommunication.c

I used HalCoGen to set up the messages so that CAN1 sends and CAN2 receives message ID 1.

I've already demonstrated for myself that the non-interrupt example works, the interrupt one does not.

I don't see any code for connecting the interrupt function with the interrupt event.

Any hints would be greatly appreciated.

  • Hi Scott,

    1. The CAN1 and CAN2 need to be connected on to the CAN network bus through CAN transceiver.

    2. The interrupt should be enabled:

    There are three "gates" before an interrupt request gets to the CPU:

    • The CAN module that generates an interrupt request has a register to enable each interrupt that it can generate.
    • The Vectored Interrupt Manager (VIM) has registers to allow an interrupt request from a module to be forwarded to the CPU as per the priority scheme (lower channel number first).

              

    • Finally the CPU itself must be configured to respond to the interrupt requests forwarded by the VIM (IRQ or FIQ).

               The IRQ can be enabled by calling the: _enable_IRQ();