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.

TMS320F28035: SCI communication on the C2000 MCU

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Hello Everyone,

Been working on the C2000 MCU for building a motor controller on top of it. I want to add a feature to be able to communicate some information using the UART port( SCI in this case). Previously I was trying to do serial programming using SCI and with the help of community I was successfully able to do that using the serial flash kernel and BOOT pins.

While looking at the datasheet for TMS320f2803x, I find two SCI ports at PIN27 (SCITXDA), PN32(SCIRXDA) and PIN37(SCITXDA) , PIN38(SCIRXDA). As far as I understand there is only one SCI port available but these two set of pins can be used depending on the configuration. Now it was stated in the serial programming that we can use only PIN27 and PIN32 for serial programming.

My doubts :-

1. If I want to use SCI communication in my application, which set of pins can be used ? and what are the configuration for the same. The example code suggests using PIN27 and PIN32. Can I use the other set? HOW?

2. What is the difference between the two sets if any?

Thank You

Regards

  • Hi Shwetank,

    shwetank vishnu1 said:
    1. If I want to use SCI communication in my application, which set of pins can be used ? and what are the configuration for the same. The example code suggests using PIN27 and PIN32. Can I use the other set? HOW?

    Either sets of pins can be used for SCI communication in your application. If you do SCI boot mode then your boot mode pins will have some pull up and pull down resistances depending on the boot configuration. You have to be careful that this does not interfere with your SCI communication. I don't see this being an issue. The device should be able to overcome the pull down or pull up resistances you choose, but if it does become an issue then I would experiment with a few resistance values or use the other set of SCI pins for communication. One thing you want to make sure though is to drive your pins via a resistor and not short directly to ground. 

    You can use the same method to set the TX and RX pins for either option. Take a look at the InitSciaGpio() function within our C2000Ware Examples. Here they have commented out the lines that correspond to pins 37/38 but you can always uncomment them and then comment the ones for pins 27/32.

    void 
    InitSciaGpio()
    {
        EALLOW;
    
        //
        // Enable internal pull-up for the selected pins
        // Pull-ups can be enabled or disabled disabled by the user.
        // This will enable the pullups for the specified pins.
        //
        GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0;   //Enable pull-up for GPIO28 (SCIRXDA)
        //GpioCtrlRegs.GPAPUD.bit.GPIO7 = 0;  //Enable pull-up for GPIO7  (SCIRXDA)
    
        GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0;	  //Enable pull-up for GPIO29 (SCITXDA)
        //GpioCtrlRegs.GPAPUD.bit.GPIO12 = 0; //Enable pull-up for GPIO12 (SCITXDA)
    
        //
        // Set qualification for selected pins to asynch only
        // Inputs are synchronized to SYSCLKOUT by default.
        // This will select asynch (no qualification) for the selected pins.
        //
        GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3;  // Asynch input GPIO28 (SCIRXDA)
        //GpioCtrlRegs.GPAQSEL1.bit.GPIO7 = 3;   // Asynch input GPIO7 (SCIRXDA)
    
        //
        // Configure SCI-A pins using GPIO regs
        // This specifies which of the possible GPIO pins will 
        // be SCI functional pins.
        //
        GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1;   // Configure GPIO28 for SCIRXDA 
        //GpioCtrlRegs.GPAMUX1.bit.GPIO7 = 2;  // Configure GPIO7 for SCIRXDA 
    
        GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1;   // Configure GPIO29 for SCITXDA 
        //GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 2;   // Configure GPIO12 for SCITXDA
    
        EDIS;
    }

    shwetank vishnu1 said:
    2. What is the difference between the two sets if any?

    There is no difference between using either set of pins except for the fact that pins 27 and 32 are also SCI boot mode pins.

    Best Regards,

    Marlyn

  • Thanks Marlyn,

    Yes, I was now able to communicate with the SCI pins using both the pairs individually just by changing the pin configurations as you suggested. Now I am able to communicate the serial programming as well as SCI in my main application.

    Would really appreciate if you can guide me on some more specifics related to the SCI :-

    1. I am able to use the RX interrupt however the TX FIFO interrupt seems to be stuck and not responding. I want to receive two-byte of the data and depending on that send 10 bytes using the port. Please let me know if I can find any literature or Example code for the same.

    2. The Example code echo back is simple software servicing and interrupt loopback seems like a self-check code. Please correct me if I am wrong.

    Thank again.

    Regards

  • Hi Shwetank,

    I am glad you were able to get both sets of pins working for your application. 

    shwetank vishnu1 said:
    1. I am able to use the RX interrupt however the TX FIFO interrupt seems to be stuck and not responding. I want to receive two-byte of the data and depending on that send 10 bytes using the port. Please let me know if I can find any literature or Example code for the same.

    For the SCI module we only have the 3 examples (SW wise) sci_echoback, scia_loopback, and sci_loopback_interrupts. You are right in your description for part 2. However, the internal loopback mode in the last two examples can be disabled using bit LOOPBKENA in the SCICCR register so that its not just "self-check" code. As far as literature we have the Technical Reference Manual (TRM) that describes the SCI module in detail and how to modify all of its configurations. 

    Do you mean that the TXFIFO interrupt never gets called? There might be an issue with the way TX FIFO was configured. I'd check the TXFFST bit in the SCIFFTX register to see how many words are in your TXFIFO and the TXFFINT bit in the SCIFFTX register as well to make sure the TXFIFO interrupt got called. You can read these values from the 'Watch Expressions' window in Code Composer Studio.

    Please create a new thread describing the issue you are facing and what your configuration looks like and we can debug there. It's best to separate out different issues so it makes it easier for others on the forum to find.

    Best Regards,

    Marlyn