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/TM4C1294NCPDT: USB Layout and Example code

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL, TPS2052B

Tool/software: Code Composer Studio

Hi,

I want to write a data to a USB stick using TM4C1294NCPDT. However, I can't find any reference for wiring the USB-A Female to the MCU and examples code for writing data to the USB stick. Is there any where I can find one?

Best regards,

  • Start by looking at section 4.3 of the System Design Guidelines. The actual connections to the USB-A Female depend on the connector you choose, but they will look something like this:

    For example code, download TivaWare and look at the example in: "C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\usb_host_msc". This example uses third party open software FATFS. This example reads from a USB stick but can serve as a starting point.

  • Hi Bob,

    Thank you for your reply. How about the GPIO_PD6_USB0EPEN ? Should I connect the USB0EPEN to the Vcc +5V or I dont need it? 

    HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTD_BASE + GPIO_O_CR) = 0xff;
    ROM_GPIOPinConfigure(GPIO_PD6_USB0EPEN);
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    ROM_GPIOPinTypeUSBDigital(GPIO_PORTD_BASE, GPIO_PIN_6);
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);
    ROM_GPIOPinTypeGPIOInput(GPIO_PORTQ_BASE, GPIO_PIN_4);

  • USB0EPEN is an output to control a power switch. Do not connect it to 5V. It is optional in host mode. We used it with a TPS2052B in our EK-TM4C1294XL LaunchPad design.

  • Hi Rob,

    Let say if I only use D- and D+ to connect to the USB (GND and 5V from the board). Do I still need to use

    ROM_GPIOPinConfigure(GPIO_PD6_USB0EPEN);
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    Rather than just 

    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);

    for configure the D- and D+ to the USB.

    I have a hard time to write a configure code for the USB Stick and how to detect if the USB stick is connected.

    Do you have any reference for configure and init the USB controller?

    Thank you,

    Chuong Vu

  • Have you looked at section 3 of SW-TM4C-USBL-UG-2.1.4.178.pdf in the TivaWare docs directory? This gives some basic examples of how to setup USB host mode.