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.

LP-MSPM0G3507: Setting datarate for MCAN

Part Number: LP-MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG, TCAN3403

I'm having trouble setting the datarate for the MCAN peripheral on the LP-MSPM0G3507.  I'm currently using SDK 0.50 due to a CAN issue in the most current SDK.  I started with the TX and RX projects from the SDK which will talk to each other at the 256kbps/2Mbps rate of the demo. Both demos use these MCAN settings:

/*
 * Configure Nominal Bit Rate to 250 kbps and Data Bit rate to 2 Mbps
 * nominal_tq = ((nomRatePrescalar +1)/(CANCLK)) = 83.33 ns
 * length_of_nominal_bit_time =
 *            (nomSynchJumpWidth + nomTimeSeg1 + nomTimeSeg2) * nominal_tq =
 *            (3 + 20 + 25) * 83.33ns = 4 us
 * Nominal_Bit_Rate = (1/length_of_nominal_bit_time) = (1 / 4us) = 250 kbps
 *
 * data_tq = ((dataRatePrescalar +1)/(CANCLK)) = 41.66 ns
 * length_of_data_bit_time =
 *            (dataSynchJumpWidth + dataTimeSeg1 + dataTimeSeg2) * data_tq =
 *            (3 + 5 + 4) * 41.66 ns =  500 ns
 * Nominal_Bit_Rate = (1/length_of_nominal_bit_time) = (1 / 500 ns) = 2 Mbps
 */


static const DL_MCAN_BitTimingParams bitTimes = {
    /* Nominal Baud Rate Pre-scaler. */
    .nomRatePrescalar = 0x3U,
    /* Nominal Time segment before sample point. */
    .nomTimeSeg1 = 0x14U, // 20U
    /* Nominal Time segment after sample point. */
    .nomTimeSeg2 = 0x19U, // 25U
    /* Nominal (Re)Synchronization Jump Width Range. */
    .nomSynchJumpWidth = 0x3U,
    /* Data Baud Rate Pre-scaler. */
    .dataRatePrescalar = 0x1U,
    /* Data Time segment before sample point. */
    .dataTimeSeg1 = 0x5U,
    /* Data Time segment after sample point. */
    .dataTimeSeg2 = 0x4U,
    /* Data (Re)Synchronization Jump Width. */
    .dataSynchJumpWidth = 0x3U,
};

The 0.50 SDK does NOT support the sysconfig tool so only manual changes are available.  I did load the TX project from the 0.57 SDK which does support sysconfig to get the values it computes.  The two 0.5 vs 0.57 SDKs do not agree on parameter values especially when it comes to "...SyncJumpWidth".

Anyway, the datasheet says that the MCAN peripheral can get to 5Mbps but the SYSCONFIG tool throws an error when I try to get 5Mbps numbers.  The fastest I was able to manually get the transmit to go was this:

static const DL_MCAN_BitTimingParams bitTimes = {
    /* Nominal Baud Rate Pre-scaler. */
    .nomRatePrescalar = 3U,
    /* Nominal Time segment before sample point. */
    .nomTimeSeg1 = 11U,
    /* Nominal Time segment after sample point. */
    .nomTimeSeg2 = 10U,
    /* Nominal (Re)Synchronization Jump Width Range. */
    .nomSynchJumpWidth = 3U,
    /* Data Baud Rate Pre-scaler. */
    .dataRatePrescalar = 0x0U,
    /* Data Time segment before sample point. */
    .dataTimeSeg1 = 6U,
    /* Data Time segment after sample point. */
    .dataTimeSeg2 = 5U,
    /* Data (Re)Synchronization Jump Width. */
    .dataSynchJumpWidth = 0x3U,

This is a 500Kbps header with datarate being 48Mhz/(14)=3.43MHz.  Any faster and the transmit seems to lock up after the header part of the message.

Is there an app note for setting these values?  The SyncJumpWidth doesn't seem to affect the datarate with my limited testing.  I would like to run the MCAN interface at its maximum rate for testing purposes.

My setup is two LP-MSPM0G3507 dev kits with two TCAN dev kits with TCAN1057AVDRQ1 8Mbps CAN IC's populated in them.

**Attention** This is a public forum