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.

connecting two TMS570LS20216SPGE via sci



I am trying to get two TMS570 usb sticks to communicate as master and slave. the master will send a single "go command" and the slave perform a task and send back the results. I though I could use the sciREG2 to access the LIN2RX/TX pins. To test this i tried to have the slave echo what ever was relayed by the master from the terminal.

master    1134.sys_main.c

void main(void)
{
/* USER CODE BEGIN (3) */

    sciInit();
    sciSetBaudrate(sciREG1, 9600);
    sciSetBaudrate(sciREG2, 9600);
    
    while(1)
    {
        Print (in);
        inpt = sciReceiveByte(sciREG1); //receive from terminal
        Print (m);
        sciSendByte(sciREG1, inpt); // send to terminal
        
        sciSendByte(sciREG2, inpt); // send to slave
        echo = sciReceiveByte(sciREG2); //receive recieve from slave
        Print (s);
        sciSendByte(sciREG1, echo); // send to terminal
    }
/* USER CODE END */
}

slave       7178.sys_main.c

void main(void)
{
/* USER CODE BEGIN (3) */
    char inpt;

    sciInit();
    sciSetBaudrate(sciREG2, 9600);
    while(1)
    {    
        inpt = sciReceiveByte(sciREG2); //receive from master
        sciSendByte(sciREG2, inpt); // send to master
    }
/* USER CODE END */
}

When I send a character to the master i get an echo from the master that is correct then i get the echo from the slave but it is incorrect.

  • Eric,

    Two things I would check.

    First,  which USB stick model are you using and have you checked the signals between the two sticks at all.    Are you just connecting tx -> rx and rx->tx or did you also connect the two grounds together? 

    Second:  did you try to break at the slave code and check the value of 'inpt' as returned by the 'sciReceiveByte' function?

    sciReceiveByte returns a uint32; but you're storing this into a char.  This probably works ok but is a potential problem point.

    -Anthony

  • Hi Eric,

    Just checking to see if you've found anything new regarding this issue.

    Thanks and Best Regards,

    Anthony