CCS/TMS570LC4357: Problem with receiving data from sci module using polling method

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

Hello!

i have a problem with receiving data through sci module. I am printing 8 bytes of data through sci at a rate of 10ms (using rti).i am using putty to view my data.i am also using the polling method to see whether there is any new 8 byte data entered through serial monitor using sciIsRxReady in if condition,all inside the while loop.On entering the if condition i am using sci receive to extract 8 bytes of data and the new data is printed in rti interrupt at 10ms rate.Unfortunately i am unable to do so.Only the initial value i assign to the variable is getting printed on putty at a rate of 10ms(rti) but when i try to take an input of  8byte data through sciIsRxReady(in while loop) im unable to receive any data. Please help .

Does sciIsRxReady return value 1 when it receives one byte of data or when it receives data through serial monitor irrespective of the length of the data obtained??

  • Sarthake,

    Sarthake Choudhary
    Does sciIsRxReady return value 1 when it receives one byte of data or when it receives data through serial monitor irrespective of the length of the data obtained??

    uint32 sciIsRxReady(sciBASE_t *sci)
    {
    /* USER CODE BEGIN (13) */
    /* USER CODE END */
    
        return sci->FLR & (uint32)SCI_RX_INT;
    }
    

    Through inspection of the code you will see it is only returning the value of the RX flag in the SCI flag register. A 1 indicates data is received. The SCI is only capable of receiving one byte at a time unless buffered mode is available (only in LIN modules used as SCI) but I do not think the Halcogen code accommodates buffered mode.

    If you are manually entering the data in the terminal window that is sent to the Hercules device, there is no way you will be able to enter values at rate of 10ms each so that they are subsequently printed. My feeling is there are some logical issues with what you are attempting to program which sounds like a mirroring program where whatever is typed on the keyboard through the terminal window is then sent back out on the Tx pin to the terminal window. The caveat is you want to buffer 8 bytes then send out the data in 10ms intervals. If you could post either pseudo code or a flow chart of your code, you might see some logic that needs to be implemented to gate the Tx until all the bytes are received or to somehow identify that a new byte has been received and transmit the new byte.

    Thanks and Regards,

    Chuck Davenport


    If this response answers your question, please indicate it by verifying the suggested answer when provided.

  • In reply to Chuck Davenport:

    Hi Chuck!
    Thanks once again! I got it working.