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.

TCAN1463-Q1: Configuration to support 8Mbps.

Part Number: TCAN1463-Q1
Other Parts Discussed in Thread: AWR6843AOP,

Dear Team

What configuration is need to support 8Mbps by TC1463-Q?

MCU : AWR6843AOP

CAN TRx : TCAN1463-Q1

Test Application : ti/mmwave_sdk_03_05_00_04/package/ti/drivers/canfd/test/xwr68xx/main.c

testSelection : MCAN_APP_TEST_EXTERNAL_DATA

Nothing is modified except followings.

    /* bit rate configuration */
    /* 1Mhz */
    mcanBitTimingParams.nomBrp      = 0x2U;
    mcanBitTimingParams.nomPropSeg  = 0x8U;
    mcanBitTimingParams.nomPseg1    = 0x6U;
    mcanBitTimingParams.nomPseg2    = 0x5U;
    mcanBitTimingParams.nomSjw      = 0x1U;

    /*5MHz*/
    mcanBitTimingParams.dataBrp     = 0x1U;
    mcanBitTimingParams.dataPropSeg = 0x1U;
    mcanBitTimingParams.dataPseg1   = 0x1U;
    mcanBitTimingParams.dataPseg2   = 0x2U;
    mcanBitTimingParams.dataSjw     = 0x1U;

    while (1)
    {
        /* Send data over Tx message object */
        if (testFrameType == CANFD_MCANFrameType_FD)
        {

            length = 128U;
            if(idIndex > 10)
            {
                idIndex = 0;
            }
            msgId = txMsgObjectParams.msgIdentifier + idIndex;
            Task_sleep(1U);
            while(length > MCAN_APP_TEST_DATA_SIZE)
            {

                retVal = CANFD_transmitData (txMsgObjHandle, msgId, CANFD_MCANFrameType_FD, MCAN_APP_TEST_DATA_SIZE, &txData[0], &errCode);
                length = length - MCAN_APP_TEST_DATA_SIZE;
                Task_sleep(1);
            }
            idIndex++;
        }
        ... blah blah ...
    }

Question.

Because of Task_sleep(1U), it does not meet 8Mbps.

How can I solve this???

Best & Regard

  • Woong,

    Our group did not develop this code and thus we cannot support it. I'm reassigning this thread to the sensors forum where hopefully they can help you out.

    Regards,

    Eric Hackett

  • Hi Woong, 

    Will check internally and get back to you. 

    Regards, 

    Sudharshan K N 

  • Hi Woong, 

    Below is the configuration for the 8Mbps mode. Please let me know if you have further comments. 

    /*8MHz*/

        mcanBitTimingParams.dataBrp     = 0x5U;

        mcanBitTimingParams.dataPropSeg = 0x2U;

        mcanBitTimingParams.dataPseg1   = 0x1U;

        mcanBitTimingParams.dataPseg2   = 0x1U;

        mcanBitTimingParams.dataSjw     = 0x1U;

    Regards, 

    Sudharshan K N 

  • Dear Sudhashan.

    I don't think I asked the question properly. Not enough Information or point of Question, something like that.

    As you can find in "ti/mmwave_sdk_03_05_00_04/package/ti/drivers/canfd/test/xwr68xx/main.c."

    There is some expression like this "Task_Sleep(1)" and it looks like consumption 1 milli-second.

    (In this case for 1 milli-second, 8388kbit can be transmitted, it can be achieved by calculation. )

    For example

    Now I try to send 128bytes data though CANFD which is configured as 8Mbps.

    1. send first part of 128bytes( actual size is 64bytes), and it takes 1/(16x1024) sec, appoximately 61us.

    2. Task_Sleep(1), takes 1ms

    3. sen the rest part of 128 ( actual size is 64 bytes), and it takes 1/(16x1024) sec, appoximately 61us.

    4. To transmit 128 bytes via CANFD, we need 1.122ms.

    5. 128bytes / 1.122ms = 912656 bit/sec (approx.)

    Would you please explain this ?

    Actually, I have to send data of which amount is 3072bytes. ( 64bytes * 48 )

    To avoid above problem, I try to chane the code "Task_Sleep(1)"  , I tried using "SOC_microDelay(N)" 

    If the value of N goes smaller, total time of transmittion goes smaller.

    But, at some point, Data loss takes place.

    For example, 

    1st 64byte was transmitted completely.

    2nd 64byte was transmitted completely.

    3rd 64byte was transmitted completely.

    ...

    10th 64byte was transmitted completely.

    ...

    Nth 64byte was missing

    (N+1)th 64byte was missing

    ...

    Total bytes transmitted is not 3072

    How can fix this? 

    please Kindly check this problem.

    Best and Regard.

    Choi.

  • Hi, 

    the 1 ms sleep is added for the demo purposes only. In the actual application it is advised that the user develops the necessary framework to transmit the data based on data transmit completion over CAN. This can be implemented using separate tasks for CAN TX and RX. The code need to be developed based on the application use case. the code provided in this demo is example only. 

    Regards, 

    Sudharshan K N 

  • Dear Sudharshan

    I understand that Task_Sleep(1) is example code.

    There is another question from your answer.

    I think, this is only CAN Tx task job. I can not understand Rx task as mensioned above.

    My test configured like this : After boot up, Device send 64bytes 48time to PCAN-View in PC. and Power cycling.

    And there is not-explained question still.

    In my guess, to transmit 64byte data, CAN Tranceiver need only 61us.

    followings are pseudocode.

    pseudocode
    
    LoopCnt = 0
    
    Loop Start
    
        CANFD_send(64bytes data) // it takes 61us
    
        WAIT(61us) // wait for send complete
    
        LoopCnt++
    
        if LoopCnt > 48
    
            break
    
    LoopEnd

    In this case, if LoopCnt greater than 20, data loss took place.

    I tested waiting time 61us, 120us 250us 500us

    In case 250us, 500us, transmitionn is complete. but in the other cases, data loss took place.

    check this please

     

     

  • Hi, 

    Let me take a look at it and get back to you. 

    Regards, 

    Sudharshan K N 

  • Hi, 

    Have you tried increasing the sampling rate at the PCAN? Also have you tried doing the tests by connecting to another CAN node on another HW? Please let us know. 

    Regards, 

    Sudharshan K N 

  • Dear Sudhashan

    I did try to test already with pcan which is configured as follow.

    can you let me have hole configuration in MCANAppInitParams() ?

    Best and Regard

    Choi

  • Hi, 

    Let me check and get back to you. 

    Regards, 

    Sudharshan K N 

  • Hi, 

    Can you change mcanCfgParams->darEnable       = 0x1U to 0x0? This will enable automatic retransmissions in case of errors. 

    Regards, 

    Sudharshan K N