yashsingh1/xdaforums huggingface dataset:
[Hardware Hacking General] Renate:
Just a few comments on this project:

If you put a hub or device in then it requires that you operate the tablet's USB interface in host mode.

Normally, something supplies power and will not accept power for charging when in host mode.

There are hacks to get around this, but I'd see if I could get this all working externally before I started modifying.

You could end up with your hub idea working find, but you are unable to charge the tablet.

When you do lay the cables in, twist the data pair and leave the two power leads straight.
[Hardware Hacking General] bigpetefox:
This looks awesome! Can't wait to see the tutorial if one becomes available, these devices get me in trouble! :cool:;):D
[Hardware Hacking General] the0bserver:
Have been watching this thread with great interest as well. Indeed, I always only lurked on XDA, this piqued my interest enough to actually join.

Fingers crossed for OP!
[Hardware Hacking General] iAppleDev:
Hub fits I just need to come up with a 5V power somehow got the Data and ground figured. Can someone come up with any ideas to create 5V power, maybe some fancy circuitry to bump the power from battery to 5V?
[Hardware Hacking General] eBandit078:
What model number hub did you use, does that have the USB OTG built in to it?

I am going to ask a few people in another type of forum about the voltage, a few on there know more than I on this topic. What is the battery stock voltage? I first was thinking resisters but I think we would need to know the exact current going through it to determine the right size. I am searching for tiny DC voltage regulators to see what I can find also, but wasn't sure the stock voltage. Here is some info on DC voltage regulators youtube.com/watch?v=GSzVs7_aW-Y&feature=fvwrel I cant post links yet so it doesn't have the www . The video talks about regulating DC voltage to power 5volt usb devices.

Do you think anyone will have a custom ROM or other hack so we can mount and install to the micro SDHC card once this mod is complete? Because that is what I want before I go this far.

Glad your back at it though! Thanks for your work on this.
[Hardware Hacking General] Renate:
Normally the 5V power to external devices is fed from a charge pump in the USB PHY interface chipset.

Some non-standard implementations only supply 3.7V battery power.

3.7V may/may not be enough for your hub and SD card.

If you are using 3.7V to a standard USB/SD card adapter, you might try bypassing the LDO in the adapter.

Also, many devices can only host about 100 mA.

Both hubs and USB/SD card adapters can be current hogs.

I think that some actually experimentation is called for before taking a Dremel tool to your tablet.
[Hardware Hacking General] eBandit078:
Wouldn't it be best to us a non powered usb hub to split the usb connection? I doubt a small keyboard would use much and as far as I go, I would only use the usb for a small case sized keyboard, charging the device and the micro sdhc card/reader.

So is the battery only 3.7 volts? I was thinking it might be more and we needed to step down, so we need to step it up for the micro sdhc reader?
[Hardware Hacking General] ED2O9:
It's actually two 3.7v Li-Poly cells set up in series for a total of 7.4v. As pointed out (rather rudely) in a prior post, the leads aren't spliced on the pack itself so that a 5v USB input can charge the batteries. My old Acer A100 actually had the batteries spliced so that a 12v charger was needed. It had very weak battery life, but the upside was that the 12V charger would take it from 15% to 100% is a little less than an hour.
[Hardware Hacking General] littleguy77:
Very good points. You may be happy to know that the USB specification recently provided a means for charging an OTG device while in host mode. It's called "Accessory Charger Adapter". See Chapter 6, and in particular Figure 6-2 from the specification:

www.usb.org/developers/devclass_docs/BCv1.2_070312.zip

If you could nail this down, you might solve a bunch of challenges with the +5V supply at once. Not sure what it would take to implement though. A cursory search for dedicated ICs didn't produce anything for me.

:good: Second that suggestion.
[Hardware Hacking General] Renate:
So this device runs on 7.4V dual Li-ion batteries?

Is there a separate charger input or only over the USB?
[Hardware Hacking General] eBandit078:
He is saying that it has dual 3.7 volt Li-Ion batteries that are wired in series to create 7.4 volts. If it had dual 7.4 volt batteries they would be wired in parallel to still be 7.4 volts.

