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/LAUNCHXL-F28379D: SCIB Transmit FIFO looping

Part Number: LAUNCHXL-F28379D

Tool/software: Code Composer Studio

Hello!

I have an issue regarding SCIB transmit interrupt .

Iam able to transmit and receive characters via SCI from Launchpad to PC using interrupts.Whenever i type a character to transmit data, it gets transmitted but it is getting transmitted continously.When i enter another character,then the interrupt gets generated,and my new character is getting continously transmitted.I just want the character to be transmitted only once.Please help me.

Sorry if my English is bad. Below, I have attached my transmit ISR and fifo initialization below. 

Is my  transmit ISR correctly written to transmit only a single character?

Will there be any malfunction of SCI working  if i dont set certain bits in an orderly way?

char SendData[];

void scib_fifo_init()
{
ScibRegs.SCICCR.all = 0x0007;
ScibRegs.SCICTL1.all = 0x0003;
ScibRegs.SCICTL2.bit.RXBKINTENA = 0;
ScibRegs.SCICTL2.bit.TXINTENA = 0;
ScibRegs.SCIFFTX.bit.SCIFFENA = 1;
ScibRegs.SCIFFTX.bit.TXFFIENA = 1;
ScibRegs.SCIFFRX.bit.RXFFIENA = 1;
ScibRegs.SCICTL1.bit.all = 0x0023;
ScibRegs.SCIFFTX.bit.TXFIFORESET = 1;
ScibRegs.SCIFFRX.bit.RXFIFORESET = 1;
ScibRegs.SCIHBAUD.all = 0x0001;
ScibRegs.SCILBAUD.all = 0x00E7; //9600 BAUD at LSPCLK = 37.5Mhz
}

