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.

Compiler/TCAN4550EVM: How to configure 250K CAN speed(for J1939) on TCAN4550EVM?

Part Number: TCAN4550EVM

Tool/software: TI C/C++ Compiler

Hi,

I have traced "TCAN455x Driver Library Demo (Rev. A)" software and implemented CAN initialization on TCAN4550EVM.

In above demo code, the default setting of CAN bus speed is 500K.

How to modify related parameters for 250K?

Regards,

Ethan

  • Hi Ethan, 

    You can change the  effective data-rate by altering the bit rate prescaler value or editing the number of time quanta before and after the sampling point. This can be done by using the values of the TCANNomTiming and TCANDataTiming (for CAN FD) enum variables in the Init_CAN() function. The resulting data-rate can be calculated as follows:

    TCAN_Timing = ( (40E6 / BitRatePrescaler) / ( TqBeforeSamplePoint + TqAfterSamplePoint) )

    For example, plugging in the default values gives us what is written in the comments: 
    // 500k arbitration with a 40 MHz crystal ((40E6 / 2) / (32 + 8) = 500E3)

    To modify these parameters for a 250k nominal timing, we could increase the prescaler to 4. 
    // 250k arbitration with a 40 MHz crystal ((40E6 / 4) / (32 + 8) = 250E3)

    Let me know if you have any other questions.

    Regards,
    Eric

  • Hi Eric,

    I have tried and it works.

    Thanks for your help.

    Regards,
    Ethan