[Nexus 7] Adding internal USB for other devices (HUB,microSD,FM,flash-storage,etc...)

Search This thread

eBandit078

Member
Sep 5, 2012
40
2
So this device runs on 7.4V dual Li-ion batteries?
Is there a separate charger input or only over the USB?

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.
 

Renate

Recognized Contributor / Inactive Recognized Dev
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.
 
  • Like
Reactions: eBandit078

AdamOutler

Retired Senior Recognized Developer
Feb 18, 2011
5,224
9,827
Miami, Fl̨̞̲̟̦̀̈̃͛҃҅͟orida
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 .
 

ED2O9

Senior Member
Sep 2, 2009
295
129
So this device runs on 7.4V dual Li-ion batteries?
Is there a separate charger input or only over the USB?

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.
 

eBandit078

Member
Sep 5, 2012
40
2
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.

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.

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 .

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???

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.

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.
 
Last edited:

Renate

Recognized Contributor / Inactive Recognized Dev
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.
 
  • Like
Reactions: eBandit078

eBandit078

Member
Sep 5, 2012
40
2
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.

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 ;)
 

iAppleDev

Senior Member
Jan 8, 2012
202
101
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.*
 
Last edited:

littleguy77

Senior Member
Aug 14, 2012
50
28
Virginia
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.

KjNsrjlvHZdFWEGF.medium


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.
 

eBandit078

Member
Sep 5, 2012
40
2
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.
 
Last edited:

littleguy77

Senior Member
Aug 14, 2012
50
28
Virginia
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.
 

Attachments

  • stock.jpg
    stock.jpg
    57 KB · Views: 815
  • modded.jpg
    modded.jpg
    45.5 KB · Views: 680

iAppleDev

Senior Member
Jan 8, 2012
202
101
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
THsKayfnQTsWBMOG.large


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


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.
 
Last edited:
  • Like
Reactions: eBandit078

littleguy77

Senior Member
Aug 14, 2012
50
28
Virginia
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.
 
  • Like
Reactions: eBandit078

littleguy77

Senior Member
Aug 14, 2012
50
28
Virginia
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:

Code:
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.
 

Attachments

  • SpecTable63.jpg
    SpecTable63.jpg
    44.4 KB · Views: 620
  • schematicModded.jpg
    schematicModded.jpg
    33 KB · Views: 690
  • schematicStock.jpg
    schematicStock.jpg
    21.5 KB · Views: 648
Last edited:

iAppleDev

Senior Member
Jan 8, 2012
202
101
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
THsKayfnQTsWBMOG.large


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


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.
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.

Sent from my Nexus 7 using xda app-developers app
 

littleguy77

Senior Member
Aug 14, 2012
50
28
Virginia
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
 

iAppleDev

Senior Member
Jan 8, 2012
202
101
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


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.
 

littleguy77

Senior Member
Aug 14, 2012
50
28
Virginia
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.
 

iAppleDev

Senior Member
Jan 8, 2012
202
101
Maybe get the data+/-'s from front camera
 

Attachments

  • uploadfromtaptalk1347646359594.jpg
    uploadfromtaptalk1347646359594.jpg
    10.1 KB · Views: 428

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    The project-Adding internal USB for other devices (HUB,micro SD,FM,flash-storage,etc...).

    We should have a few deferent options to connect USB internally. This thread should cover them all.

    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 micro USB from the ribbon and run it up to the hub then back to the micro USB connector from the HUB that's one reason for the hub, so we can add a micro SD, a rear camera and the last 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 some more flash storage or to hook up the solderless mod to mother board.

    We can use the micro USB connection at bottom of the mother board a couple different ways. We could use both the data and power from the connector. We could also just use the data +/- from the micro USB connector and use the power from a different power source like the 7.4V from the battery and drop it down to 5V but none of the wires are 7.4v there is two running at 3.7v, if we could find the 7.4v on the board or a connector somewhere this could be done
    4
    Camping for a few days with the family, then back at it.
    4
    So I soldered in a switch to id pin and ground pin of micro usb all was good, charged when powered on and switch off, charged when power was off switch on or off. Now I soldered microsd card reader power and data lines to the microUSB connector them ran the ground for card reader up to switch, it works fine for mounting sdcard, but it won't charge when N7 is booted up. It does charge still when not booted up. Maybe I should have ran the ground for the card reader to microUSB port too. But at least it works and is all internal.
    3
    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.