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.

TMS320F280025: LIN as UART examples codes

Part Number: TMS320F280025
Other Parts Discussed in Thread: C2000WARE

Dear Champs,

I am asking this for our customers.

It seems there is no example codes of LIN on F28002x on C2000ware.

If so, why is there no LIN example codes on C2000ware?

In my understanding, F28002x LIN should be same as F28004x LIN.

There are F28004x LIN example codes, but there are no F28002x ones.

Can the user refer to F28004x LIN example codes and driverlib?

Is there any concern?

Because F28002x has only one SCI, it's critical to have LIN as UART example codes if the user wants more than one SCI/UART.

Wayne Huang

  • Hi Wayne,

    For now, the customer can refer to the F28004x LIN example codes. 

    These examples need to be ported to F28002x and will be mostly probably done in the future release of C2000Ware

    Best Regards

    Siddharth

  • Dear Siddharth,

    Would you please show us what they will need to take care when they port F28004x LIN example codes onto F28002x example codes?

    We are confused if it is very intuitive given the LIN module is same, why did existing C2000ware have peripherals except this LIN examples.

    Wayne Huang

  • Dear Siddharth:

    I am the customer mentioned by wayne. The following is my configuration. As long as the data is sent, it will continue to enter the interruption. How can I solve this problem?

    void
    InitLina(void)
    {
    EALLOW;

    LinaRegs.SCIGCR0.bit.RESET = 0; //Into reset
    LinaRegs.SCIGCR0.bit.RESET = 1; //Out of reset

    LinaRegs.SCIGCR1.bit.SWnRST = 0; //Into software reset

    //
    // SCI Configurations
    //
    LinaRegs.SCIGCR1.bit.COMMMODE = 0; //Idle-Line Mode
    LinaRegs.SCIGCR1.bit.TIMINGMODE = 1; //Asynchronous Timing
    LinaRegs.SCIGCR1.bit.PARITYENA = 0; //No Parity Check
    LinaRegs.SCIGCR1.bit.PARITY = 0; //Odd Parity
    LinaRegs.SCIGCR1.bit.STOP = 0; //One Stop Bit
    LinaRegs.SCIGCR1.bit.CLK_MASTER = 1; //Enable SCI Clock
    LinaRegs.SCIGCR1.bit.LINMODE = 0; //SCI Mode
    LinaRegs.SCIGCR1.bit.SLEEP = 0; //Ensure Out of Sleep
    LinaRegs.SCIGCR1.bit.MBUFMODE = 0; //Buffered Mode
    LinaRegs.SCIGCR1.bit.LOOPBACK = 0; //Internal Loopback
    LinaRegs.SCIGCR1.bit.CONT = 1; //Continue on Suspend
    LinaRegs.SCIGCR1.bit.RXENA = 1; //Enable RX
    LinaRegs.SCIGCR1.bit.TXENA = 1; //Enable TX

    //
    // Ensure IODFT is disabled
    //
    LinaRegs.IODFTCTRL.bit.IODFTENA = 0x0;

    //
    // Set transmission length
    //
    LinaRegs.SCIFORMAT.bit.CHAR = 7; //Eight bits
    LinaRegs.SCIFORMAT.bit.LENGTH = 0; //Eight bytes

    //
    // Set baudrate
    //
    LinaRegs.BRSR.bit.SCI_LIN_PSL = 324; //19.2 kbps for SYSCLKOUT = 60 MHz
    LinaRegs.BRSR.bit.M = 8;

    LinaRegs.SCIPIO0.bit.RXFUNC = 1;
    LinaRegs.SCIPIO0.bit.TXFUNC = 1;

    //
    // Enable interrupts
    //
    LinaRegs.SCISETINT.bit.SETRXINT = 1; //Enable RX interrupt
    LinaRegs.SCISETINT.bit.SETTXINT = 1;

    LinaRegs.LIN_GLB_INT_EN.bit.GLBINT0_EN = 1;
    LinaRegs.LIN_GLB_INT_EN.bit.GLBINT1_EN = 1;

    //
    // Set interrupt priority
    // Set interrupt level of all interrupts to LVL 0
    //
    LinaRegs.SCICLEARINTLVL.all = 0xFF0023D2U;

    LinaRegs.SCIGCR1.bit.SWnRST = 1; //bring out of software reset

    //
    // Disable write to protected registers
    //
    EDIS;
    }

    interrupt void Lina_Level0_ISR(void)
    {
    Uint32 LinL0IntVect;

    LinL0IntVect = LinaRegs.SCIINTVECT0.all;

    // 接收中断
    if(LinL0IntVect == 11) //值为11时代表有数据接收到//QTL
    {
    // SCI_RXD_isr();
    }
    // 发送中断
    else if(LinL0IntVect == 12)
    {
    // SCI_TXD_isr();
    }

    GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1;

    LinaRegs.SCIFLR.bit.IDTXFLAG = 1;
    LinaRegs.LIN_GLB_INT_CLR.bit.INT0_FLG_CLR = 1;
    PieCtrlRegs.PIEACK.bit.ACK8 = 1;
    }

    Best Regards

  • Hi Wayne,

    The customer has been provided with the example ported to F28002x.  Are there any other questions from the customer?

    Best Regards

    Siddharth

  • Dear Siddharth,

    Thank you very much for your support.

    We can close this issue.

    Wayne Huang