3

Phones typically use micro-B instead of micro-AB or mini-AB, meaning that micro-A and mini-A cables can't be connected to them. Since these cables use an additional, grounded pin to identify which device is the host on the micro-A / mini-A end, how would a phone with a micro-B receptacle determine the host? Or do phones lose the ability to act as a host by use of the micro-B port?

VortixDev
  • 562
  • 4
  • 17
  • 1
    The micro-B receptacle still have the ID pin. – Ale..chenski Feb 08 '18 at 17:35
  • @Sparky256, your comment is incorrect. A phone with Type-C receptacle is whatever it is, usually a device. If it is a dual-role device, it advertises the dual-role function by periodically toggling (alternating) sink-source signature on CC lines. When a Type-C "link partner" is plugged in, they end up with correct roles. https://electronics.stackexchange.com/a/255772/117785 – Ale..chenski Feb 08 '18 at 17:47

2 Answers2

7

You're confused. USB Mini-A, Mini-B, Micro-A, and Micro-B plugs -- as well as the ports they plug into -- all have five pins, including one ID pin. They are all electrically identical.

enter image description here

The only difference between Micro-B and Micro-AB is the physical shape of the port -- a USB Micro-A connector cannot be inserted into a Micro-B port. As Micro-A (as well as Mini-A) connectors are almost never seen, this has no effect in practice.

  • Thanks for the response - I'm aware that micro-B also has 5 pins, but my understanding was that micro-B cables won't have their ID pin grounded on either side, meaning that neither device identifies as host - am I wrong? I thought you'd only find the ID pin grounded on the micro-A side of a cable. – VortixDev Feb 07 '18 at 02:15
  • What do you have in mind when you say "micro-B cables"? Typically, a cable will only have micro-B on one end. The other end is either type A male (for micro-B acting as a device) or type A female (for micro-B acting as a host). –  Feb 07 '18 at 02:17
  • Sorry for the ambiguity - I mean a cable with micro-B on both ends, though I think your comment answers the question, in the sense that perhaps you don't get such cables to connect micro-B phones to other micro-B devices? – VortixDev Feb 07 '18 at 02:20
  • 3
    I've never seen such a cable, and I suspect they're prohibited by the standard. But I don't see any reason you couldn't make one by strapping the ID pins on each Micro-B end appropriately, then printing HOST and DEVICE on the respective ends. :) –  Feb 07 '18 at 02:23
  • It is in fact very hard to find any cables (even something like a short bulkhead extension breakout) which pass the ID pin through - pretty much the only commonly available ones that do anything with it are those which assert it in the shell of the micro or mini connector. – Chris Stratton Feb 07 '18 at 02:26
  • 1
    This is not what is available or not. There is no uB - uB cables because the only u-cable is defined as uB - uA. The other legal cable is uB to Type-A plug. The third one is uA captive cable. There is also uA - Type-A receptacle adapter. That's it, only four official types. This is all in the specifications. – Ale..chenski Feb 07 '18 at 03:14
  • 1
    @VortixDev, you are correct, B-cable overmolds must have ID pin floating. However, industry is somewhat in disregard with specifications, and uses uB receptacles instead of u-AB on phones and tablets. As result, there are bootleg uB - Type-A repectacle assemblies called in marketplace as "OTG Adapters", with ID pin grounded. – Ale..chenski Feb 07 '18 at 03:19
-1

Most (if not all) phones/tablets with a single micro-B port are in fact dual-role devices. They (nearly) all have the capability to act as host, mainly partially for the purpose of debug function and initial partitioning/re-partitioning and configuration. Usually one can connect a hub, and have keyboard, mouse, and flash drive to perform this function in phone bootloader (if it is unlocked). But all these functions are not for the end user to have, so manufacturers resorted to a trick limit this use - they don't use officially specified u-AB receptacles on the devices. Instead they use micro-B receptacle, and, in cases of emergency/necessity, rely on a theoretically illegal "OTG Adapter", which is a short cable with Type-A receptacle on one end, and u-B plug with ID pin grounded instead of u-A plug (which is technically in violation of specifications, since only u-A plug should have the ID pin grounded). More, having a phone to behave as a host to a bunch of peripherals would drain the device battery faster than customer's expectations, so this mode is not desirable.

