Author Topic: Need help with USB OTG issue  (Read 2469 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris CTopic starter

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Need help with USB OTG issue
« on: February 21, 2016, 05:20:08 am »
I'm making at least 4x of a project, consisting of a tablet computer (HP Stream 7) connected to a USB device (Labjack U3-LV).  These will be permanently connected together in a sealed enclosure.  I intend for the enclosure to have a single USB jack on the outside, to be used for external power only (never data).

When external power is present, it should power both tablet and USB device, and preferably charge the tablet.  This requires the USB Sense pin to be connected to ground through a 124K resistor.

With no external power, the tablet should power the USB device from its internal battery.  This requires the USB Sense pin to be grounded.

The tablet should act as a host, and be able to communicate with the Labjack, in both modes.  I have tested these modes successfully, by splicing three USB cables together, then manually changing the resistance between Sense and GND.

But I need this to be automatic, and I'm not sure how to accomplish that.  (EDIT: I'd prefer a solution implementable with discrete components if possible, but a specialized IC is acceptable.)

My first thought was to connect the external V+ pin to the tablet/Labjack through a Schottky diode.  This would allow me to easily detect the presence of the external supply, and if I can just manage that, I can figure out the rest.  However, the 2A OEM external supply drops to 4.8V when powering the tablet and Labjack.  Adding in the Schottky's drop, it leaves the voltage too close to USB 2.0's minimum specified 4.4V.

Any ideas?

I could use a different supply that maintains at least 5.0V, or modify the external USB cable/supply to send a signal on one of the unused data pins to allow detection.  But then my design wouldn't work if the user swapped what appears to be a standard part for a different one, so that's not acceptable.

Or I could use a barrel jack, and 5V PS with barrel plug, for external power.  But then the user might plug in a higher voltage supply by mistake.  So add a internal switching regulator, set for 5.3V (to allow for the Schottky drop).  And another PS, instead of using the ones provided with the tablet.  There's got to be a more elegant solution!

(Also, I found that the tablet will not charge its battery when the charger is connected, and the tablet is on.  It will not drain the battery when on, but it only charges the battery when the tablet is off.  This occurs even with the unmodified OEM charger/cable.  With my modified cables and 124K resistor, the tablet additionally doesn't display that external power is present, though it otherwise functions identically.  I could not resolve it through the suggestions I found via Google, of changing the screen brightness or reloading the "Microsoft ACPI Compliant Control Method Battery" driver.  It would be nice, but not necessary, to fix this as well; though since the issue exists even with OEM charger/cable, I'm not sure it can be fixed.)
« Last Edit: February 21, 2016, 05:24:57 am by Chris C »
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Re: Need help with USB OTG issue
« Reply #1 on: February 21, 2016, 05:29:29 am »
With no external power, the tablet should power the USB device from its internal battery.  This requires the USB Sense pin to be grounded.

The tablet should act as a host, and be able to communicate with the Labjack, in both modes.  I have tested these modes successfully, by splicing three USB cables together, then manually changing the resistance between Sense and GND.

Surprising that grounding the sense pin doesn't disconnect the USB device.
 

Offline Chris CTopic starter

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: Need help with USB OTG issue
« Reply #2 on: February 21, 2016, 05:54:25 am »
Surprising that grounding the sense pin doesn't disconnect the USB device.

The cable I started with has the sense pin floating, not connected to any other pin - or even a wire passing through the cable - at the end where it plugs into the tablet.  It was apparently a charge-only cable, and would not allow the tablet to go into host mode, or communicate with any device.  As a USB OTG newbie, I scratched my head for hours over this!  Multiple references found on Google said Sense is typically grounded to enable host mode.  So I whittled away the rubber boot to access the pin's solder pad, and upon grounding it, I was able to access USB devices as expected.  Perhaps you've got the meaning of grounded vs. floating swapped?  Or if I've missed something, please educate me.
 

Offline Chris CTopic starter

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: Need help with USB OTG issue
« Reply #3 on: February 23, 2016, 12:04:24 am »
[Kilrah], thinking about this some more, I might have misunderstood you.  When switching from 124K to 0K (or vica versa) between Sense/GND, the USB device does temporarily become disconnected.  Which isn't ideal, but is acceptable for now.  Was that what you were referring to?

I'm under some time constraints, so I went ahead and redesigned the best way I knew.  Using supplemental external switching PS, 12V @ 2A with 2.1mm barrel plug.  The mating 2.1mm barrel jack has a sense pin, which is grounded when the plug isn't inserted; wired between USB Sense and GND in parallel with a 124K resistor, this provides the needed logic.  And added an internal switching DC-DC converter, 12V -> 5.3V 3A, with reverse protection Schottkys on input and output.

Still, if anyone has other suggestions on this or the two other minor issues (tablet won't charge when on, device temp disconnect during switchover), I'd like to hear them.
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Re: Need help with USB OTG issue
« Reply #4 on: February 25, 2016, 12:10:35 pm »
What I meant is that in my experience OTG host mode and charging were always mutually exclusive. When in normal (device) mode the device accepts charging, but in host mode it has to switch its power circuits in the other direction to power the device connected to it, and thus logically can't accept being charged anymore.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf