31
\$\begingroup\$

Came across some doubts:

  1. What exactly are the differences between a USB host and device? Is it just that who powers the bus?
  2. When two devices connect how the device say "hey I will be the host and you be the device?"
  3. Can one device acts as a host as well as a device. For example, "A" should act as a device when a USB host is connected, and "A" should act as host when a USB device is connected?
\$\endgroup\$
7
  • 2
    \$\begingroup\$ This is directly and clearly answered right where you'd expect to find it, which is the USB spec, or even most introductory information on USB. -1 \$\endgroup\$ Nov 18, 2012 at 15:24
  • 2
    \$\begingroup\$ I would recommend that you read Jan Axelson's "USB Complete". It is a true gem on this subject matter. \$\endgroup\$
    – quantum231
    Jun 10, 2013 at 10:55
  • 7
    \$\begingroup\$ @OlinLathrop Your comment is not helpful. The USB spec is 75 MiB in size and is composed of 43 PDF files with a total of 2984 pages. \$\endgroup\$
    – Stéphane
    Jun 19, 2016 at 13:12
  • 2
    \$\begingroup\$ @Stép: The USB spec also has a table of contents, and even the earlier and smaller specs answer these questions. These questions are very basic and show a complete lack of even attempting to find the answers. \$\endgroup\$ Jun 19, 2016 at 23:23
  • 8
    \$\begingroup\$ @OlinLathrop My attempt to use Google to find the answer to these exact questions is what took me to this question. This was the top Google search result. Came here and saw the recommendation to read/search through nearly 3000 pages! That's why I said the comment wasn't very helpful. \$\endgroup\$
    – Stéphane
    Jun 21, 2016 at 3:21

2 Answers 2

34
\$\begingroup\$

What exactly are the differences between a USB host and device?

The host initiates all communication on the bus, the device only responds when asked by the host. For Details see the specs on usb.org.

When two devices connect [...]

One must behave as the host and the other as the device. Details can be found in the USB OTG Specs.

Can one device acts as a host as well as a device?

For example, many Android phones and tablets can (requires Android 3+). The "magic" is in the On-the-Go cable/adapter, which switches the phone into host mode by pulling the ID pin to GND.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ USB OTG Specs link not working \$\endgroup\$ Dec 2, 2019 at 13:12
  • \$\begingroup\$ Deep link removed \$\endgroup\$
    – Turbo J
    Mar 16, 2021 at 11:31
14
\$\begingroup\$

Just like Stéphane, I came here for the answer. Which I did not find here! With a little research this is what I found.

With a host controller you will be able to communicate with all USB devices, and with a USB device controller you can just communicate with a host controller.

USB host is the USB on the PC side in most cases and USB Device is the USB in your mouse ,keyboard, flash memory and so on.

All USB transactions are managed by the Host. and the Device only responses to the Host transactions.

Hope that helps.

\$\endgroup\$
3
  • 5
    \$\begingroup\$ It's not clear what you are adding that has not already been said years ago. \$\endgroup\$ Apr 25, 2017 at 3:09
  • 6
    \$\begingroup\$ He gave a slightly more thorough answer with concrete examples rather than sending you to the first page of a long and complex document. The selected answer is could have at least boil it down better \$\endgroup\$
    – user148298
    Aug 3, 2018 at 23:28
  • \$\begingroup\$ From another point of view, it's unclear if an MCU can present two or more devices, i.e. a keyboard with a built-in trackpad. Is the MCU a host connected to two devices, or merely two separate devices with the PC as their host? \$\endgroup\$
    – user148298
    Mar 17, 2023 at 17:37

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