Specialized USB cables

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(all custom USB cable hacks)
 
Line 1: Line 1:
 +
{{note|work in progress}}
 +
 
=== Modified USB cable to inject power while in host mode ===
 
=== Modified USB cable to inject power while in host mode ===
  

Revision as of 08:24, 29 August 2008

NOTE: work in progress


Contents

Modified USB cable to inject power while in host mode

Three-headed cables are required if you want to power the FreeRunner / USB device whilst in host mode. For many uses the FreeRunner provides sufficient power to make such a cable unnecessary. At the moment, you'll have to manufacture this one yourself. You need to make a cable with three ends:

  • A mini-USB type B cable for the Neo itself
  • A cable of whatever type to go to your USB device.
  • A cable going to a +5V +/-10%(max!) power supply with enough power for your device and to charge the Neo. This could be a wall charger or even another USB plug.

You connect the Data+ and Data- wires of the Neo and the device, and connect all of the ground wires together and all of the +5V wires together. This powers the Neo and the device, while letting the neo talk to the device. You have to connect 2pcs 15kOhm resistors, one from D+ to ground, and one from D- to ground, to comply with USB-spec for hostmode, as Neo is switching off the internal resistors when you enable charging/powering over USB by asserting EN_USBHOST. See schematics, LOCATION:49XX

Just for reference, the USB wires from left to right are:

  • Black: Power -
  • Green: Data -
  • White: Data +
  • Red: Power +

The Mini_USB-B connector has a fifth pin, the ID-pin. This pin is supposed to be short to ground to signal Freerunner to enter hostmode. For the Y-cable and enabling external power while in hostmode, you may connect a 47kOhm resistor from ID-pin to ground. This is the same trick the OM-wallcharger uses to signal to Freerunner it can charge with 1A. Future kernels should switch to hostmode + external power when seeing this 47k resistor.

DIY USB host adapter

Note that these instructions are provided in the hope that they are useful but without any warranty!

2-usb-receptables.jpg

  1. Find an old motherboard with a set of two USB receptacles as shown above.
  2. Desolder this set of receptacles from the motherboard. This can be bit tricky but it is doable at least with a desoldering gun.
  3. Each receptacle has four pins. Use a multimeter to verify that you have no short circuits between the pins or the shield.
  4. Solder adjacent pins together (GND to GND, D- to D-, D+ to D+, VCC to VCC).
  5. (Optional) Build a test cable. Cut an USB cable with A plug into half, connect it a receptacle and again measure that you have no short circuits. Then connect the test cable to PC and verify that you see
black GND
green 0V
white 0V
red +5V
  1. Freerunner is shipped with a mini-B-to-A-plug cable. Connect this to a receptacle.
  2. (Optional)Connect test cable to the other receptacle and verify that you see
black GND
green 0V
white 0V
red 0V

when freerunner acts as a device and

black GND
green 0V
white 0V
red +5V

when it acts as a host.

  1. At your own risk, switch freerunner to USB host mode and connect an USB device to the other receptacle of the adapter. Here's how the setup should look like:

Usb-gender-changer1.jpg Usb-gender-changer2.jpg

Compatibility

The adapter works with kingston data traveller 4G memory stick and aiptec pencam webcam. However, for some reason (probably the missing 15k resistors at D+ and D-) it did not work with any of the tested USB keyboards or mice:

usb 1-2: new full speed USB device using s3c2410-ohci and address 24
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new full speed USB device using s3c2410-ohci and address 25
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new full speed USB device using s3c2410-ohci and address 26
usb 1-2: device not accepting address 26, error -62
usb 1-2: new full speed USB device using s3c2410-ohci and address 27
usb 1-2: device not accepting address 27, error -62

However, if I connect neo to small (unpowered) USB hub

usb 1-2: new full speed USB device using s3c2410-ohci and address 61
usb 1-2: configuration #1 chosen from 1 choice
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected

and connect the keyboard to the hub then it is correctly recognized:

usb 1-2.3: new low speed USB device using s3c2410-ohci and address 62
usb 1-2.3: configuration #1 chosen from 1 choice
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.0/input/input13
input: USB HID v1.10 Keyboard [  USB Keyboard] on usb-s3c24xx-2.3
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.1/input/input14
input: USB HID v1.10 Device [  USB Keyboard] on usb-s3c24xx-2.3

With the hub I can also use both keyboard and usb memory stick at the same time.

Power consumption

