Electronic – USB host-mode on uC, to support small pre-defined set of USB devices

usbusb-host

Apparently, one of the main reasons why most 8-bit/16-bit uC's do not support USB host-mode operation is because of the rather expensive process called "enumeration". From my research, this step seems to be necessary when the host must identify the class of device connected to it, identify specific vendor/device and then load the appropriate driver to handle communication between host processor and device. The other reason being need to provide sufficient current to the devices.

Now if the "sufficient current" is not a big issue, let's say because my uC (which I'd like to act as USB host) is powered (via a well rated, regulated wallwart), and there are only 3 USB devices with which it needs to work, for instance —

  1. Device that uses proprietary Serial over USB
  2. Device (sensor) that uses USB-HID
  3. Specific vendor/model USB2.0 Bluetooth2.1 device

via say a USB hub device ? In fact, if it can be a powered hub, then the question of "sufficient current" is anyway addressed by it.

Is it possible to make do with say something like Atmel ATmega32U2 ? The idea being, instead of enumerating devices from a large list of possible devices, I know in advance which devices are connected, and how they are connected ? What might be the caveats if this were to be possible ? If someone is aware of such attempts (successful or not), would love to hear about them.

Best Answer

There are enough ways available to provide host mode with a microcontroller that trying to do it with something not intended for the role is "doing it the hard way".

Look for devices with USB OTG" = "On the Go" capability.
These can provide either host of slave capability as required.


If "... something like Atmel ATmega32U2 ... " includes an Atmel AT90USB64 , then yes.

ie using one of the available parts that DO have this capability is the "easy way" to go. There are enough ways available to provide host mode with a microcontroller that trying to do it with something not intended for the role is "doing it the hard way". Look for devices with USB OTG" = "On the Go" capability. These can provide either host of slave capability as required.

ICs with OTG capability of some sort

Cheapest in 1's in stock at Digikey:

AVR microcontroller with USB OTG capability $8.43/1 Digikey in stock.

PIC OTG & Host capable microcontroller $4.22/1 in stock Digikey

The PIC device is also the cheapest host / OTG microcontroller of any sort available in stock in 1's from Digikey.