I am attempting a project with USB OTG functionality. I've read quite a number of documents already but there is some contradicting information out there, so I want to find out if anyone can shed some light on a couple of things.

First some background on what I aim to achieve. I want to design a low cost device that needs some form of diagnostics interface. At the moment the idea is to have a microAB USB port which can be used to either connect to a PC, or to a custom bluetooth module(powered by the device) to connect to a smartphone for instance, the device acting as the OTG host in the latter case.

My questions are:

Is this the right type of application for USB OTG?

What is the maximum amount of current a OTG host may supply, and/or a OTG peripheral may consume? I've read a couple of places that this is only 8mA, but the USB OTG supplement to the USB2.0 spec states 8mA to 5000mA. I am more inclined to believe this spec, but I just want to make sure I am not misunderstanding something.

Lastly, can any USB pheripheral only device be connected to a OTG host provided that the driver is available, or do I need a OTG specific device.

  • 7
    \$\begingroup\$ 5000mA???? That is 5A! USB limit is 500 mA. \$\endgroup\$ – Leon Heller Feb 21 '13 at 13:58
  • \$\begingroup\$ Yeah, I also thought it was odd, maybe there is a mistake in the spec \$\endgroup\$ – Merwe Feb 21 '13 at 14:03
  • 1
    \$\begingroup\$ OTG as a chipset/phy hardware feature does generally mean that if you have appropriate software on your device and put it with a cable or software override into host mode, you can host generic USB peripherals. However your whole scheme sounds rather complicated and may not be the best way to achieve your ultimate need. \$\endgroup\$ – Chris Stratton Feb 21 '13 at 16:23
  • \$\begingroup\$ I don't see why you are not connecting your device directly to a smartphone and instead through a custom made bluetooth device?! Is being wireless a requirement? In that case, why do you connect it to the PC via USB? It seems to me that you are overcomplicating something here. \$\endgroup\$ – Ali Alavi Dec 23 '13 at 19:30
  • 1
    \$\begingroup\$ An OTG device can actually provide a current up to 5A since this is a Host system, it isn't limited to the 500mA. OTG is an extra spec on top of the USB2.0 and it defines a current up to 5000mA (see usb.org/developers/onthego/USB_OTG_and_EH_2-0.pdf for the OTG & EH spec) \$\endgroup\$ – Jan Claes May 21 '14 at 13:33

The situation you're describing is not true OTG. True OTG is when you connect two OTG devices together and they negotiate which one becomes the host. But OTG controllers do allow switching between host and device modes at run-time, so you're on the right track. An OTG host will work normally with non-OTG devices.

8mA is the minimum current that an OTG host must support on VBus. I don't see 5000 mA in the OTG spec tables. Are you sure you're not looking at battery charging? Regardless, you should check the specs for the Bluetooth device to see what current it needs, then design to meet that.

  • \$\begingroup\$ So there are OTG hosts (like smartphones) which will reject a USB device that requests 100 mA because it's too much current? But all traditional USB hosts are required to provide 100 mA minimum before enumeration, right? \$\endgroup\$ – endolith Jul 5 '16 at 21:06
  • 1
    \$\begingroup\$ I don't know if any OTG hosts would actually reject a 100mA request, but it's theoretically possible. \$\endgroup\$ – Adam Haun Jul 6 '16 at 6:09
  • \$\begingroup\$ From what I've read, a standard USB peripheral that wants to communicate with an OTG Host needs to support "Data-line Pulsing" or "VBUS Pulsing", and I guess VBUS is just not provided otherwise, so a normal device can't connect to these hosts anyway? \$\endgroup\$ – endolith Dec 17 '20 at 17:02
  • 1
    \$\begingroup\$ If I remember right, the peripheral only needs to support VBUS pulsing if it wants to use the host negotiation protocol to take over the host role. The default host/device assignment is set by the cable, which ties the ID pin to ground (?) on the host side. HNP happens after enumeration. VBUS is always present, and all self-powered devices MUST monitor it to be spec-compliant, whether they're OTG or not. \$\endgroup\$ – Adam Haun Dec 17 '20 at 22:19

You don't actually describe a usb OTG situation. The first option, connecting to a PC would be normal usb slave. The second option, using bluetooth to connect to a smartphone doesn't include usb in any way.

And yes, USB OTG allows for any peripheral to act as a usb slave without change, as long as the USB OTG Host knows what to do with it. This is why 12 year old (Like 32mb) usb flash drives still work on OTG Hosts. That's the point of OTG Hosts, they act as a regular host when needed, the only limitation is the manufacturer's support for different devices.

  • 2
    \$\begingroup\$ I don't think you read the question carefully enough. The OP is connecting via USB to a PC (OP's device is a peripheral) or to a Bluetooth module (OP's device is the host). The Bluetooth module is then providing a wireless link to a cell phone. \$\endgroup\$ – DrFriedParts Feb 22 '13 at 3:50
  • 1
    \$\begingroup\$ @DrFriedParts You mean OP means he is going to connect it to a commercial USB Bluetooth Adaptor, instead of a serial/spi bluetooth module? That seems like a kinda roundabout exercise in frustration. OP needs to clarify. \$\endgroup\$ – Passerby Feb 22 '13 at 4:38
  • \$\begingroup\$ @Passerby, that is correct, although I am not going to try to connect tor a commercial Bluetooth module, but a custom design, meaning an off the shelf bluetooth module designed to be incorporated into ones hardware without going through all the RF drama. The reason for this "roundabout" way of doing things is to keep the cost of the device it is connected to to a minimum, since the Bluetooth will only be used for diagnostics, and does not always have to be connected(a USB-OTG enabled MCU is relatively cheap). An installer then only has to have one Bluetooth module for multiple devices. \$\endgroup\$ – Merwe Feb 22 '13 at 5:49
  • \$\begingroup\$ @Merwe Do you have a link to said module? Because a common one is a serial/uart to bluetooth one like the HC-05 and HC-06 ones on ebay. No usb needed. \$\endgroup\$ – Passerby Feb 22 '13 at 7:25
  • \$\begingroup\$ @Passerby, the module I intent to use has both a UART and USB interface. The reason I want to use the USB is in order to be able to connect to a PC as well, without having to have some kind of TTL to serial/USB converter. The link: rovingnetworks.com/products/RN52 \$\endgroup\$ – Merwe Feb 22 '13 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.