Unless there is a charger input internal that they didn't use, there is no charger port on the n7 like I had on a cheap $99 tablet previously. The n7 only charges via USB. I wish it had a dedicated charger port like some cheaper tablets I have seen and tried out; cause that would make things easier maybe.
[Hardware Hacking General] Renate:
Mmm, that's what I meant, dual (2 x 3.7V Li-ion) = 7.4V.

The Vbus pin on the USB originally supplies 5V or accepts external charging current.

You will have to keep the original connection between the Vbus pin on the USB connector to the USB PHY chipset.

Of course, you could supply your own 5V (from somewhere) to feed the hub and the SD card adapter.

This would mean that the available current will be reserved for only external USB devices.

If you go for a buck DC converter, go for something with the least current that you need, it will be more efficient.

Any of these mods will prevent your tablet from ever being a USB peripheral.
[Hardware Hacking General] AdamOutler:
I didn't want to read the whole thread... a news writer asked me to stop by. I heard that you guys were looking for 5v.. why not make it?

3->5V boost converter hooked to battery + 5V regulator = 100% compliance with USB standards.

Another more hacky option is that some USB devices will run on 3V just fine. Locate a device which is capable of doing this .
[Hardware Hacking General] ED2O9:
I believe that the pogo connections on the side can be used for charging. I'll have to check the details, but they are used when the Nexus is set into a proprietary dock for external speaker and also for charging. If that's the case, the 4 pins are 5v input, ground, right and left speakers.
[Hardware Hacking General] eBandit078:
I wasn't sure cause how it was stated.

So you mean it wouldn't be able to be seen by a PC which would hurt an ROM upgrades, un-rooting etc? That wouldn't be good if that is what you mean.

Where does 3 volt come from? It has two 3.7 volt batteries from has been stated. I would assume you would want to come off of it as 7.4 volts and not just on one battery or wouldn't you deplete one battery sooner that the other and they not be balanced?

I have no clue so that's why I am asking. On my 1964 Impala SS lowrider competition Hydraulic Hopper, I did that sort of but that was big Group 31 lead acid batteries, lol. I had 10 batteries running two sets of 5 that were wired together (2 sets at 60 volts), the front pumps were 60 volts and the rear were stepped off at 36. Not sure if these little Li-Ion batteries would be affected doing that or does the system do that for some stuff already???

Hmm, that sound promising! So if the mod prevents usb charging, maybe have a device to connect as a dock (I can make that) that charges from that spot. Or get the 5 volts from that but internally if you can solder into it easy enough. Anyone know of a schematic of the n7 as far as how it is wired up for voltage to the dock connection, to the usb, batteries and so on?

Great ideas everyone, hope it all gets solved.
[Hardware Hacking General] Renate:
I'm still in favor of checking out if this all works externally first.

See how much current the regular USB PHY chipset supplies.

See how much current the hub and the SD card adapter take.

See if you can run just the hub and the SD card off a separate 5V supply

and still have the 2nd port of the USB running off the USB PHY Vbus.

You'd need a buck DC converter going from 7.4V to 5V.

That is, unless you can get just the hub and the SD card working on less (3.3V?)

You'd still have the external connector working on the USB PHY 5V Vbus.
[Hardware Hacking General] eBandit078:
Agree 100% on have it working external first. But I (as I'm sure others are) am greatfull that the OP committed to it and started the internal modding and got this going. I will not do it until I have it working externally or know it has been done. Keep the suggestions coming............. glad this is staying alive and being talked about/worked on.

Sending you a PM by the way ;)
[Hardware Hacking General] iAppleDev:
I really want to find a easy solderless method(plug/clips) I have a few ideas but would need to find the female and male connectors for the front camera or maybe soundboard connectors,*or*

maybe disconnect the microUSB from the ribbon and run it up to the hub then back to the microUSB connector from the HUB that's one reason for the hub, so I can add the MicroSD, rear camera and on the last HUB port (HUB only has 3 ports active, it might be possible to find a different HUB that has 4 ports but this one only had 3) for ether more flash storage or the solderless mod to mother board.*
[Hardware Hacking General] littleguy77:
Hmm, the ribbon cable, hadn't thought of that till you mentioned it. Actually, an ideal aftermarket solution might then be to make a wholesale replacement for this board, integrating the necessary logic to implement the USB "Accessory Charger Adapter" specification. This would allow you pull +5v from the existing onboard usb transceiver while still permitting charging.

