• TI Thinks Resolved

CCS/TMS320F28379D: Serial Communication using the TI example usb_dev_serial_cpu

Intellectual 530 points

Replies: 7

Views: 154

Part Number: TMS320F28379D

Tool/software: Code Composer Studio

Dear TI Hello,

I am working on a serial communication between my computer and the C2000 launchPad XL,

I am using the TI example usb_dev_serial_cpu0, I am connecting my serial communication device the GPIO18/19(SCITXDB/SCIRXDB) using 4 wires(TX,RX,GND,5V),

In the original code provided by TI, SCIA is used, In my application i want to use the SCIB,

I changed the code to be able to use the UARTB, but still can't communicate with my host application,

#define USB_UART_BASE           UARTB_BASE              //UARTA_BASE
#define USB_UART_PERIPH         SYSCTL_PERIPH_SCI2      //SYSCTL_PERIPH_SCI1
#define USB_UART_INT            INT_SCIRXINTB           //INT_SCIRXINTA



    EALLOW;
    GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 2; //SCITXDB
    GpioCtrlRegs.GPAPUD.bit.GPIO18 = 0;
    GpioCtrlRegs.GPAQSEL2.bit.GPIO18 = 3;
    GpioCtrlRegs.GPADIR.bit.GPIO18 = 1;

    GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 2;    //SCIRXDB
    GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0;
    GpioCtrlRegs.GPADIR.bit.GPIO19 = 0;
    EDIS;

 

Thank you in advance,

S.Tarik 

 

 

  • S.Tarik,

    You should also include the GPIO 'Group' Mux structure in your code too, though in this case it does default to 0. Could you please try running your code for SCI-B using a different GPIO pin? I checked for SCITXDB and it is pinned out to other GPIO locations that are in common with the LaunchPad headers. Possible GPIO options (other than 18) are: 22, 14, 10, and 9. Please see the LaunchPad/TRM for other SCIRXDB GPIO19 options. Please let me know what happens. Thanks.

    - Ken
  • In reply to Ken Schachter:

    Ken,

    Thank you for taking into consideration my question,

    The group is set by default to 0, It is not necessary, the default configuraiton should work since the GPAGMUX should be reset for SCI(TX/RX)DB

    
    
     GpioCtrlRegs.GPAGMUX2.bit.GPIO18  = 0;
     GpioCtrlRegs.GPAGMUX2.bit.GPIO19 = 0;

    
    

    The same thing for GPIO19,

    I also tried an other GPIO10/11, bellow the code i used ,

        EALLOW;
        GpioCtrlRegs.GPAGMUX1.bit.GPIO10 = 1;
        GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 6; // 2 have been tasted also
        GpioCtrlRegs.GPAPUD.bit.GPIO10 = 0;
        GpioCtrlRegs.GPAQSEL1.bit.GPIO10 = 3;
        GpioCtrlRegs.GPADIR.bit.GPIO10 = 1;
    
        GpioCtrlRegs.GPAGMUX1.bit.GPIO11 = 1;
        GpioCtrlRegs.GPAGMUX1.bit.GPIO11 = 6; // I tried 2 also
        GpioCtrlRegs.GPAMUX1.bit.GPIO11 = 2;    //SCIRXDB
        GpioCtrlRegs.GPAPUD.bit.GPIO11 = 0;
        GpioCtrlRegs.GPADIR.bit.GPIO11 = 0;
        EDIS;

    I still can't receive and send any character,

    Regards,

    S.Tarik,

  • In reply to usrhomeinit:

    S.Tarik,

    Please see this related post that was just resolved:

    e2e.ti.com/.../800604

    Please double-check your header pins. Also, 6 is not a valid option for the MUX. The GPIO is set up with two levels of MUXs with each having four options (i.e. 0, 1, 2, and 3).

    - Ken
  • In reply to Ken Schachter:

    S.Tarik,

    It's been a while since I have heard from you last. Therefore, I am assuming that my last reply resolve your issue and I will close this thread.

    - Ken
  • In reply to Ken Schachter:

     Ken,

    I thank you for your interest, I didn't forget your post, I was occupied with work issues,

    I couldn't resolve my issue (usb_serial project) , I tried the TI example for serial communication interface, and I could connect my application.

    The only issue i had is the corrupted data transfer, in your opinion, what is the  reason for the corruption data transfer please?

    Thank you in advance,

    Regards, 

    S.Tarik,

  • In reply to usrhomeinit:

    S.Tarik,

    The example project you are using (usb_dev_serial.c) is for creating a virtual serial port with the controlCARD when connected to the USB host system. With this project the USB cables from your PC are connected to both the mini and microUSB connectors on the controlCARD. Then characters typed in one terminal are echoed in the other and vice versa. Is this what you want to do? From you original post, it looks like you want to just communicate directly from your device to the F28379D SCI (i.e. using GPIO pins and not the USB). If so, then the SCI example would be a better starting point.

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken
  • In reply to Ken Schachter:

    S.Tarik,

    It's been a while since I have heard from you last. Therefore, I am assuming that my last reply resolve your issue and I will close this thread.

    - Ken