TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F28386S: How to execute the classic CAN through MCAN module in the Cortex -A4?

Part Number:TMS320F28386S

I want to use the classic CAN communication in the cortex-A4.

First I set the parameters in CPU1.

    // Allocate MCAN (a shared peripheral) to cortex-A4 (C28x)
    SysCtl_allocateSharedPeripheral(SYSCTL_PALLOCATE_MCAN_A,0x1U);

    // Configure the divisor for the MCAN bit-clock
    SysCtl_setMCANClk(SYSCTL_MCANCLK_DIV_4);

    // Configuring the GPIOs for MCAN.
    GPIO_setPinConfig(GPIO_10_MCAN_RX);
    GPIO_setPinConfig(GPIO_4_MCAN_TX);

Then, I configure the parameters in Cortex-A4.

    // Switching on the peripheral.
    CM_init();

    // Reset the peripheral.
    SysCtl_resetPeripheral(SYSCTL_PERIPH_RES_MCAN_A);

    // CrossBar and ISR Configuration.
    MCANIntrConfig();

    //
    // Configure the MCAN Module.

    MCANConfig_Simple();

In the MCANConfig_Simple() function, I referred to the project examples(mcan_ex7_classic_transmit.c) of CPU1 that configured the MCAN to classic CAN. The bit time settings are listed as follows:    //
    // Initialize bit timings.
    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 Range.

However, It doesn't work. I guess that the baud rate of the MCAN is not configured properly, however, I can not find some useful references.

So  please help me about the use of MCAN as classic CAN in Cortex-A4.

And aso I want to ask that if MCAN is configured to CANFD, if the CAN monitor card must support the CANFD communication? 

Thank you very much !

Yale Li:

cortex-A4? Please confirm with this. This series device doesn't have A core.

,

Fang Li:

It has a cortex-A4 core

,

Fang Li:

The problem is that the baud rate is not set properly.The examples are based on the clock of 200MHz.

We should use the clock of 125MHz of Cortex-A4, It should be first divded by SYSCTL_MCANCLK_DIV_5 to derive MCANClk of  25MHz.

Then the Prescalar\TimeSeg1\TimeSeg2 should be selected based on 25MHz. 

,

Yale Li:

I guess you are talking about cortex-M4 core.

I need some time to take look into it. Thanks for your patience.

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F28386S: How to execute the classic CAN through MCAN module in the Cortex -A4?
分享到: 更多 (0)