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.

TMS320F280049: CAN Disable TxIE

Part Number: TMS320F280049

I want to only use one CAN module, just Cana, not A and B. But every time that the CAN module transmits, the interrupt is serviced. This is done even though I do not enable TX interrupt (CAN_MSG_OBJ_TX_INT_ENABLE). As shown below I set no flags for Tx and enable Rx interrupt. These come straight from the can_ex3_eternal_transmit example, except I have changed them to both be CANA. Originally Rx was CANB. I took that example code and changed anything that said CANB to CANA. Everything works except the interrupt is serviced at every transmit, which I do not want. I don't want to use 4 pins (8, 10, 32, and 33) for CAN. So I want to only use one module but only let Rx trigger an interrupt.

CAN_setupMessageObject(CANA_BASE, TX_MSG_OBJ_ID, 0x95555555,CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_TX, 0, CAN_MSG_OBJ_NO_FLAGS, MSG_DATA_LENGTH);

CAN_setupMessageObject(CANA_BASE, RX_MSG_OBJ_ID, 0x95555555,CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_RX, 0,CAN_MSG_OBJ_RX_INT_ENABLE, MSG_DATA_LENGTH);

  • Hi Ian,

    The can_ex3_external transmit example requires both CAN A and CAN B to connect to the CAN bus through the transceivers.  CAN A will be transmitting data while CAN B will be the receiving node.  Based from what you stated, you replaced all instances of CAN B with CAN A and with this my interpretation is that your intent is to transmit and receive data to the CAN bus using only CAN A - or I might be missing something else. Can you please give clarity in what you are trying to do?  Once this is clarified, then we can try to figure out your CAN interrupt issues.

    Thanks and regards,

    Joseph

  • Joseph,

    Yes, that is my intent, to use one module to receive and transmit. I've done it before with the F2803x using Example_2803xECanBack2Back. This example used one module 'ECana' to receive and transmit. Our company designed our PCB using the F2803x and later updated to the F280049. I understand that ECAN and DCAN are very different. However the F28004x datasheet makes it appear as if the interrupt can be controlled separately by receive and transmit. Below are three clippings which led me to believe that.

    27.6.1) Message object interrupts are generated by events from the message objects. They are controlled by the flags IntPND, TxIE and RxIE

    27.11.1) If the TxIE bit is set, the IntPnd bit will be set after a successful transmission of the message object.

    27.11.3) If the RxIE bit is set, the IntPnd bit will be set when a received data frame is accepted and stored in the message object.

    By not setting TxIE, I believed that an interrupt would not be triggered upon transmit.

    We only want to use 2 pins and one CAN module as we did with the previous microcontroller. If we had to use two CAN modules, this would require us to have two CAN transceivers, which is not an option. We are limited to using only CAN A. Everything is working fine on just CAN A, with the only issue being that the interrupt is triggered on transmit. This is not catastrophic, simply undesired.

    Thank you for your assistance,

    Ian

  • Joseph,

    I have resolved the issue. I did not read a line of code well. In the example code, the interrupt was triggered with each Status change.

    //! This flag is used to allow a CAN controller to generate status

    //! interrupts.

    #define CAN_INT_STATUS             (0x00000004UL)

    CAN_enableInterrupt(CANA_BASE, CAN_INT_IE0 | CAN_INT_ERROR | CAN_INT_STATUS);

    All I had to do was comment the highlighted text out. This was enabling interrupt for every time that CAN transmitted and received.

    Thank you for your assistance,

    Ian