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.

TMS570LS0432: TMS570LS0432 SCI Rx problem in interrupt mode

Part Number: TMS570LS0432


Hello,

i am using TMS570LS0432 . I want  communicate SCI Rx in interrupt mode and transmits the received data to terminal for every 1 second.

For that

I enabled Rx INT  and i am receiving data correctly from terminal to microcontroller.

For every 1 second transmission from micro-controller to terminal i have enable RTI INT of 100ms.and i am transmitting the data for every 1 second.

If i send data from terminal then i am able to receive data correctly and same i am able to transmit the correct data on terminal.but in case when i am not sending any data from terminal to micro-controller still i am receiving garbage data because every time code going in RX ISR even i am not sending any data from terminal.How can i avoid this issue is there any required to change in scisend() function.

Here is my code

char  ReceivedChar[1]={0};

char count=0;

int main(void)

{

_enable_IRQ();

  sciInit();

  rtiinit();

rtiStartCounter(rtiCOUNTER_BLOCK0); 

sciReceive(scilinREG, 1, &ReceivedChar[0]);

while(1)

{

  if(count==10)
        {
            memset(Tx_buff, 0, sizeof(Tx_buff));
            sprintf(Tx_buff,"\r\nSPEED_EST_RPM : %d\0",ReceivedChar[0]);

            sciSend(scilinREG,strlen(Tx_buff),(uint8*)Tx_buff);
            gioToggleBit(gioPORTA,  1);
            count=0;
        }

}

}

/*******************END of Main code******************/

void sciNotification(sciBASE_t *sci, uint32 flags)
{

       sciReceive(sci, 1, &ReceivedChar[0]);

}

void rtiNotification(uint32_t notification)
{
    if(notification==rtiNOTIFICATION_COMPARE0)
    {
        count++;

    }

}

Thanks in advance..

  • Hello Sameer,

    Are you able to put a scope probe on the Rx line to see if, in fact, here is no data coming in on the Rx line? i.e., is the terminal somehow sending garbage or is there noise on the line causing the interrupt to occur?

    Also please check that only the receive interrupt is enabled and not the Tx as well. I am curious of this because the sprintf and sciSend functions are called regardless of whether data is received or not according to your code.
  • Thank you so much..

    I have checked on scope and problem is solved.

    There is no problem in code written at micro-controller side it  just fault in my PC side GUI code which solved my problem.