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.

CCS: SCI2 for uart,Receive data has problems

Tool/software: Code Composer Studio

hello ,

When using the serial communication of the Demo board of the TMS57 series, set the serial port to interrupt to receive data, and then print the received data with the serial port, modify the sciNotification() function, but always do not print.


In Debug mode, it is found that the length of the received data is always 0 (the function :void linHighLevelInterrupt(void)), so the program cannot enter this branch and does not receive the data.

 how to modify this problem?

 ing code, 

  • Hello Xiaohong,

    To receive data using interrupt mode, scireceive(..) should be called first to define the data length.

  • hello,

    What you mean is to call this function to set the length of the data after entering the interrupt. This length is an input parameter. The length of the data I receive is different each time. How to set this input parameter?
    Is the function of this parameter to receive fixed-length data?
    What if the data length sent by my serial port is different each time?

  • This is example:

    uint8_t receive_data[8];

    void main()

    {

    /** - Initialize SCI Routines to receive Command and transmit data */

    sciInit();

    /** - Configure SCI to receive 8 bytes of Command information */
    sciReceive(scilinREG, 8, receive_data);

              ... ...

    }

    void sciNotification(sciBASE_t *sci, unsigned flags)

    {

             uint32_t data;

    data = (receive_data[0] - 48) * 10 + (receive_data[1] - 48) * 100 + ....;


    /** - Get ready to receive the next data */
    sciReceive (scilinREG, 8, receive_data);

    /** acknowledge once the data is received */
    sciSend (scilinREG, 8, (unsigned char *) "HOLLYSYS");

    }