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.

CCS/TM4C1294NCPDT: [VERY URGENT] CAN bus doesn´t run at 500KHz

Part Number: TM4C1294NCPDT

Tool/software: Code Composer Studio

Good morning,

I got the Evaluation Board Tiva C Series TM4C1294XL, I´m using the BIOS operating system (without any Task) to run a sample code

that send periodically a CAN message on the Can1 peripheral. I set the external clock at 120MHz for the microcontroller.

The Can bus communication works properly up to 250KHz, but runs crazy oscillating without control if the CAN speed is set to 500KHz.

I tried to set-up also the Bit time using the following parameter:

    psClkParms.ui32Phase2Seg = 4;
    psClkParms.ui32QuantumPrescaler = 20;
    psClkParms.ui32SJW = 2;
    psClkParms.ui32SyncPropPhase1Seg = 7;
    CANBitTimingSet(_baseAddress,&psClkParms);

but still nothing.

Could someone be so gentle to find the issue? Or if already experienced by someone. 

  • Have you tried using the default timings for 500K baud. If you call

        CANBitRateSet(CAN0_BASE, ui32SysClock, 500000);
    

    without calling CANBitTimingSet(), (assuming ui32SysClock is 120000000) you get these settings:

  • Hi Bob. Thank you so much for the fast response.

    I checked the values of the CAN_BIT register and they are the default ones, as in the picture you showed.

    I also called CANBitRateSet(CAN0_BASE, ui32SysClock, 500000);

    So I think there could be another problem, or a proper setting of the register CAN_BIT missing.

    Looking forward to your answer.

    Thanks!!
  • Have you looked at the waveforms of the CANH and CANL signals on the CAN bus with an oscilloscope? It may be a physical bus limitation.
  • I would also check three things:
    1. Does the CAN tranceiver chip support this baud rate?
    2. Have you exceeded the maximum bus length for the baud rate you are attempting?
    3. Have you terminated both ends of the bus using 120 Ohm resistors?

    All of the above can limit your slew rate on the CAN bus and cause problems with your signaling.
  • Hi! Thanks for the answers.
    The bus is connected properly with the 120 Ohm termination resistor, and the bus has very short length.
    The baud rate cannot be a limitation, and the transceiver also support this speed.
    The problem is that the peripheral works properly up to 250Kbaud. But start crazily oscillating at 500kbaud.

    The best solution could be if you are able to provide me a very sample example project in Code Composer
    using the TM4C1294NCPDT microcontroller on the Tiva Series C dev. board, that send a message at 500kbaud.

    I hope to not seem to much pretentious, Bob, but if you can provide me this sample example project for the

    EK-TM4C1294XL launch pad could solve any doubts...

    Very glad to be helped by you.

    I hope to solve this issue soon.

    Thanks a lot.

  • Sorry, for the delay. I meant to setup a network and get logic analyzer pictures but have just not had the time this week. I am attaching a simple project that transmits messages at 500K baud.

    /cfs-file/__key/communityserver-discussions-components-files/908/CAN_5F00_simple_5F00_tx.zip

  • Hi Bob,

    Thank you so much for your help and support. Very helpful to have the example project. At the end I manage to configure everything correctly and make the communication working.

    Have a beautiful day.

    Best Regards,

    Dario Patruno