Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

connecting two TMS570LS20216SPGE via sci

$
0
0

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    (Please visit the site to view this file)

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       (Please visit the site to view this file)

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.


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>