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.

How to set to use the Interrupt to receive Data

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

Hi,
I have work with TMS570ls3137 Development Board for monthes.
Now, I want to use the Interrupt of sci to receive Data,and the sciReceiveByte() in the sciNotification() function.So I can run other functions in the main() functions.
Can you give me simple project with it? Such as receiving data in the sciNotification() function, storing in an array.
And the predicament of what I faced is that after setting the HALCodeGen and initialing the sci device for interrupt, I add the sciReceiveByte() in the main function,and it works.But added it in the sciNotification() function, it does not work.I have run the step to check whether it is get into the sciNotification() function and the result is yes.It is that although the sciReceiveByte() function have been called in the sciNotification() function, it does not reveive the data rightly. I do not understand how it works about the sci interrupt? Could you give me a simple explaination? thanks.

  • Hello user4460717,
    I have compiled main using the following function calls:
    #include "sci.h"
    void main(void)
    {
    /* USER CODE BEGIN (3) */
    sciInit();
    sciEnableNotification(sciREG, SCI_RX_INT);
    sciReceive(sciREG, 10, (uint8 *)0x08001500);
    while(1) {
    }

    /* USER CODE END */
    }

    The function calls initialize sci and configure the module to generate an interrupt on receive.
    The sciReceive function expects 10 bytes and will store them to 0x0800_1500.

    I have not verified (because I haven't hooked up an SCI to RS232 transceiver yet.

    Best Regards,
    Kevin Lavery
  • Hi

    You should enable sci interrupt on Halcogen Vim channel tab. After that open your source code and you should see scihighlevelinterrupt function on sci.c . If you add scinotification function in the scihighlevelinterrupt function, MCU enter the scinotification function after the sci interrupt.