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.

TMS320F28P650DK: MCAN communication - Issue Receiving Classic CAN

Part Number: TMS320F28P650DK


Hello e2e community, 

I'm working on a project with the TMS320F28P650DK using MCAN to transmit and receive Classic CAN.   Using the demo programs, the device transmits to a CAN analyzer without issue.   The issue comes with the receive operations.   All of the receive (mcan_ex4_receive.c, mcan_ex8_range_filter_receive.c, and mcan_ex10_receive_multiple_buffers.c) compile, run and receive exactly 1 message (verified in memory) but then subsequent data never triggers subsequent ISRs.  Using an MSO, the first CAN frame is transmitted from the analyzer, and ACKd by thr P650.   The next frame is sent, but ignored by the processor, so the analyzer continues just to resent.    The code is running on a Launchpad and configured as per TIs documentation. 

This seems to be a common discussion point on e2e forums and was hoping for some suggestions as the demo code just fails to perform.   

  • Hi Scott,

    Please note that due to the holidays, the expert may be out of office for the next two weeks. We appreciate your patience.

    Kind regards,

    AJ Favela 

  • Hey Scott,

    One thing we found is the current MCAN SDK examples use irrational default bit timing configurations (615MPBS nominal/data bit rate). Can you confirm the bit timing configurations used in your testing? What type of cabling is used to connect the CAN bus nodes together?

    Please refer to this prior post regarding the timing calculations required.
    (+) [FAQ] TDA4VM: CAN: How is bit-rate calculated for CAN - Processors forum - Processors - TI E2E support forums

    TI also provides the below references for calculating the required bit timing parameters based on the systems CAN bus requirements/implementation.

    Calculator for CAN Bit Timing Parameters - https://www.ti.com/lit/sprac35

    MCAN Bit Timing Calculator - /cfs-file/__key/communityserver-discussions-components-files/171/MCAN_5F00_BitTimingCalculator-for-classic-example.xls

    Best Regards,

    Zackary Fleenor

  • Hi Zackary,


    Thanks for these resources.  I will have a look at them.  For the timing, the parameters are as defined in the sample applications:

        bitTimes.nomRatePrescalar   = 0x3U; // Nominal Baud Rate Pre-scaler.
        bitTimes.nomTimeSeg1        = 0x9U; // Nominal Time segment before SP
        bitTimes.nomTimeSeg2        = 0x8U; // Nominal Time segment after SP.
        bitTimes.nomSynchJumpWidth  = 0x8U; // Nominal SJW
        bitTimes.dataRatePrescalar  = 0x1U; // Data Baud Rate Pre-scaler.
        bitTimes.dataTimeSeg1       = 0x9U; // Data Time segment before SP
        bitTimes.dataTimeSeg2       = 0x8U; // Data Time segment after SP
        bitTimes.dataSynchJumpWidth = 0x8U; // Data SJW

    I'm running at 200 Mhz with SYSCTL_MCANCLK_DIV_5.

    Both the p650 and 28388 transmit fine with these parameters.  On reception (using the different provided code), receive one message correctly but then never re-trigger on new data.   The length of the bus is less than 10 cm, straight wire and are correctly terminated.  

    On the 28388, it seems that clearing the MCAN_clearNewDataStatus after reading the data from RAM allows it to make progress but will still randomly just stop acknowledging.  For the p650, this didn't make any difference.

    Any direction would be appreciated.

    Thanks!

  • Hey Scott,

    Thanks for confirming this information. I would suggest redefining the timing parameters based on the values provided by the calculator for your specific expected nominal and data bit rates. Don't rely on the default values provided in the examples.

    Can you also confirm the timing parameters of the MSO or whatever tool is being used to send/monitor the CAN bus?

    Best Regards,

    Zackary Fleenor