Author Topic: Dual Role - USB Host Connector + USB Device Connector  (Read 10182 times)

jmag999

  • Member
  • ***
  • Posts: 4
Dual Role - USB Host Connector + USB Device Connector
« on: April 21, 2015, 10:40:58 am »
I would like to provide separate USB connectors (Type-A for host and Mini-B for device ).  I am using an STM32 processor with OTG support (includes Attach Detect Protocol).  I will use a USB-rated analog switch to ensure that neither is connected at the same time.  My main concern is how to detect the presence of the USB device plugged into the host port.  Presumably, I could use ADP, but unsure how this would work.  Also trying to determine how I could wake up from sleep when a USB device is plugged into the host port.  I realize that OTG is designed for this purpose, but I don't want our customers to need an adapter cable to plug in thumbdrives and other devices.  Anyone have any experience with this?  
« Last Edit: April 23, 2015, 01:05:18 pm by jmag999 »

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Dual Role - USB Host Connector + USB Device Connector
« Reply #1 on: April 21, 2015, 07:50:25 pm »
You need to detect one of the data lines going high. This is usually a "connect" interrupt. You also have to leave Vbus on or the device won't know its connected to a host.

jmag999

  • Member
  • ***
  • Posts: 4
Re: Dual Role - USB Host Connector + USB Device Connector
« Reply #2 on: April 22, 2015, 07:54:45 am »
I had thought that Attach Detection Protocol could work without having the VBUS voltage present.  I think the only problem with this is that it won't wake the processor.  Does ADP work if not using OTG?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Dual Role - USB Host Connector + USB Device Connector
« Reply #3 on: April 23, 2015, 12:57:31 pm »
Non-OTG hosts can use ADP.