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.

TMS320F28379D: Receive Interrupt is not working in SCIA .

Part Number: TMS320F28379D

Hello Folks,

I have tested echoback and loopback_interrupt example on Launchpad XL C2000 with SCIA. It is working perfectly.

Based on that I have written my code. I am not able to receive RX Interrupt in SCIA.

I have correctly configured GPIO and other settings.

If I enable loopback then I am getting an RX Interrupt.

Even I have configured SCIB and same code is working fine. It is not working with only SCIA.

I want to know that is there any special settings are required for SCIA to work RX Interrupt?

  • hi Chintan,

    There shouldn't be anything really that is specific for SCIA RX interrupt to work.

    Is the SCIA RX interrupt flag getting set ? I believe yes since it works on echoback ..

    Which SCI A RX GPIOs are you using ?

    Regards.

  • Thanks for your reply Meghana.

    In echoback mode ( example code given in library), interrupts are not used and it is working fine.

    In loopback mode (example code), interrupts are working.

    But I just disable loopback mode and try to run the code again but somehow I am not getting an RX Interrupt for SCIA port.

    I am using GPIO 43 (RX) and 42 (TX). Development kit USB Port as SCIA. 

    Now I have just changed the GPIO 19 (RX) and 18 (TX) and configure SCIB port with same code. I am getting an RX Interrupt for SCIB port.

    PS : I have made defines for all settings variable and I will just changing defines. So I don't think so that anything is left out in initialization of variables for particular SCI port.

    Like this...

    In header file :

    #define SCI_REG                                                               ScibRegs
    #define SCI_RX_INTR                                                       SCIB_RX_INT
    #define SCI_TX_INTR                                                        SCIB_TX_INT
    #define SCI_RX_INTR_VECT_TABLE_MAPPING            PIEIER9.bit.INTx3
    #define SCI_TX_INTR_VECT_TABLE_MAPPING            PIEIER9.bit.INTx4
    #define CPU_INTRRUPT_ENABLE                                   M_INT9
    #define GPIO_RX_PIN                                                       19
    #define GPIO_TX_PIN                                                       18
    #define GPIO_RX_PIN_MUX                                             2
    #define GPIO_TX_PIN_MUX                                             2

    And for SCIA port below definitions.

    #define SCI_REG                                                        SciaRegs
    #define SCI_RX_INTR                                                SCIA_RX_INT
    #define SCI_TX_INTR                                                SCIA_TX_INT
    #define SCI_RX_INTR_VECT_TABLE_MAPPING    PIEIER9.bit.INTx1
    #define SCI_TX_INTR_VECT_TABLE_MAPPING    PIEIER9.bit.INTx2
    #define CPU_INTRRUPT_ENABLE                           M_INT9
    #define GPIO_RX_PIN                                               43
    #define GPIO_TX_PIN                                               42
    #define GPIO_RX_PIN_MUX                                    15
    #define GPIO_TX_PIN_MUX                                     15

    Init code :


    SCI_REG.SCICCR.all = 0x0007;

    SCI_REG.SCICTL1.all = 0x0003;

    SCI_REG.SCICTL2.bit.TXINTENA = 1;
    SCI_REG.SCICTL2.bit.RXBKINTENA = 1;
    SCI_REG.SCIHBAUD.all = g_SCIBaudHigh;
    SCI_REG.SCILBAUD.all = g_SCIBaudLow;
    //SCI_REG.SCICCR.bit.LOOPBKENA = 1; // Enable loop back

    SCI_REG.SCIFFTX.all = 0xC022;

    SCI_REG.SCIFFRX.all = 0x0022;

    SCI_REG.SCIFFCT.all = 0x00;

    SCI_REG.SCICTL1.bit.SWRESET = 1; // Relinquish SCI from Reset
    SCI_REG.SCIFFTX.bit.TXFIFORESET = 1;
    SCI_REG.SCIFFRX.bit.RXFIFORESET = 1;

    And other settings are also defined like this only.

  • hi ,

    Chintan Parmar said:

    In echoback mode ( example code given in library), interrupts are not used and it is working fine.

    In loopback mode (example code), interrupts are working.

    Did you change the example code GPIOs to use GPIO 43 /42 in the echoback example for it to work with the Launchpad ? After that it works properly . is that correct? The gpios in the example are for controlcard ...

    Chintan Parmar said:
    But I just disable loopback mode and try to run the code again but somehow I am not getting an RX Interrupt for SCIA port.

    Are you getting proper clock configuration done based on adding "_LAUNCHXL_F28379D" as a predefined symbol in the project properties?

    Because this may be immaterial when doing internal loopback?

    Regards.

    SO are you trying a echoback with the SCIA or a loopback ? 

  • Hi,

    1) Yes, I have changed the example code GPIOs to use GPIO 43/43. And in echoback mode it works correctly.

    2) Yes, I have added predefined symbol in the project properties.

    3) I want to use SCIA port with interrupt but somehow it is not working. So I have changed the port to SCIB for testing purpose and it is working fine.

    In example code, echoback is working fine and loopback is also working fine but as soon as I disable the loopback mode and run again then RX interrupt is not working. Then I have modified same code with loopback disable to work with SCIB port and I am getting an RX interrupt.

    So I came here to know what was wrong with SCIA port to run with interrupt?

    Hope, now you are getting my issue.

    If you want I can share my code also. Or can you give me some reference code in which SCIA port is configured and interrupt mode is enabled?

     

  • hi Chintan ,

    You said " So I have changed the port to SCIB for testing purpose and it is working fine" , how did you connect it to the PC for echoback ?

    is it using the RS232 cable ?

    Can you try using some other GPIO of SCI A and see if the issue still persists ?

    Regards.

  • Hi Meghna,

    I have connected it through USB to TTL (RX and TX pins) converter.

    I have tried with other GPIO of SCIA also but the same issue still persists with that.

    I have used inbuit USB serial GPIO 43 and 42

    And even I have checked with GPIO 9 and 8 also.

     

  • hi,

    Were you able to make some progress on this ?

    I am wondering if its something to do with the fact that the sciA signals are being tampered by some other signals...

    Regards.

  • Hi,

    In last week only, the problem is resolved now. There is GPIO_setPinMuxConfig() function is called before initialization of SCI port. And that function is locking the state of GPIO MUX configuration. So that only SCI A interrupt is not correctly configured and due to that, it is not working. However, if I do loopback enable then it will work perfectly.