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.

SCI transmission problem TMS570 Hercules USB stick

Other Parts Discussed in Thread: HALCOGEN

Hi,

I am using GNU 4.7.4 Linearo tool chain to build the project,I have ported the SCI driver generated from the halcogen and I am using the same SCI drivers to send(sciSend function) the data through SCI2.but I can see that values sent on the port are not correct.

These SCI driver works fine on TI compiler and I am able to see the correct data being transmitted and I verified in hyperterminal.

I had a look on the other posts on this SCI issue but I couldn't find any solution

Is there any problems after porting the code from TI to GNU tool chain.?

below is the SCI init code,

//Baudrate -9600,8 data bits 1 stop bit

void sciInit(void)
{

    /** - bring SCI out of reset */
    scilinREG->GCR0 = 1U;

    /** - Disable all interrupts */
    scilinREG->CLRINT    = 0xFFFFFFFFU;
    scilinREG->CLRINTLVL = 0xFFFFFFFFU;

    /** - global control 1 */
    scilinREG->GCR1 = (1 << 25)  /* enable transmit */
                  | (1 << 24)  /* enable receive */
                  | (1 << 5)   /* internal clock (device has no clock pin) */
                  | ((2-1) << 4)  /* number of stop bits */
                  | (0 << 3)  /* even parity, otherwise odd */
                  | (0 << 2)  /* enable parity */
                  | (1 << 1);  /* asynchronous timing mode */

    /** - set baudrate */
    scilinREG->BAUD = 650;  /* baudrate */

    /** - transmission length */
    scilinREG->LENGTH = 8 - 1;  /* length */

    /** - set SCI pins functional mode */
    scilinREG->FUN = (1 << 2)  /* tx pin */
                 | (1 << 1)  /* rx pin */
                 | (0);  /* clk pin */

    /** - set SCI pins default output value */
    scilinREG->DOUT = (0 << 2)  /* tx pin */
                  | (0 << 1)  /* rx pin */
                  | (0);  /* clk pin */

    /** - set SCI pins output direction */
    scilinREG->DIR = (0 << 2)  /* tx pin */
                 | (0 << 1)  /* rx pin */
                 | (0);  /* clk pin */

    /** - set SCI pins open drain enable */
    scilinREG->ODR = (0 << 2)  /* tx pin */
                 | (0 << 1)  /* rx pin */
                 | (0);  /* clk pin */

    /** - set SCI pins pullup/pulldown enable */
    scilinREG->PD = (0 << 2)  /* tx pin */
                | (0 << 1)  /* rx pin */
                | (0);  /* clk pin */

    /** - set SCI pins pullup/pulldown select */
    scilinREG->PSL = (1 << 2)  /* tx pin */
                 | (1 << 1)  /* rx pin */
                 | (1);  /* clk pin */

    /** - set interrupt level */
    scilinREG->SETINTLVL = (0 << 26)  /* Framing error */
                       | (0 << 25)  /* Overrun error */
                       | (0 << 24)  /* Parity error */
                       | (0 << 9)  /* Receive */
                       | (0 << 8)  /* Transmit */
                       | (0 << 1)  /* Wakeup */
                       | (0);  /* Break detect */

    /** - set interrupt enable */
    scilinREG->SETINT = (0 << 26)  /* Framing error */
                    | (0 << 25)  /* Overrun error */
                    | (0 << 24)  /* Parity error */
                    | (1 << 9)  /* Receive */
                    | (0 << 1)  /* Wakeup */
                    | (0);  /* Break detect */

    /** - initialize global transfer variables */
    g_sciTransfer[1].mode   = 0 << 8;
    g_sciTransfer[1].length = 0;

    /** - Finaly start SCILIN */
    scilinREG->GCR1 |= (1 << 7);

}

main.c

void main(void)

{

sciInit();
sciSend(scilinREG,13,(unsigned char *)"SCI sample");

}

  • Hi Hungund,

    The TMS570 USB stick uses TMS570LS31x MCU which supports up to 180MHz, but we recommend to run the MCU below 100Mhz otherwise the SUB stick will get overheated. From your SCI configuration, I notice that you use 200MHz which is over the MCU maximum speed limit.

    TI CCS6.x also supports GCC (GNU 4.7.4 Linaro). Could you please lower the CPU speed to 100MHz (SCI prescale is 325 for 9600 baudrate), and try on CCS6.x? Thanks

    Regards,

    QJ

     

  • Hi Wang,

    Thanks for the feedback.
    SCI transmission works with SCI prescale of 325 and after reducing the CPU speed.