9

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.

bdutta74
  • 3,524
  • 11
  • 46
  • 67
  • 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. – Russell McMahon Jan 30 '12 at 09:40
  • Well, then, add: "4. USB Hub" because that's another device driver you'll need. And, talking to a Bluetooth device is bound to be yet another project. – gbarry Mar 24 '15 at 06:03

2 Answers2

6

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.

Russell McMahon
  • 147,325
  • 18
  • 210
  • 386
  • Can you teach some of what OTG is also, instead of just a bank of places to buy things? – Kortuk Jan 30 '12 at 10:18
  • Thanks @Russell. Those are some good options. I was not aware that USB-OTG or USB-Host options are available on 8-bit uC's. I wish the AVR's were available in low pin-count and in the same price-range as the PICs. The PIC's as such seem to be very close to what I need, but wanted to see if V-USB like SW bitbanged solution would be possible. Probably not. – bdutta74 Jan 30 '12 at 12:54
  • Reading thru the PIC documentation around OTG, I realized that the OTG implementation (or standard, not sure), isn't a full "host" implementation, i.e. there are some limitations/caveats. While it might still very-well fulfill my needs, but wanted to highlight this fact. – bdutta74 Jan 31 '12 at 05:56
  • @icarus74: Would you care to share examples of such "limitations/caveats"? – pfalcon Jun 09 '13 at 22:44
  • @pfalcon, don't quite remember what they were (been a while), but I recollect that the data-sheet itself listed the limitations, so that'd be a good place to look. – bdutta74 Jun 10 '13 at 06:32
  • @Kortuk - I'm aware of your aims BUT I think that's a bit of an unfair comment. NB!: I'm not annoyed/concerned/upset/... - just think the answer is better than that would make it seem. My original comment gave a one line summary - I've copied it to the top of my answer for those who can't read a whole page at a time :-). THEN my Atmega 64 advice is re a specific product that comes close to his Atmega 32 spec. THEN there is a list of ALL the microcontrollers that Digikey sell that list OTG in the selector guide. That's not a buying list per se - Digikey happen to be a fantastic data source. ... – Russell McMahon Jun 10 '13 at 11:16
0

There is some SW based implementation of USB Host controller on Atmega uControllers

SIAM32 USB HC (Software Implemented Atmel Mega32 Universal Serial Bus Host Controller ) https://courses.cit.cornell.edu/ee476/FinalProjects/s2007/blh36_cdl28_dct23/blh36_cdl28_dct23/

http://ibm-cvut.felk.cvut.cz/~usbhatm07/presentation/presentation.pdf

Zaki
  • 35
  • 4