Android OS Forum banner

Can you charge & USB Host mode simultaneously?

215K views 316 replies 57 participants last post by  rvdee 
#1 ·
I wanna get a Nexus tablet, but I'm afraid that I won't be able to access my USB hdd and charge the device at the same time. Can someone confirm if it's possible? I asked over at xda forums, but I didn't get a solution.

could I perhaps use a USB OTG cable and a Y-cable with a USB charger? or even if I had to get a usb hub, I would, I just need to get some clarity.
Thanks!
 
#2 ·
I doubt it. However, the battery life on this thing is really pretty good. From Tuesday around 5PM until mid Thursday, I used it for maybe 3 hours of screen-on time and had it unplugged the entire time. I watched some Youtube, flashed some a couple ROM's, blah blah blah, and the battery was around 65%.
 
#3 ·
Hmm.. Well, if it's impossible, is it hardware or software limitation?

Picture this, i plug in a powered USB hub, into the otg cable, except I cut out the 5v wires before it reaches the hub, then apply my own 5v from a separate charger. Would it charge upon receiving the voltage? Or would it ignore it cuz its in host mode?

Pardon the grammar I'm on my phone
Thx
 
#9 ·
Assuming that is the charge controller used in the n7...

Short Answer: No

Long Answer: When the device detects that it has entered USB Host Mode (OTG) the charge controller switches from charge mode to boost mode. In effect it reverses the charge circuitry (not exactly, but close enough for this explanation) so that instead of charging the battery it draws power from the battery to power whatever device is connected. When in Boost mode, the controller will not charge the battery from the V[sub]BUS[/sub] (USB) input. In theory, there are 2 ways in which host mode + charging could be accomplished. Method 1 (Hardware): The charge controller has an additional V[sub]IN[/sub] connection intended for use with an AC adapter which should be able to continue charging the battery even when V[sub]BUS[/sub] is in Boost mode. However, given the WCSP package (Surface mount connections under the chip itself, no exposed pins) this chip uses, connecting to this pin would be virtually impossible if it is not broken out somewhere on the circuit board. Method 2 (Software): The controller has an I[sup]2[/sup]C interface used to control its operation. This interface should be connected and being controlled by a kernel driver. If this driver is accessible, it should be possible to tell the charge controller not to enter Boost mode, and thus allow charging to continue while the USB interface is in host mode. This would allow charging, but also require an external source to power any attached usb devices. Note, this is all heavily dependent on the assumptions of the charge controller being used, and configuration it is in. In other words, Maybe...
 
#10 ·
I havent looked at that spec sheet but I just went over the USB OTG spec and the spec has details on how to get it to work. Charging the A-Device while connecting to the B-device is possible with a resistance between the ID pin and ground as well as power. Both devices get power from the charger. There is just no SRP support but also isnt needed since "VBUS is already asserted at both the OTG Port and Accessory Port."
 
#11 ·
dcplaya,

Thanks for pointing that out. After some further looking I did find the Battery Charging Spec which describes an Accessory Charging Adapter specifically for this purpose. I cannot seem to find any real world implementations of it however, so it would be interesting to see if the n7 actually supports it. I may have to do some experimenting this weekend
 
#12 · (Edited by Moderator)
I'm pretty sure the ACA won't work. A friend of mine is on the USB standards committee, and he says only Nokia fully supported USB OTG. There is a lot of signalling needed to get ACA to work, so the Nexus 7 and Galaxy Nexus only support USB host.

His company makes power management ICs for camera, phones, etc., and he says the PMIC in the N7 will increase charging current until it sees a drop in voltage, so if you try to AC charge with a charger that can't supply the current, there is no danger in harming the charger.
 
#13 ·
The Galaxy Nexus OTG kernel code does not evaluate a single resistor. So no [background=rgb(245, 245, 245)]Battery Charging Spec implemented here.[/background]
However, I was able to modify this kernel to make it accept a charge while in OTG host mode. A Y-cable is connecting my phone to a powered USB hub. The hub has a USB-to-Ethernet dongle, connected to a router. The hub is also powering the Gnex via the other end of the Y-cable. The phone can now, say, act as a WiFi access point (wired + 3G!) and it's battery level will never drop below 100% or 99%. One disadvantage: in a real on-the-go situation, this kernel will not anymore power slave devices. One could fix this by allowing the user to switch between OTG host mode charge-out (default) vs. OTG host mode charge-in. Should be possible with the N7 as well.
 
#15 ·
On the Galaxy Nexus, removing the complete body of method tuna_set_vbus_drive() in arch/arm/mach-omap2/board-tuna-connector.c will disable charging of OTG slave devices and will allow the OTG host itself to be charged. The battery icon will not be updated by this modification alone.
 