The problem then is that the micro-b receptacle on the nexus could only be used for charging. You'd have to break the data lines to the receptacle to meet ACA spec on the charging port, and to eliminate data collisions between external devices and the internal SD reader. (The SD reader which would hijack the D+ and D- lines). As a result, the nexus would always be in host mode, but chargeable at all times.

To get around this, you could then add a dpdt microswitch to the housing, and allow the D+ and D- lines to be manually switched between the internal reader and the external receptacle. Then you'd basically have two operating modes, toggled by the switch:

- Mode 1: Nexus host to an an internal usb card reader, with charger optionally attached externally. No data access through the external port.

- Mode 2: Stock configuration, permitting charging, PC connections, OTG adapters, etc. No data access to the internal card reader.

Essentially the switch would provide toggling between internal and external usb data device. Charging possible in any configuration.
[Hardware Hacking General] eBandit078:
This was suggested to me, does this sound like anything we could use for dropping the 7.4 volts to 5 volts?

A string of forward biased diodes in series.. Each diode drops the voltage by 0.6 volts. Ten diodes will drop 6.0 volts. The diodes have to be rated for the current they will have to carry. Test to see if you get the voltage you want, then put the string in heat shrink tubing.

They just gave an example of 10 diodes, we would use 4 of them to drop it by 2.4 volts.

Edit. I helpful person on another forum offered this info for me as far as getting the power down from the battery:

....cheap car USB adapters. Inside is a DC to DC inverter to change +12v to +5v for USB devices. Should work down to maybe 6 volts input. Has everything a USB port would want, I think including the handshaking to tell the USB device what it is and how much current it will supply. And it regulated +5v with almost no heat of power loss.

It has a printed circuit board about the size of a postage stamp and an Integrated Circuit to control the USB port.

(www) focalprice.com/IPB65B/Mini_Car_Charger_with_USB_Interface_for_Apple_iPhone_and_iPods_Black.html#.UFJ6ctZlT41

(http) mm0hai.net/blog/2012/08/01/Message-to-an-ebay-seller.html

(www) ti.com/lit/an/slva252b/slva252b.pdf <----- see what is inside one.
[Hardware Hacking General] littleguy77:
I've been doing a lot of digging into the USB OTG spec, and I think I have a clearer picture now why we might run into problems even if we find some alternative +5V line. I drew up some high-level schematics that show the four operating modes of the stock Nexus, and then shows what happens when you simply tie a peripheral into the usb traces while still permitting external connections through the usb receptacle.

Basically, if you tie the internal reader to the GND, D+, D-, and VBUS lines behind the receptacle, and short the ID pin to ground, you don't have any problems. You've just replicated the functionality of the OTG cable. The problem arises when you try to attach something to the external receptacle, while the internal reader is still soldered in:

1. When you plug a high-capacity charger (e.g. the stock charger) into the receptacle, the charger shorts the data lines together. The internal card can no longer be read. Moreover, asserting VBUS from an external source while shorting ID to ground is against USB spec. I'm concerned that the Nexus's onboard USB transciever will go into a safe state that drops all data communication even after the charger is removed. That might explain why some folks needed to reboot their nexus after trying to charge and read at the same time.

2. When you plug a PC (or any A-device) into the receptacle, the data lines get shared by both the PC and the internal reader. The Nexus tries to be host (A-device) which conflicts with the PC's host status. Not sure if the PC or the nexus can read the card. Not sure if the PC can read the nexus drive. Not sure if the nexus will charge.

3. When you plug an OTG cable into the receptacle, the nexus acts as host (fine). But the data lines are now shared by both the internal and external peripherals. Not sure if the nexus can read the internal or the external peripherals.
[Hardware Hacking General] iAppleDev:
So if we cut the data+/- traces/connectors of the micro USB in the middle from the ribbon, then from the ribbon side, run it up to the hub connected to the input of the HUB, then from the free port(1) on HUB, run data+/- back to the micro USB connector and hook it back up to the other side of the micro-USB where we cut the data+/- traces/connectors and just leave the ground ID-pin and 5v stock (HUB will never have conflicting data lines). Then we can still add the micro SD to port(2) and a rear camera or more flash storage on port(3).