When I unplug the USB hub (with only keyboard connected to it) the power consumption estimate at /sys/devices/platform/bq2700-battery.0/power_supply/bat/current_now decreases from 175000 to 145000 (are these microamperes?).

Personal tools

Modified USB cable to inject power while in host mode

Three-headed cables are required if you want to power the FreeRunner / USB device whilst in host mode. For many uses the FreeRunner provides sufficient power to make such a cable unnecessary. At the moment, you'll have to manufacture this one yourself. You need to make a cable with three ends:

  • A mini-USB type B cable for the Neo itself
  • A cable of whatever type to go to your USB device.
  • A cable going to a +5V +/-10%(max!) power supply with enough power for your device and to charge the Neo. This could be a wall charger or even another USB plug.

You connect the Data+ and Data- wires of the Neo and the device, and connect all of the ground wires together and all of the +5V wires together. This powers the Neo and the device, while letting the neo talk to the device. You have to connect 2pcs 15kOhm resistors, one from D+ to ground, and one from D- to ground, to comply with USB-spec for hostmode, as Neo is switching off the internal resistors when you enable charging/powering over USB by asserting EN_USBHOST. See schematics, LOCATION:49XX

Just for reference, the USB wires from left to right are:

  • Black: Power -
  • Green: Data -
  • White: Data +
  • Red: Power +

The Mini_USB-B connector has a fifth pin, the ID-pin. This pin is supposed to be short to ground to signal Freerunner to enter hostmode. For the Y-cable and enabling external power while in hostmode, you may connect a 47kOhm resistor from ID-pin to ground. This is the same trick the OM-wallcharger uses to signal to Freerunner it can charge with 1A. Future kernels should switch to hostmode + external power when seeing this 47k resistor.

DIY USB host adapter

Note that these instructions are provided in the hope that they are useful but without any warranty!

2-usb-receptables.jpg

  1. Find an old motherboard with a set of two USB receptacles as shown above.
  2. Desolder this set of receptacles from the motherboard. This can be bit tricky but it is doable at least with a desoldering gun.
  3. Each receptacle has four pins. Use a multimeter to verify that you have no short circuits between the pins or the shield.
  4. Solder adjacent pins together (GND to GND, D- to D-, D+ to D+, VCC to VCC).
  5. (Optional) Build a test cable. Cut an USB cable with A plug into half, connect it a receptacle and again measure that you have no short circuits. Then connect the test cable to PC and verify that you see
black GND
green 0V
white 0V
red +5V
  1. Freerunner is shipped with a mini-B-to-A-plug cable. Connect this to a receptacle.
  2. (Optional)Connect test cable to the other receptacle and verify that you see
black GND
green 0V
white 0V
red 0V

when freerunner acts as a device and

black GND
green 0V
white 0V
red +5V

when it acts as a host.

  1. At your own risk, switch freerunner to USB host mode and connect an USB device to the other receptacle of the adapter. Here's how the setup should look like:

Usb-gender-changer1.jpg Usb-gender-changer2.jpg

Compatibility

The adapter works with kingston data traveller 4G memory stick and aiptec pencam webcam. However, for some reason (probably the missing 15k resistors at D+ and D-) it did not work with any of the tested USB keyboards or mice:

usb 1-2: new full speed USB device using s3c2410-ohci and address 24
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new full speed USB device using s3c2410-ohci and address 25
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new full speed USB device using s3c2410-ohci and address 26
usb 1-2: device not accepting address 26, error -62
usb 1-2: new full speed USB device using s3c2410-ohci and address 27
usb 1-2: device not accepting address 27, error -62

However, if I connect neo to small (unpowered) USB hub

usb 1-2: new full speed USB device using s3c2410-ohci and address 61
usb 1-2: configuration #1 chosen from 1 choice
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected

and connect the keyboard to the hub then it is correctly recognized:

usb 1-2.3: new low speed USB device using s3c2410-ohci and address 62
usb 1-2.3: configuration #1 chosen from 1 choice
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.0/input/input13
input: USB HID v1.10 Keyboard [  USB Keyboard] on usb-s3c24xx-2.3
input:   USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-2/1-2.3/1-2.3:1.1/input/input14
input: USB HID v1.10 Device [  USB Keyboard] on usb-s3c24xx-2.3

With the hub I can also use both keyboard and usb memory stick at the same time.

Power consumption

When I unplug the USB hub (with only keyboard connected to it) the power consumption estimate at /sys/devices/platform/bq2700-battery.0/power_supply/bat/current_now decreases from 175000 to 145000 (are these microamperes?).