In short, illegally grounded ID pin in u-B plug makes a phone to assume the role of USB host. This is how most phones manage their USB host function.

Ale..chenski
  • 38,845
  • 3
  • 38
  • 103
  • 4
    Lots of wildly imaginative ignorance wrapping a tiny shred of truth. There's no secret trick or attempt to lock end users out the USB host mode, in fact it's pretty much *only* for end users and no small number of phones *ship with the adapter cable*. In contrast, manufacturing and development systems strictly operate the phone in *device* mode as the programming and test systems are the host. Knowledge of these systems and the software itself is very widespread and common among people who *actually* work on them - it's even right there in the public Android documentation. – Chris Stratton Feb 07 '18 at 04:52
  • 1
    This makes no sense, *what* do the manufacturers stand to gain from stopping end users from using their device as a USB host? Why do you have to make this a conspiracy theory? A plausible reason why nobody uses micro-AB is because it sucks mechanically. See https://electronics.stackexchange.com/questions/242619/why-do-most-usb-otg-dual-role-devices-use-micro-b-connector-instead-of-micro-ab – jms Feb 07 '18 at 04:57
  • @ChrisStratton, having a bad hair day? Are you disputing the fact the the use of u-B receptacle is in violation of USB specifications, or what? And the fact that people have to use a out-of spec cables for OTG function? The OP asked how they do host mode, and I explained. What is your problem here? – Ale..chenski Feb 07 '18 at 06:23
  • @jms, what the heck, which conspiracy? – Ale..chenski Feb 07 '18 at 06:24
  • "But all these functions are not for the end user to have, so manufacturers resorted to a trick" kind of implies that manufacturers as a group secretly don't want you to connect various peripherals to your phone, so they try to stop you with shady means. Unless you were joking, of course. – jms Feb 07 '18 at 06:30
  • @jms, one good reason not to allow the host mode easily is to prevent premature battery drain on a communication device (which is the primary function of a phone), and to avoid customer's complaints. Would it be a good enough reason for you? – Ale..chenski Feb 07 '18 at 06:34
  • No, I'm not convinced by that logic at all. Had the industry settled on the "correct" connector (micro-A), OTG adapters with them would be commonplace and sold everywhere. We instead use OTG adapters with micro-B, but they are *still* equally easy to find. If the manufacturers really wanted to stop us from connecting peripherals to our phones, *they wouldn't add host capability in the first place*. Even if host mode was included in the chipset by default, they'd be able to disable it in software if they wanted to "reduce consumer complaints", or use some weird propietary connector to stop us. – jms Feb 07 '18 at 07:20
  • "...have the capability to act as host, mainly for the purpose of debug finction and initial partitioning/re-partitioning and configuration" is unfounded. How is host mode supposed to enable debugging, partitioning the flash and writing configuration data *in a way than couldn't be done with regular slave mode*? – jms Feb 07 '18 at 07:28
  • @jms, you folks apparently never dealt with bootloader. End of discussion. – Ale..chenski Feb 07 '18 at 08:04
  • 1
    lol, this answer actually answers the question (compared to the upvoted one) – Andrejs Gasilovs Feb 07 '18 at 08:09
  • 2
    @GAttuso actually *neither* answers the question. The potential host detects the presence of a USB slave device by checking the sense pin (pin 4) of the connector - if it's grounded, it's a slave device (i.e. an OTG adapter) and the phone acts as a host, if it's floating, it's a regular USB cable and the phone acts as a slave. If there's a 124k resistor to ground, it's an externally powered slave device *which can deliver power to the phone*, so the phone simultaneously charges and acts as a host. – jms Feb 07 '18 at 08:21
  • Most phones can be flashed as a slave device too, but even if host mode *was* necessary for flashing the phone, I don't see how this would confirm your hypothesis (given how the host functionality isn't disabled by software once the device boots up). – jms Feb 07 '18 at 08:32
  • 4
    @AliChen - on the contrary, dealing with phone bootloaders is a substantial part of my job, which is why I'm pointing out your **outright and imaginative lies** on the subject. Phone bootloaders operate in USB **device mode**, so that code can be loaded from a development system. Having to use a USB device like a USB stick for that purpose is extremely disadvantageous in a production or software development environment, which is why the people who designed phones and their SoC chose **device mode** as the primary interface for manufacturing, test, and development. – Chris Stratton Feb 07 '18 at 16:47
  • @ChrisStratton, If I expressed my view on a subject in a certain maybe limited way, how does it make "outright lie"? You sound like a disturbed man. – Ale..chenski Feb 07 '18 at 22:12
  • @jms, how exactly my answer doesn't address the OP question? We can appreciate your demonstration of knowledge of "accessory charging mode", but how does your brilliant elaboration make a better answer to a straight OP question, "how phones with micro-B receptacle are able to switch into host mode"? – Ale..chenski Feb 07 '18 at 22:17
  • 3
    I, too, have _never_ heard of a device that operated this way. It wouldn't make sense. Operating as a USB host is significantly more complex (and, thus, costly) than operating as a device; there's no reason a manufacturer would include that functionality just for debug and provisioning. –  Feb 07 '18 at 22:42
  • @duskwuff, all smartphones are essentially general-purpose computers. As such, they follow the standard paradigm of booting - booting first into some self-containing minimal OS (e.g. BIOS, UEFI, Bootloader), which usually have most functions of a host - ability to mount internal devices - mass storage volumes, and most of peripherals including communication with terminals. Only then you can select a sort of application, "fastboot/ADB" (or launch it via strartup script), and reverse the USB function from host to device. No wonder that ADB is Android Debug **Bridge**. – Ale..chenski Feb 07 '18 at 23:09
  • @AliChen Because OP asked how a mobile device knows to act as a host (instead of slave) when a slave device is plugged in. Neither you nor duskwuff actually answered that, only explaining the *mechanical* side of the question, even though the actual decision is made on an electrical level. – jms Feb 08 '18 at 05:10
  • @jms, you are confused. Slave device cannot be plugged into micro-B receptacle. Slave devices must have micro-A type **plug**. Duskwuff described mechanical incompatibility with connectors, and I explained the ID (electrical) issue, how it is worked around, where the ID pin is illegally grounded in micro-B plug (while officially it should be u-A plug, but it doesn't fit into u-B receptacle). Do you need more explanations? – Ale..chenski Feb 08 '18 at 14:02
  • 1
    @AliChen I'm not confused. I know that micro-B is the wrong host-side connector (the standard prescribes either A or micro-A for that). I agree that grounding the ID pin on a micro-B connector (as is done by everybody in the industry making USB OTG adapters) is not *standard compliant*, nobody is arguing otherwise. OP didn't ask about "is micro-B the right OTG connector" however, OP asked how the device knows when to act as a host. Since the phone/tablet doesn't know nor care which physical connector is present, (it only cares about the ID pin state), neither answer answered the question – jms Feb 08 '18 at 15:36
  • @jms, why should I explain details how a device detects the state of ID pin? This is a separate question, how. For any electrical engineer or even hobbist (or software developer) it must be clear: a processor usually has this pin as an input with a pull-up, or, if accessory charging is supported, has a more complicated comparator to discriminate between a short and 124k. Since direction of charging and VBUS control is involved, this function is frequently dedicated to PMIC, and PMIC reays this info over I2C to the main processor. What is the problem here? This is a topic of platform design. – Ale..chenski Feb 08 '18 at 17:26
  • "Most (if not all) phones/tablets with a single micro-B port are in fact dual-role devices." Yes. "to act as host, mainly partially for the purpose of debug function and initial partitioning/re-partitioning and configuration" No, they act as a Device for debugging/partitioning. "But all these functions are not for the end user to have" No. Samsung S7 has branded microB plug to A receptacle adapter in the same box as the phone, for instance. – endolith Mar 18 '21 at 19:54