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.

TMS320F28377D: CAN New Data Flag

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

Hello,

I am trying to use the CAN_getNewDataFlags function call. Even though I am transmitting and receiving successfully, it always returns 0. I suspect I may have missed something in the setup, but can't seem to find any information. I have CCS 11.0 and C2000Ware_4_00

        Thanks for your help,

          Dave

  • Dave,

        Is this for a transmit object or a receive object? Can you please provide the code snippet? (not the whole code; just the snippet where the function is used)

  • Hareesh,

    I read the entire register and when I display its contents in the Expressions window in the debugger it is always 0. Mailboxes (objects) 1-16 are transmit (wrt 28377D) and 17-32 are receive. I have included the receive part which is what I am really interested in. I can send data over CAN and it arrives and gets put in the respective variables, but can never see that the CAN_NewD_Flg is ever set.

            Thanks for your help,

                             Dave

    void    CANA_RX(void)
    {
        CAN_getNewDataFlags(CAN_NewD_Flg);
        if (CAN_NewD_Flg && 0xFFFF0000) missed_cnt = 0; //Clear missed count if there is new data for MB 17-32
        else missed_cnt ++; //Increment missed count if no new data
        CAN_readMessage(CANA_BASE, 17, rxMsgData);  //MB 17
        Mode_Req = rxMsgData[0];  //Mode Request is LS byte
        Reset_R =   rxMsgData[1];   //Reset Request is LS+1 byte
        CAN_readMessage(CANA_BASE, 18, rxMsgData);   //MB 18 Ignored
        CAN_readMessage(CANA_BASE, 19, rxMsgData);  //MB 19
        MB_HIGH_to_float32(rxMsgData, HV_Set);
        MB_LOW_to_float32(rxMsgData, LV_Set);
        CAN_readMessage(CANA_BASE, 20, rxMsgData);  //MB 20
        MB_HIGH_to_float32(rxMsgData, HV_I_Set);
        CAN_readMessage(CANA_BASE, 21, rxMsgData);  //MB 21
        MB_HIGH_to_float32(rxMsgData, LV_I_Set);
    }

  • Dave,

       I have requested someone from the S/W team to look into this. Should be Monday or Tuesday before you will get a response. 

  • Hey Dave, 

    The function has been defined as follows: (Definition can be found in can.h file in driverlib)

    static inline uint32_t
    CAN_getNewDataFlags(uint32_t base)

    So to read the flag successfully, code should look like

    CAN_NewD_Flg = CAN_getNewDataFlags(CANA_base);

    Hope that helps.

  • Thanks Sahil, I should have known that, feeling a little embarrassed. That fixed it.

               Appreciate your patience,

                           Dave