I'd like to ask a quite specific question regarding the USB power management.
First of all, I will outline the design of my device. It is a symmetric signal line driver with a builtin audio codec for my DIY speaker system. The device is internally split into two mostly independent blocks: the very line driver with a controlling MCU and the audio codec (TI's PCM2706). Both need USB data connectivity (via an FT232R for the driver block) and the whole device should be bus-powered. The two blocks will be linked together by an USB hub chip, yielding a single uplink USB connection to the PC. I expect the consumption of the driver stage to be something between 100 and 200 mA (definitely more than one load unit).
Here comes the problem: According to the USB specification, a bus-powered hub can provide only one unit per downstream port while drawing max 5 units from the upstream. I'd like to know, what would the hub do if I requested two units via the FT232 for the driver stage. The 5-unit upstream limit will not be reached (1 unit for the hub, 1 unit for the codec and two for the driver), so the computer should be physically able to supply that current.
For the hub chip, I've been checking out http://www.ti.com/lit/ds/symlink/tusb2036.pdf. There is an option of "ganged" powering mode, would this be any help? Or would the chip just refuse to grant two units to the driver? And in this case, is there any dirty workaround?
I am aware of the requirement that high power devices are also required to draw max 100 mA during enumeration; this is not a problem as the FT232 is able to turn the driver on just after the enumeration. The hub will turn the stages on independently as well.
Hope I stated my problem clear enough and thanks for your time in advance 🙂
I did some more research on the TUSB2036 chip. The overcurrent protection can be turned off by the /OCPROT pin. The hub then reports to the root controller that it is not able to detect overcurrent. There is a warning in the datasheet, that OC protection is required by USB 2.0 specification – this does not matter for me, I only need 1.1 Full-speed. The PC's root hub should then IMO supply 500 mAmps to the whole device. Thus, I could set the driver's FT232 to require 100 mA only and the hub would never know if I would have exceeded the limit (respecting the 500 mA from the PC of course). Can someone tell if this could work?
My understanding of the your design is that the entire device is on a single PCB, is within a single enclosure, and is connected to the host by a single USB cable. You've integrated a hub onto the PCB to allow both the devices to communicate with the PC. The following answer will hinge on these assumptions, if it's made of several separate devices connected by disconnectable cables then that changes things.
In this case, I suggest that you simply configure the hub to enumerate as a high-power device, and share the resulting 500 mA among the whole board. Interestingly enough, TI's ganged-port sample schematic shows the devices all connected together, even when using their power management IC:
The incoming 5V power supply line (highlighted in blue, as it's one of two nets that we're interested in on this complicated schematic) is connected to a TPS2041 power management IC (a generous description, it's really just a FET that shuts down when it detects 500mA of current being passed). However, each of the inputs are shorted together, and each of the outputs are shorted together as well, and then distributed to each of the downstream ports (the net shown in red).
Basically, they're doing overcurrent protection for all of the downstream sections in a single IC. They have no way of detecting whether they have three low-power (100mA) units, a single high-power unit, or two low-power units and one 300 mA unit. All these options are acceptable based on this reference design. You wrote:
but, to directly answer your question, this design from Texas Instruments (a USB group member and major implementor) shows that you only have to guarantee that the total current is less than 5 units.
To solve your problem, the rules state (taken from the excellent USB in a nutshell document):
If you can guarantee that your driver stage will not begin drawing current until the device has been configured (which might be as simple as a timed delay in the host controller), you can simply wire everything together. Because your entire circuit is on a single PCB and has no user-accessible downstream ports, you can probably also leave out the TPS2041 and simply design the system to not require more than 500 mA of current in any state.
Another benefit of enumerating as a high-power device is improved input voltage specifications. When you have enumerated as a low-power device, the host is only required to produce 4.40 V at the upstream port (which will be lower at your device due to the resistance of the cable). When you have enumerated as a high-power device, the specification guarantees that you'll get 4.75 V, which is more likely to be within the operating range of any 5V components you may be using.