interrupt void SCIBTXFIFO_ISR(void)
{
uint16_t i;

for(i=0;i<2;i++)
{
ScibRegs.SCITXBUF.all = (uint16_t)SendData[i];
}

ScibRegs.SCIFFTX.bit.TXFFINTCLR = 1;
PieCtrlRegs.PIEACK.all |= 0x100;
}

  • hi,

    From the description it seems that you are getting unnecessary re-trigger of the ISR .

    Why is the ScibRegs.SCICTL1.bit.all = 0x0023; ?

    Isn't it expected to be on the RXFF or TXFF having content ?

    Do you see any other interrupt status when the ISR is hit post the 1st time ?

    Regards.

  • Hello! Thank you for the reply.

    Yes my transmitter is getting triggerred unnecessarily.When i put a debug point near transmitter ISR and come out of the loop, and then press start again, it is again going into the transmitter ISR without giving any character in SendChar(in watch expression) .I just want to transmit it once.

    SCICTL1.all = 0x0023---> thats because i intend to use FIFO transmit and receive.So, i have enabled SCIFFTX and SCIFFRX bits,so iam just enabling transmitter and receiver and doing a software reset in SCICTL1 register.Am i doing anything wrong here?Please let me know.

    I havent written anything except transmit and receive interrupts.My receive interrupt is working flawlessly.

    Yes,my TXFFINT is getting set everytime.It gets cleared after TXFFINTCLR line.When it comes out of ISR, it gets to forever loop i have given in main function.Then again i put the debug point near transmit ISR and press the start button,it gets into the ISR loop with TXFFINT set.

    Thank You.

    Regards.

  • My transmit interrupt is getting generated even when both TXINTENA and TXFFIENA both are zero.It is getting interrupted even when there is no initialized SendChar.The TXFFINT flag gets cleared only in the ISR, and goes on continous transmission.Please help.I have attached the full code below.What wrong am i doing here?

    Regards.

    __interrupt void SCIBTXFIFO_ISR(void);
    __interrupt void SCIBRXFIFO_ISR(void);
    void scib_fifo_init(void);
    void initializeGPIO(void);
    void initializePIE(void);


    char SendChar[];
    uint16_t i;
    ReceiveChar[];

    void scib_fifo_init()
    {
    ScibRegs.SCICCR.all 0x0007;
    ScibRegs.SCICTL1.all = 0x0003;
    ScibRegs.SCIHBAUD.all = 0x0001;
    ScibRegs.SCILBAUD.all = 0x00E7;      //9600 baud @ SPCLK = 37.5Mhz

    ScibRegs.SCIFFTX.bit.SCIFFENA = 1;

    ScibRegs.SCIFFTX.bit.TXFFIENA = 1;
    ScibRegs.SCIFFRX.bit.RXFFIENA = 1;
    ScibRegs.SCICTL1.bit.SWRESET = 1;
    ScibRegs.SCIFFTX.bit.TXFIFORESET = 1;
    ScibRegs.SCIFFRX.bit.RXFIFORESET = 1;
    ScibRegs.SCIFFTX.bit.TXFFIL = 1;
    ScibRegs.SCIFFRX.bit.RXFFIL = 1;
    }

    void initializeGPIO(void)
    {
    InitGpio();

    EALLOW;

    GpioCtrlRegs.GPAGMUX1.bit.GPIO14 = 0;
    GpioCtrlRegs.GPAGMUX1.bit.GPIO15 = 0;
    GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 2;
    GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 2;

    EDIS;
    }

    void initializePIE(void)
    {
    InitSysCtrl();

    DINT;

    InitPieCtrl();

    IER = 0x0000;
    IFR = 0x0000;

    PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
    PieCtrlRegs.PIEIER9.bit.INTx3 = 1;
    PieCtrlRegs.PIEIER9.bit.INTx4 = 1;

    IER = 0x100;
    EINT;

    InitPieVectTable();

    EALLOW;

    PieVectTable.SCIB_RX_INT = &SCIBRXFIFO_ISR;
    PieVectTable.SCIB_TX_INT = &SCIBTXFIFO_ISR;

    EDIS;

    }


    void main(void)
    {
    scib_fifo_init();
    initializeGPIO();
    initializePIE();

    for(; ;);

    }

    __interrupt void SCIBRXFIFO_ISR(void)
    {
    for(i=0;i<2;i++)
    {
    ReceiveChar[i] =(char)ScibRegs.SCIRXBUF.all;
    }

    ScibRegs.SCIFFRX.bit.RXFFINTCLR = 1;
    ScibRegs.SCIFFRX.bit.RXFFOVRCLR = 1;
    PieCtrlRegs.PIEACK.all |= 0x100;
    }

    __interrupt void SCIBTXFIFO_ISR(void)
    {
    for(i=0;i<2;i++)
    {
    ScibRegs.SCITXBUF.all (uint16_t)SendChar[i];
    }

    ScibRegs.SCIFFTX.bit.TXFFINTCLR = 1;
    PieCtrlRegs.PIEACK.all |= 0x100;
    }

    }

  • hi ,

    The FIFO trigger level is set to 1 which means it generates an interrupt whenever the FIFO status bits are less than or equal to the 1 bit.

    This way it would trigger the TX isr even when empty and then come and actually send data to the TxFIFO.

    So it would be better to populate the conent into the TX FIFO and set the FIFO level = 2 .

    This way it would generate the interrupt once the TX FIFO has 2 * 8 bit data.

    Regards.

  • Hi.

    I have set the TXFFIL bit to 4 and still the same repeated transmit interrupt.

    I dont know why but my TXFFST goes on increasing even though i havent input any data.

    Even when i set TXFFIL to 4,it is getting interrupted because my TXFFST goes on increasing even when no data is input and when TXFFST reaches 5-6,its getting interrupted.

    For the transmit interrupt to occur....is it TXFFIL<= TXFFST or viceversa?

    Thanks and Regards.

  • hi ,

    Natsu said:
    For the transmit interrupt to occur....is it TXFFIL<= TXFFST or viceversa?

    Its visa versa . When TXFFST <= TXFFIL then interrupt will be triggered .

    That's why i suggest to send the content into the buffer first and then get the tx interrupt to trigger .

    Post that send data in the ISR.

    For the RX however , it is when RXFFST > = RXFFIL only then will the interrupt be received .

    Regards.