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.

TM4C1294KCPDT: CanBus interrupt for Object Number

Part Number: TM4C1294KCPDT

Hi,

I am trying to improve my canbus knowledge but I have a question for canbus object number.

I want to use only 0x180 - 0x18F , 0x280 - 0x28F, 0x380 - 0x38F, 0x480 - 0x48F

My problem is;

For 0x180 only one time interrupt calls and second one never

For 0x280 only one time interrupt calls and second one never

For 0x380 only one time interrupt calls and second one never

For each 0x480 always interrupt calls until 0x48F message.

Why my code acted like this?

Thanks in advance

my object identifier code is

        setCANMSG.ui32MsgID = 0x180;
        setCANMSG.ui32MsgIDMask = 0xFF0;
        setCANMSG.ui32Flags= (MSG_OBJ_RX_INT_ENABLE|MSG_OBJ_USE_ID_FILTER);
        setCANMSG.ui32MsgLen = 8;
        ROM_CANMessageSet(BASE_CANBUS,5,&setCANMSG,MSG_OBJ_TYPE_RX);
        
        setCANMSG.ui32MsgID = 0x280;
        ROM_CANMessageSet(BASE_CANBUS,6,&setCANMSG,MSG_OBJ_TYPE_RX);

        
        setCANMSG.ui32MsgID = 0x380;
        ROM_CANMessageSet(BASE_CANBUS,7,&setCANMSG,MSG_OBJ_TYPE_RX);
        
        setCANMSG.ui32MsgID = 0x480;
        ROM_CANMessageSet(BASE_CANBUS,8,&setCANMSG,MSG_OBJ_TYPE_RX);

and my interrupt handler code is below;

tCANMsgObject canIntObj;

    uint8_t data[8];
    
    canStatus = CANIntStatus(BASE_CANBUS, CAN_INT_STS_CAUSE);
    
    
    if( canStatus == CAN_INT_INTID_STATUS)
    {
        ROM_CANEnable(BASE_CANBUS);
        canStatus = ROM_CANStatusGet(BASE_CANBUS, CAN_STS_CONTROL);
       CANIntClear(BASE_CANBUS, canStatus); 
       
    }
    else 
    {   
        
        canIntObj.pui8MsgData=data;
        objStatus = CANIntStatus(BASE_CANBUS, CAN_INT_STS_OBJECT);
        ROM_CANMessageGet(BASE_CANBUS, canStatus, &canIntObj, 0);
        CANIntClear(BASE_CANBUS, canStatus);
        CheckCanControl(&canIntObj);
    }       

  • Have you seen the example in: "C:\ti\TivaWare_C_Series-2.1.4.178\examples\peripherals\can\simple_rx.c"? You seem to have added some complexity that does not make sense to me. You should not need a call to "ROM_CANEnable() in the interrupt service routine. Are you seeing errors received in the interrupt routine? Have you verified that the CAN ID's you expect are actually being transmitted on the bus?
  • Hi Bob,

    I did not see error flag. My first receive for 0x180 message I got first 0x8000 for canStatus and than I got 5 for canStatus.. For second 0x180 message I onlu got 0x8000 which means successfully rx.

    I used Rom_ because only works well with that library.
    As I mentioned before I could get 0x480, 0x481...0x48F many times but 0x180, 0x280, 0x380 I got these messages for only one time.
    It did not make sense.