#25 · (Edited by Moderator)
I'm considering upgrading to Galaxy S3 and need to use USB DAC and charge it at the same time (car usage with good audio). This topic is the only one that gave a clear explanation that it's not working, why, and how to make it work (in principal). The guy in XDA mentiones at his website that Galaxy S did NOT work with his dock.

Any news on how to do it? Is it possible via app? I wonder how easy it is to modify kernel (I've flashed ROMs before and I'm a web designer and developer but I don't know how to modify android kernels). I'd be OK with it not powering other devices, Y cable with power adapter would do that in the car. Please post any news here and any progress or instructions if there is a workaround...
 
#26 ·
A USB DAC in the car, driven by a phone. What a nice use case. Very geeky and totally reasonable. I want this, too, now.

Is it possible via app?
No. Here the four levels of host mode support:

1) No host mode support. I'm not 100% sure, but I think the Nexus S falls into this category.

2) Some devices do support host mode and because they have a separate power plug, charging is not an issue. My old LG tab, running CM10, falls into this category.

3) Some devices do support host mode, but have no separate power plug and do also not support the full battery charging spec. These devices are able to detect a short on the ID pin (-> OTG host mode), but are not able to detect resistors on the ID pin (for signaling: host mode + power incoming). The Galaxy Nexus falls into this category. And I assume the Nexus 7 does as well. What a kernel patch can do, is to pretend a resistor IS being detected. So in host mode, the modified kernel will not provide 500mA to the slave device (DAC, Ethernet, ...), but will instead accept external power to operate the host device.

4) Some devices seem to support host mode + battery charging spec. If the correct resistor is being detected, they automatically switch to be operated on an external power source. Sounds like the XPERIA S falls into this category. Kudos to Sony, if true.

USB host mode, being required to power itself + a slave device, all from battery, is near useless. Makes you think why "category 3" devices exist at all.
 
#31 · (Edited by Moderator)
Take a look here: http://mehrvarz.gith...wer-nexus7.html

I think this does what you want. But it's still very new. I got my N7 only end of last week :)

As with the Galaxy Nexus: without external power, this kernel will NOT drive your USB slave devices.
But it will accept external power to operate both devices - and it will also (slowly) charge it's own battery while in host mode.
 
#37 ·
Someone sent me a PM asking if I was using a custom ROM or kernel mod on my Galaxy S2. No, I'm just using stock ICS 4.0.4 rooted, and it just works.

To add to my earlier post, the reason I didn't get the one with the female microUSB port is because the listings I had found said that the charging would be for the external USB device. With the cable I purchased previously (http://ebayitem.com/190710044655) you'll need a standard USB extension plus a universal USB charging adapter since the female port is full sized USB.

Since my last post I decided to also try this cable (http://ebayitem.com/120980364117) with the female microUSB port. Hopefully it will work, too. I would prefer it since I could just use my regular microUSB chargers with it. I'll report back after it arrives.
 
#38 · (Edited by Moderator)
I ordered your original cable, will see if it works with north-american Galaxy S3. Just to be clear: USB power should go to male full-size USB on this cable, right? So if I have a car adapter that has a female USB port, I need "usb exnetsion" cable (F to M), correct? External device (USB DAC in my case) would be plugged into the female USB of Y cable, and microUSB to the phone. Correct?
 
#46 · (Edited by Moderator)
That's right, Roman.

I just got my 2nd cable with the female microUSB for charging (http://ebayitem.com/120980364117), and it also works for simultaneous USB-OTG and charging my phone, with the added benefit of being able to use any microUSB charger.
SUCCESS!!! I can confirm that this USB OTG cable (http://ebayitem.com/190710044655) DOES CHARGE MY GALAXY S3! I wanted to doplicate your experience so I got the exact same cable. I plugged in USB cardreader with SD card into the phone through this cable (it lit up and card is fully readable), then plugged USB cable end into PC and phone showed a charging icon! Moreover, after waiting for 5 min. with screen off (cardreader still glowing blue and working) battery has gone up from %72 to %75 (and while I was writing this, to 78%), so it is indeed charging! Yay! It probably won't get up in the car, where just phone alone is "not discharging" at best from the car adapter, but at least it should allow me to listen to music with quality DAC and use navigation without (or with minimal) discharging.

I have not tested it with USB DAC that I intend to use for my car (Behringer UCA222), because I have to go out and buy it. Hopefully it works. Anyway, this cable definitely works with simultaneously charging my north-american Samsung Galaxy S3 (from Bell Canada) while powering USB cardreader!
 
#45 ·
Thanks Snow02 for the information on determining the type of charging going on. I wasn't aware of this. And thanks Timur for the explanation of how your patch works on the GN in regard to powering but not charging the phone. And, indeed, the battery stats screen does show "Not charging" when operating on external power and in host mode, as expected.
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top