If we get a permanent 5v source that doesn't require the micro-USB to be altered.

Does any one know any thing about con 6 for the microphone top left

Or the front camera we could grab the data+/- and maybe 5v+/-

We could have the solderless mod, someone with good soldering skills would just have to buy a bunch of Nexus7 replacement ribbon/audio/Micro-USB connectors, HUB's and tiny MicroSD card readers, cut and solder cable,HUB and card reader.
[Hardware Hacking General] littleguy77:
Hmmm. I think this is getting closer. I think a solution, if it can be found, will definitely require breaking some of the traces. Breaking the data lines and interjecting the hub will remove the problem with data collisions. So this should fix the problem shown in the bottom blue block of my previous attachment. However, the other two configurations (charger or PC attached) still cause problems.

A hub connects to a host on one side, and two (or more) peripherals on the other side. Inside the hub is an IC that directs traffic, ensuring that only one peripheral is using the data lines at a given time. However, when you connect a PC, it will be connected on the peripheral side of the hub, which would cause unknown behavior. And since the mod is still pulling ID to ground, the nexus will continue to act as host. So we still have the problem of the nexus acting as host when it should be in peripheral mode, and again the PC cannot communicate with the Nexus. It's uncertain whether the Nexus will charge either. So the hub doesn't really solve the problem in the third blue block.

Also, if you connect the charger, the nexus may still not charge since the ID pin is pulled to ground. That tells the nexus to drive the VBUS line, and again we have the power collision where both charger and nexus are trying to drive VBUS at the same time.

Let me work on another figure, pulling from the spec.
[Hardware Hacking General] littleguy77:
So I think we're on the right track, but I keep returning to the thought that we need to implement the official "Accessory Charger Adapter" spec provided by USB. I've attached some tables and schematics, adding my own annotations to help the discussion.

With this idea, we disconnect all the pins on the usb receptacle and insert some logic chip that implements ACA. This logic chip would negotiate between the nexus, the internal card reader (or hub), and the micro-b receptacle. This logic would sense the voltage on the receptacle's VBUS, and detect shorts on the receptacle's data pins. It would then implement the following algorithm:

ChargerSwitchState = open;

if (VBUS_CHG == floating) // nothing connected externally
ID_OTG = shorted to ground;

else if (VBUS_CHG == +5V) // something connected externally

if (DP_CHG shorted to DN_CHG) // hi-speed charger connected
ID_OTG = shorted to ground through 124k-ohm resistor;
ChargerSwitchState = closed; // permit charging

else // pc or low-speed charger connected
ID_OTG = shorted to ground;

else // exceptional out-of-spec condition
go into safe mode;

Of course none of this is easy for the average DIYer, unless we can find an off-the-shelf IC that does this for us. Also note that a pc can no longer communicate with the nexus with this architecture, and that only the high-speed charger will charge the device.
[Hardware Hacking General] iAppleDev:
I Still think if we get a permanent 5v source that doesn't require the micro-USB to be altered that it will solve most issues.
[Hardware Hacking General] littleguy77:
Please, I hope you are able to try it without damaging anything. My point is that we have tunnel vision on external 5V solving the problem... research into the USB spec shows a much more complex system. You don't need a separate 5V line to power the micro card reader. Just pull the ID line to low and the Nexus USB transceiver will make the +5v for you. The problem is much more than giving the card reader 5 V though. Even if you pull 5V from a separate source, the nexus will always be in host mode since ID pin is pulled low. That's a problem if you ever want to connect the nexus to the PC.

The other problem, which isn't even addressed here, is what happens when you attach the stock charger. The data pins get shorted and communication with the internal reader/hub stops. By itself, maybe that's ok. BUT USB charging spec disallows charging when ID is low. So unless the nexus is not up to spec (doubtful), it will probably not charge.

The easiest (partial) solution to all this is to add a micro switch to switch out the data and ID lines between the internal and external device, which is sort of where this thread is going:

