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.

TSM320F2812 SCI interruption

Other Parts Discussed in Thread: TMS320F28335, CONTROLSUITE, SM320F2812

Hello, I'm working with TMS320F28335 and I need to develop a code in which the interruption is set by the SCI receiver, that is, when the SCI RX receives a package of data (5 bytes), an interruption is set. I'm not using the FIFO. I know that the interruption is set by the RXRDY flag, but how can I service it? Is there a flag that should be cleared after the interruption routine, as when FIFO is employed, or when RXRDY = 0 the interruption is automatically serviced? Do you have code examples of interruption routines for SCI RX? Thank you in advance, Fernanda.

  • Hello Fernanda,

    You'll have to use the FIFO If you want the SCI to receive 5 bytes before an interrupt occurs otherwise you will lose data.

    Take a look at

    C:\ti\controlSUITE\device_support\f2833x\v133\DSP2833x_examples_ccsv4\scia_loopback_interrupts  in "Control Suite".

    The acknowledge flag (in PieCtrlRegs) is the only flag that has to be set after the interrupt occurs.

    Stephen

     

  • Hello Fernanda,

    I just noticed your not using the TMS320F28335.  I looks like the SCI registers in the TMS320F28335 and your processor are the same.

    I didn't see your processor listed in my control suite directory.

    Stephen

  • Hello Stephen

    I'm using  TMS320F28335, just like I stated in my first post. I've noticed the title of the post thread is "TSM320F2812 SCI interruption", but that was a mistake of mine. Sorry, and thank you for your advice about using the FIFO for generating only one interruption and not losing data.


    Best regards

  • Hi

    Here is some sample code that may help u. It  keeps the tx interrupt running until all the data in SBuff is consumed. Actually I use a ring buffer but I have removed in the code to make it simple for u. It is not tested, I just wrote it for u, with slight tweaking it should work.

    Uint16 SBuff [20],UARTTxSize,j;  //Just an example

    //Do this every time u have data to send

    copy 10 bytes to SBuff

    UARTTxSize=10;

    j=0;

    SciaRegs.SCIFFTX.bit.TXFFIENA=1;

    interrupt void sciaTxFifoIsr(void){
        Uint16 i;
        for(i=0; i<4; i++){ //FIFO is 4 bytes deep, adjust to fifo size available on your architecture
           if(UARTTxSize=<0){SciaRegs.SCIFFTX.bit.TXFFIENA=0;break;} //If SBuff empty, disable FIFO Empty Interrupt and stop sending data.
            SciaRegs.SCITXBUF=SBuff[j++];     // Send data

            UARTTxSize--;
        }
        SciaRegs.SCIFFTX.bit.TXFFINTCLR=1;    // Clear SCI Interrupt flag
        PieCtrlRegs.PIEACK.all|=0x100;      // Issue PIE ACK
    }