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.

TMS320F280039: MCAN_readMsgRam function running too long

Part Number: TMS320F280039
Other Parts Discussed in Thread: C2000WARE

Hi expert,

My customer use MCAN as normal CAN running with 500kbps.

recently they found the function need too long time to finish, I test using TI demo code.

it needs 854  clocks, about 7us. and customer is very busy on CPU loading. do you have an idea on optimizing the time?

I found the rxMsg support 64 data, if they only transmit 8  data, will it needs to dummy read the other 56 data?

if the answer is yes, can we edit the function to 8 data and speed up the function?

BR

Emma

  • Emma, 

    If the module is known to receive 8 byte data throughout, it is possible to set the Rx Buffer Element Size accordingly during initialization. This will speed up the Read function. 

    This can be done by writing to register MCAN_RXESC. 

    If you are referring to the C2000ware example, you can make the following change within the MCANConfig() function in the following line:

        msgRAMConfigParams.rxBufElemSize        = MCAN_RX_BUFF_ELEM_SIZE;
        // Rx Buffer Element Size.
        msgRAMConfigParams.rxFIFO0ElemSize      = MCAN_FIFO_0_ELEM_SIZE;
        // Rx FIFO0 Element Size.
        msgRAMConfigParams.rxFIFO1ElemSize      = MCAN_FIFO_1_ELEM_SIZE;
        // Rx FIFO1 Element Size.
        
        // These macros can be defined as either of the following, based on the application
        //
        // MCAN_ELEM_SIZE_64BYTES or MCAN_ELEM_SIZE_8BYTES

    Thanks.