http://xdaforums.com/showthread.php?p=31509037
[Hardware Hacking General] iAppleDev:
That's why I don't want to tap into Mico-USB 5v +/- or ID pins(leave stock) just tap the data+/- lines to HUB input then re-rout them back from port1 on the HUB so the Micro-USB can still be used as stock.
[Hardware Hacking General] littleguy77:
But you still need a way to set ID low, otherwise the nexus won't go into host mode and thus will not read from the hub or reader.
[Hardware Hacking General] iAppleDev:
What do you mean by set ID low?grounded?, switched? stock? or what? And you are talking about the ID pin right?
[Hardware Hacking General] iAppleDev:
Maybe get the data+/-'s from front camera
[Hardware Hacking General] littleguy77:
Sorry, I mean short the ID pin directly to ground.
[Hardware Hacking General] littleguy77:
I just tested this configuration with a homemade splice. I connected to the external receptacle, so this is equivalent to a solution that does NOT break any of the internal traces on the Nexus, and just provides an alternative +5V source to the card reader or hub.

The result: card reader/thumb drive continued to work without any issues. The tablet however did not charge. Verified using Battery Monitor Widget app.
[Hardware Hacking General] iAppleDev:
What if you splice in before your OTG?

ID pin will lock it out of charging when ever the OTG cable/IDpin ID grounded
[Hardware Hacking General] littleguy77:
Makes no difference where the physical splice occurs, it's all one continuous piece of conductor at the same potential.
[Hardware Hacking General] eBandit078:
I have done lots of soldering but mostly larger stuff. I will start to hone my skills and make sure I can still do small stuff and very well since its been awhile since I have done tiny work. Where can I get those parts at though? If they don't cost too much I will get a few of each just in case.

Keep up the good work and ideas ;) :good:
[Hardware Hacking General] littleguy77:
Digi-key has just about everything. Jameco is also good if digi-key is out of stock.
[Hardware Hacking General] eBandit078:
I'm looking but dont know the part numbers to narrow it down.
[Hardware Hacking General] iAppleDev:
These were just things I had laying around, we could find other parts that fit but it is very tight for extra space inside the Nexus 7.

This is the HUB, it comes in size capacity's from 1GB-64GB, the flash storage is stacked on top of the HUB and has to be removed to fit in the the spot I have it in the N7. You would probably just want to get the-1GB RIDATA USB Flash Drive +Hub-Yego because they are slow compared to higher end flash storage:

http://www.ritek.com/p2-pro4-ez-uniform.asp

The card reader I had was an Duracell MicroSD:

I had other miniones but they were all different and this was the only one that fit were I have mine placed.

http://www.duracellflash.com/microsd.html
[Hardware Hacking General] Pezo:
I don't have a Nexus 7 yet, so I can't check for myself.

I think it's worth looking at the (absent) connector above the space for the (absent) camera marked in the attached photo.

If that's where the connector for the camera would be it's possible that we can use that instead of hacking the USB OTG (if it is indeed connected to something useful).
[Hardware Hacking General] Renate:
littleguy77's post is right, you can just splice in power.

The question is whether you can charge the tablet like this.

The spec (might) say no, hacking says yes.

Things like shorting the data lines and grounding the ID are only signals.

The CPU driven by code figures out what to do with the charging circuit.

Sometimes you can use the sysfs to tell the driver to charge.

You could certainly hack the driver to make it do anything.

This has all been covered in other posts.

Forgetting the charging aspect for a bit, some have asked why not use the regular OTG power for the hub, the SD card and external.

The answer is, because there may not be a lot.

I haven't heard any actual numbers for current quoted here.

How much current is the USB PHY chipset speced to deliver in OTG mode?

How much current can it reliably deliver and at what voltage?

How much current does the little hub take?

How much current does the SD card adapter + card take?

How much current do you need for an external USB peripheral?
[Hardware Hacking General] eBandit078:
Curious, anyone confirm the specs of the side dock pins? Just curious if that also can be used to charge the device. I put a DMM on it and the see it is left and right speakers. The two outside pins seem to be the speaker neg. though, so I wasn't sure how it was set to charge as well.

Hmm. I need to ask around on all that.

For the micro SD reader I was thinking I would solder in one of these little usb to micro sd card adapters that I have an extra of.