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.

IWR1443: Configure the correct parameters on the CAN bus

Part Number: IWR1443

Hi:

I have put the following configuration to the CAN bus to have the 500kbit/s of the Bus Speed and 75% of sample point.

baudRatePrescaler=24;
syncJumpWidth=3;
timeSegment1=11;
timeSegment2=3;
Are those configurations correct?
  • Hi Jianyuan,

    The mmwave SDK CAN driver includes a test utility, with source code, under C:\ti\mmwave_sdk_<ver>\packages\ti\drivers\can.

    The function DCANAppCalcBitTimeParams in main.c, computes the above parameters as shown below. You can refer to this function to understand how to calculate the parameters for your required configuration and also test the desired configuration using the tests provided in this utility.

    /**
     * \brief   This function takes I/P Clk frequency, required bit-rate, reference
     *          sampling point, propagation delayon the CAN bus and calculates the
     *          value to be programmed for DCAN BTR register.
     *          This API doesn't do the actual programming. This is
     *          intended to be used as a utility function. And the application
     *          should call the #DCANSetBitTime function to do the actual
     *          programming.
     *
     * \param   clkFreq       I/P clock frequency to DCAN controller in terms of MHz
     * \param   bitRate       Required bit-rate on the CAN bus in KHz
     * \param   refSamplePnt  Reference Sampling point in terms of %
     * \param   propDelay     Required Propagation delay in terms of ns
     * \param   bitTimeParams  Pointer to params where the calculated register
     *                        fields are populated
     *
     * \return  Returns the error status information as STW_SOK for success and
     *          STW_EFAIL when no valid baudrate calculation possible for the
     *          configured baudrate and propagation delay
     */
    int32_t DCANAppCalcBitTimeParams(uint32_t               clkFreq,
                                    uint32_t                bitRate,
                                    uint32_t                refSamplePnt,
                                    uint32_t                propDelay,
                                    CAN_DCANBitTimeParams*  bitTimeParams)

    Thanks

    -Nitin

  • Great. Thanks for the help.