1
\$\begingroup\$

I need clarifications about which USB receptacle and plug I have to use for an embedded product.

I looked on line and I found a lot of documentation like this or this and I understood that:

  • If I want to realize an embedded product with device role, I have to use mini or micro USB B receptacle. So I can connect my device to an host using a cable with a mini or micro USB B plug and a USB A plug.
  • If I want to realize an embedded product with host role or OTG, I have to use mini USB A or micro USB AB receptacle. So I can connect a device like a PenDrive at my embedded product with a cable with mini or micro USB A plug and a USB A receptacle; if my embedded is an OTG I can also connect its to an host with a cable like previous case (and checking the ID pin).

That's right?

If yes I have 3 questions:

  1. If with mini or micro USB B receptacle my embedded product must to have a device role, why in the receptacle connector there is also the ID pin that can be tested by microcontroller (and so switch from device to host role)?
  2. Only the cable with mini or micro USB A plug and a USB A receptacle are USB compliant?
  3. If I'm not mistaken, many smartphones a few years ago had a receptacle mini or micro USB B but, with a particular OTG cable, they could take the role of host and read for example a PenDrive. In this case all these smartphones are not USB compliant?

Thank you in advance.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Micro USB is a dead end. Yes, smartphones with uB receptacles are not USB compliant if they officially declare OTG functionality as user function. Drop u-USB and move to Type-C. \$\endgroup\$ – Ale..chenski May 4 '20 at 16:45
2
\$\begingroup\$

USB-C

If you are building a new device, use USB-C. It is much more flexible for OTG. For USB-C the connectors are the same and the roles can be decided with pull up or pull down resistors. Here is some good reading on the subject.

Other USB

USB-On the Go was added to the USB 2.0 spec as a way for a device to act as either slave or host. It does not break the compliance of a device. The posts you referenced are correct in that the host is decided by detection of the ID pin. For mini or micro USB you can attach an AB port that accepts either form-factor cable to your device. Please note, you need to build an OTG capable device to be able to sense the state of this PIN. There are several integrated chips that have this functionality built in. Whether the ID pin is grounded or floating is part of the cable.

Unfortunately, many manufacturers have chosen to build USB-OTG devices with USB-B connectors (Example) and you need a non-standard cable to make it work. This is not ideal but these cables are widely available. The good news is that if you build your device with the proper AB connector, it will still work with these cables.

USB-Types

\$\endgroup\$
6
  • \$\begingroup\$ +1 for the useful link. \$\endgroup\$ – Dwayne Reid May 1 '20 at 2:05
  • \$\begingroup\$ You haven't really addressed the poster's actual question, but rather gotten distracted by things that were not asked about. Please re-read the actual question asked. \$\endgroup\$ – Chris Stratton May 1 '20 at 7:13
  • 1
    \$\begingroup\$ Thanks for the USB-C tip, I will evaluate it. About USB 2.0 and micro and mini connectors, would you like to tell me that the type of mini or micro connectors (A or B) for OTG device, is not specified in the USB standard? \$\endgroup\$ – LucaG May 1 '20 at 8:21
  • \$\begingroup\$ Chris - My goal is to not directly repeat the posts that are ALREADY linked in the question... If that is all you expect then this question should be closed. Luca - I'm sorry it wasn't clear, I have added another line to clarify you can use the AB connector. \$\endgroup\$ – Alphy13 May 1 '20 at 16:20
  • 1
    \$\begingroup\$ Thats easy, you just use the two center pins. en.wikipedia.org/wiki/USB-C#USB_2.0/1.1 If you choose to build detection yourself, start with the fist link I posted in the answer. If you still have trouble, open a new question. There are a lot of helpful people here. \$\endgroup\$ – Alphy13 May 2 '20 at 17:27

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.