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.

Problem to test SCI/LIN module Loopback on TMS570LS1227 EVM

Other Parts Discussed in Thread: TMS570LS1227

Hello,


I was testing the SCI/LIN module Loopback on TMS570LS1227 EVM,  and noticed that the device was not operating as required in loop back mode. 

What the code is supposed to do is enable the loop back mode of SCI/LIN, write data on the transmit buffer and read it on the receive buffer. However, the data never appears on SCIRD, so the RXRDY flag is never set and the program gets stuck.

I am using HALCoGen 04.00.00, CCS v5.2 and the XDS100v2 USB emulator.

As I am new to TI processors, Kindly send me the source code to solve the Loop back test

Any help would be much appreciated. Thanks in advance.

  • Pamarthi,

    I believe that this forum thread would provide the information you need.

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/355622/1251049.aspx#1251049

    Thanks and regards,

    Zhaohong

  • Hi,
    Thanks for the information,
    we have followed the steps provided in the Ref manual..
    I could able to send the character, but could not able to receive the character,  if we enable the loop back pin..
    We are struck at second while loop I,e ..
     "   while(!sciIsRxReady(scilinREG));"
     
    Kindly do  the needful at earliest..
     
     
    With regards,
    Varaprasad
    Here is the Sys_main.c

    /************************************************

     * Include files

     ************************************************/

    #include "sys_common.h"

    #include "system.h"

    #include "sci.h"

    #include "esm.h"

    #include<string.h>

    /*************************************************

     * Function prototypes

     *************************************************/

    void sciDisplayText(sciBASE_t *sci, uint8 *text, uint32 length);

    void wait(uint32 time);

    /*************************************************

     * Declare reg using Macro

     *************************************************/

    #define UART scilinREG

    /*************************************************

     *  ARGUMENTS:None

     *   RETURN:None

     *   DESCRIPTION:SCI loopback Test

     *************************************************/

    void main(void)

    {

       uint8 Tx=0xff,  Rx;

        sciInit();

        sciEnableLoopback(scilinREG, Analog_Lbk);

       while(1)

        {

           while(!sciIsTxReady(scilinREG));

          scilinREG->TD = Tx;

           while(!sciIsRxReady(scilinREG));

           Rx = scilinREG->RD;

           sciDisplayText(UART,& Rx, 1);

         }

    }

    /*************************************************

     *  ARGUMENTS:

     *            sci :write data on sci register

     *            text:text is displayed on the hyperterminal

     *          length:length of text

     *   RETURN:None

     *   DESCRIPTION:Display the text on hyperterminal

     *************************************************/

    void sciDisplayText(sciBASE_t *sci, uint8 *text,uint32 length)

    {

        while(length--)

        {

            while ((UART->FLR & 0x4) == 4); /* wait until busy */

            sciSendByte(UART,*text++);      /* send out text   */

        };

    }

     

    /*************************************************

     *  ARGUMENTS:

     *                time: time in ms

     *

     *   RETURN:None

     *

     *   DESCRIPTION:Delay generation

     *************************************************/

    void wait(uint32 time)

    {

        time--;

    }

    /***************************************************/

     

    uint32 sciIsRxReady(sciBASE_t *sci)

    {

    /* USER CODE BEGIN (13) */

    /* USER CODE END */

     

        return sci->FLR & (uint32)SCI_RX_INT;

    }

     

     

  • Hi, there.

    Check the value of SCIGCR1 register (offset 0x4) and IODFTCTRL register (offset 0x90) to see if they are configured correctly by software.

    Thanks and regards,

    Zhaohong