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.

LAUNCHXL-F280039C: lin_ex7_external_loopback

Part Number: LAUNCHXL-F280039C
Other Parts Discussed in Thread: TMS320F280039C, C2000WARE

Hi all,

I'm trying to run the example "lin_ex7_external_loopback" in target/build configuration "TMS320F280039C_LaunchPad"/"CPU1_LAUNCHXL_RAM", but it doesn't work. The software is looping in while(!LIN_isTxBufferEmpty(LINA_BASE)). So the flag LIN_SCIFLR_TXEMPTY is never set.

The example is imported from C2000Ware version 5.01.00 through Resource Explorer and the code is NOT modified.

On my logic analyzer, I see on the LINA_Tx line the LIN Header only, i.e. Break, Sync (0x55), and PID (0x1A), but the data bytes are missing.

Could someone tell me, please - what is wrong?

Just for info, other examples using internal loopback are working as intended.

Best Regards,

Tenko Yavashev 

  • Hi Tenko Yavashev,

    Thanks for reaching out. Appreciate your detailed explanation.

    There's a minor addition not mentioned in the description that you'd have to do to make the example work with 2 instances on the same device.

    There's a register 'IODFTCTRL' in the LIN module which needs to be configured to see the operation as expected when you're working with 2 instances on same device.

    Please update the registers through the registers view.

    Steps:

    1. Run the example till the execution of LINA module (LIN_initModule(LINA_BASE);), halt the execution after the mentioned line of code is executed using breakpoint.

    2. Open the registers view (View > Registers) and search for IODFTCTRL register in the LINA Registers.

    3. The value at this point should be all 0 in the IODFTCTRL register. Verify the same.

    4. Update the IODFTENA bit to 1010 by manually changing the value through the view directly.

    5. Update the LPBENA bit to 1.

    Run the example till completion and observe the results. You should be able to see successful execution. Note: This change is only to be made in LINA module, not LINB.

    Hope this helps.

    Thanks,
    Aditya

  • Hi Aditya and thank you for the prompt reply.

    I did it by adding LIN_enableExtLoopback(LINA_BASE, LIN_LOOPBACK_ANALOG, LIN_ANALOG_LOOP_TX); just after the LINA initialization line and it works fine.

    But the most important for me is that I understood it :) - connecting the Rx to the Tx line for the data transmitter to "watch" the transmitted header to be able to transmit data properly. So once I connected an external LIN transceiver, this code line was not needed.

    Also, if the LIN transceiver is not connected the code will work fine with an external connection between LINA Tx and Rx lines, instead of enabling it in the code. 

    Best Regards,

    Tenko Yavashev

  • Hi,

    Thanks for your validation and additional inputs. Glad you were able to resolve this.

    Thanks,
    Aditya