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.

USB host and Peripheral modes operation

Other Parts Discussed in Thread: AM3352, TPS2051

I want to use one USB port on AM3352 as OTG,  i.e i want it to be configurable as host or a peripheral device port .  After reading the TRM , the following section :

Two options (h/w or s/w) exist for a USBrole assumption/configuration.

For a USB Peripheral configuration the user has the option of using the cable end to select the role by attaching the mini or micro b side of the cable (can consider this as a h/w option) or use the optional method where the firmware is required to program the respective USB Mode Register IDDIG bit field with a value of ‘1’ prior to the USB controller goes into session (can consider this as a s/w option).
Similarly, for a USB host configuration the user has the option of using the cable end to select the role by attaching the mini or micro a side of the cable (can consider this as a h/w option) or use the optional method where the firmware is required to program the respective USB Mode Register IDDIG bit field with a value of ‘0’ value prior to the USB controller going into session (can consider this as a s/w option).
When using the s/w option, the USB ID pin state is ignored/bypassed (this is a similar configuration where an ID pin does not exist) and the USB2.0 controller role adaptation of a host or peripheral (device) is dependent upon the state of the respective USB Mode Register IDDIG field. If the IDDIG field is programmed by the user with a value of ‘1’ prior to the USB going into session, it would assume the role of a peripheral/device. However, if the IDDIG field is programmed with the value of ‘0’, the USB controller will assume the role of a host. What this means is that the USB cable end, connector, will not be able to control the role of the OTG controller and the user needs to be aware of the firmware program setting prior to performing a USB connection.

The procedure for the USB2.0 OTG controller determining its operating modes (usb controller assuming a role of a host or a peripheral) starts when the USB 2.0 controller goes into a session. The USB 2.0 controller is in session when either it senses a voltage (>= 4.4V) on the USBx_VBUSIN pin and the controller sets its DEVCTL[SESSION] bit field or when the firmware sets the DEVCTL[SESSION] bit; assuming that it will operating as a host.

So I am in confusion as to what should i do, need some guidance .

  • Hi Nitesh,
     
    If you are into board design stage, I suggest you follow the AM335X EVM as a reference for USB OTG design. USB0 on the EVM board is tied for OTG functionality, except for a resistor, R381 120kOhm which has to be removed (R381 is used to put USB0 into device mode on the EVM). Please check this link: http://processors.wiki.ti.com/index.php/AM335x_General_Purpose_EVM_HW_User_Guide#USB
     
  • I would like to add a few comments.

    Do you want your product to operate as a dual role USB OTG device or do you want it to operate as an embedded USB Host sometimes and USB Peripheral sometimes?

    I'm asking this question because each of these three operating modes have different PCB design requirements.  For example, the minimum VBUS capacitance for a USB Host is 120 uF while the maximum VBUS capacitance for a USB Peripheral is 10 uF and the VBUS capacitance must be 1 -6.5 uF for a USB OTG device.  This is the reason the EVM has a 4.7 uF capacitor connected to VBUS with a jumper that allows another 150 uF capacitor to be connected to VBUS.  When you want to operate as USB OTG device or USB Peripheral this jumper should not be shorted, but must be shorted when operating as USB Host.

    You can remove R381, R571, R23, Q5, R565, R566, R402 and connect the micro-AB ID pin directly to the AM335x USB0_ID terminal.  The USB OTG controller will operate as USB Host when a micro-A plug, which has the ID pin connected to ground, is attached to the micro-AB receptacle.  The USB OTG controller will operate as USB Peripheral when a micro-B plug, which has the ID pin open-circuit, is attached to the micro-AB receptacle.  A micro-A to micro-B cable will be used to connect two USB OTG devices.  If both USB OTG devices are dual role devices, the one with the micro-a plug attached will begin operating as the USB Host, but the attached USB OTG dual role device can request the role of USB Host via HNP.

    The over-current output from TPS2051 connected to a AM335x GPIO may not be required since the USB OTG controller monitors VBUS voltage to determine if VBUS is below VBUS valid which would indicate an over-current condition has caused the TPS2051 to enter current -limit mode with a reduced output voltage.

    R383 may not be required since USB0_DRVVBUS is a push-pull output.  However, this resistor may be required to keep the TPS2051 turned off if power is applied to the TPS2051 inputs while the AM335x device is not powered.

    Regards,
    Paul

  • Biser sir, 

    Yes sir I am following the EVM and Beaglebone schematics for the USB implementation. And basically it was required that USB0  behave like a peripheral port as in beaglebone with a USB HUB and FTDI dual IC and when the Usb HUB and FTDI are DNI , then that port be OTG i.e. can be used either as host or peripheral. 

    Peaves sir, you have partially answered my query , i will try to see more how it can be done. 

    Any other suggestion will be appreciable.

    Thanks and regards, 

    Nitesh

  • The USB signals must be routed as 90 ohm differential signals without any stubs to achieve the required signal integrity.

    I'm not sure how you plan to design a PCB to support all of these options, but you need to be very careful with signal routing and placement of optional components such that you maintain good USB signal quality for each PCB assembly option.

    You also need to acount for the specific requirements defined in the USB specification for each mode of operation.  For example the different VBUS capacitance values.

    Regards,
    Paul