Author Topic: USB DEVICE(microcontroller) AS HOST  (Read 14949 times)

kittu

  • Member
  • ***
  • Posts: 16
USB DEVICE(microcontroller) AS HOST
« on: August 05, 2010, 06:49:48 am »
HI..
  
I AM WORKING WITH MULTIPLE USB DEVICES
  
I HAVE QUARY ABOUT THE USB
  
1. ACCORDING TO THEORY OF USB WE CONNECT 127 DEVICE TO ONE USB PORT THROUGH HUBS
     NOW THE QUESTION IS THAT HOW THE 2ND DEVICE SHOULD BE IDENTIFYED BY HOST
      BCAUSE D+/D- LINE IS ALREADY PULLED HIGH (HIGH SPEED/LOW SPEED USB) WITHEN ENUMRATION WITH 1ST DEVICE,
      THEN HOW HOST CAN IDETIFY THE 2 ND DEVICE AS D+/D- LINE IS ALREADY HIGH
  
2. WHEN WE USE ANY MICROCOTROLLER AS HOST THEN HOW WE ATTACHED MULTIPLE DEVICE
     TO THAT HOST MICROCONTROLLER IF HOST CONTROLLER HAVE SINGLE CHANNEL USB(127 DEVICE TO ONE USB PORT)
  
HOW THIS COMMUNICATION SHOULD TAKE PLACE?
  
THANK YOU
  

Guido Koerber

  • Frequent Contributor
  • ****
  • Posts: 72
Re: USB DEVICE(microcontroller) AS HOST
« Reply #1 on: August 05, 2010, 09:54:15 am »
A hub is not just a mechanical branch for the bus, it is an active part isolating individual USB ports from each other.

Ron Hemphill

  • Member
  • ***
  • Posts: 19
Re: USB DEVICE(microcontroller) AS HOST
« Reply #2 on: August 06, 2010, 07:43:30 pm »
1. In addition to what Guido said, please note that each hub is, in itself, also a device, thereby contributing toward the 127 count.  Also, the hub tree can only go, at most, 5 levels deep.

2. USB puts most of the burden of data transfer and management on the host.  A software stack has to be developed for the microcontroller (the host) to be able to enumerate hubs and devices as they are connected.  After that, the host software stack then has to manage each and every transaction to/from each device.  In a nutshell, a host stack is a very complex bundle of software.

In reality, you will never be able to connect 127 devices to a single host root port, let alone have them be functional.  The burden on the host stack will be too great and will thus likely crash the host long before the 127th device is connected.

It sounds as if you need to learn more about the basics of USB, and the best way to accomplish that is from Jan's book, USB Complete (available on this website).  And please feel free to continue to ask questions here.