Did I solder on my USB host cable correctly?

Status
Not open for further replies.
Hi all,

I had a female usb cable laying around. I cut off the male end, stripped the wires and soldered it to my Teensy 4 with the goal of hooking up a midi device.

Black to ground
Red to VUSB
Yellow to D-
Green to D+

midi host.jpg

I loaded several USBHost_T36 examples, most notably 'test'.
I hooked up a usb keyboard (apple magic kb) and two midi devices (OP-1 and Roli Seaboard block) but I am not seeing any keypresses/notes in the serial monitor.

Did I make a mistake somewhere?

Thanks!
 
Looks Like :: The black GND wire looks to be soldered to a bottom side TEST point not a usable pad? For GND the "G" there is a label for the GND PIN. Remove the wire and clean those two test point/pads and put a good connect to GND to the black wire.
 
Should also be noted that this hook up does not have the USB voltage control chip that is built into the T3.6 and hopefully soon T4.1, so the setup may work fine for statically plugged in things, but may not work as well as these other boards for dynamically plugging in devices.
 
KurtE adds a good point where I stopped after interpreting the photo.

Best to use a powered HUB ( and software hub objects as needed ) to safely bring any devices up to power and maintain them if they take much power or come and go.
 
Once the GND wire is fixed, I believe this should work. Of course hot-plugging will likely brown-out reboot Teensy 4.0, even when the GND is correct.
 
Once the GND wire is fixed, I believe this should work. Of course hot-plugging will likely brown-out reboot Teensy 4.0, even when the GND is correct.

Thanks all! I connected the ground to the real ground and now it seems to 'work' as predicted here :)

I don't really want to use a full powered usb hub here since I'd like to keep it small. How would I go about adding protection for this myself?
 
Cool - the picture didn't lie to me! Glad that was the fix.

First board that comes to mind is an OSH board by blackketter/teensy4_usb_host_breakout

That or others may be findable on the forum. @loglow has a breakout board as TallDog on TINDIE that would work.

But those or others would likely require a fresh T_4.0 to get those USB pins soldered.

The hub was just to make sure it worked for initial testing.

If you can wait for the pending T_4.1 to ship - it will come USBHost prepared for easier use - It is an inch longer but more features and functions for future fun onboard.
 
Hmmmm a Teensy 4.1, that sounds great haha.
If I hook up a powered usb hub to my 4.0, can I use the cable I just soldered to it safely?
That way I can continue developing and just move over to 4.1 later.
 
Hmmmm a Teensy 4.1, that sounds great haha.
If I hook up a powered usb hub to my 4.0, can I use the cable I just soldered to it safely?
That way I can continue developing and just move over to 4.1 later.

That should work well - with the needed software for the hub interconnect ( software shown in examples - at least it worked here from the T_3.6 USB Host thread examples for HDD and USB ethernet dongle usage ).

Noted above software - but a T_4.0 without the onboard protection - should be safe connected to a powered hub that will isolate it from any power or ESD issues.

It worked as noted on HDD's and SSD's that needed extra power as well as the Ethernet dongle that worked on T_4 alone with care until I overclocked it and it needed more power in combination.

If the T_4.1 sounds like an option then stay tuned - the Beta unit I got was awesome - form factor of the T_3.6 - but the power of the T_4 with added features like USB Host protection/support easily wired with an adapter like PJRC sells - and a place for added FLASH or RAM - and a $3 MagJack and a capacitor can cable to the T_4.1 for wire ethernet - and a larger 8MB program flash too.
 
Off to the store I go for a cheap usb hub then ;)

If the T_4.1 sounds like an option then stay tuned - the Beta unit I got was awesome - form factor of the T_3.6 - but the power of the T_4 with added features like USB Host protection/support easily wired with an adapter like PJRC sells - and a place for added FLASH or RAM - and a $3 MagJack and a capacitor can cable to the T_4.1 for wire ethernet - and a larger 8MB program flash too.

Sounds great! Can't wait!
 
Lower cost,but powered hub

With power it will assure anything on a normal port would work to have enough power
 
Alright, I bought a small powered hub.
I hooked up my OP-1 and the usbhost_t36 example 'test' sketch. No luck on midi notes.
Then I hooked up my Apple Magic keyboard and typed. I only see one keypress, then it 'crashes', or at least I don't see any more traces.

Is the test sketch complete and working? I see a myusb.begin() and a midi1.read() but nothing like that for the keyboard.
Also, there are 3 hubs created in the sketch but they are not referenced anywhere else.
I tried adding more hubs since I have a 7 port usb hub but no luck.

I'm thinking of desoldering the red wire so I can be sure no power goes from my hub to the teensy. Does that make sense?

Thanks again!
 
Update: I desoldered the red wire and it still works in exactly the same way. Keypress works only once.
New info: key release doesn't work at all (also if I remove the keypress listener)

Also, I found out I wasn't compiling for MidiSerial so I turned that on but no luck, midi still doesn't work.
 
@LobotomyKid
have you tried to resolder the two data lines? It looks like the solder joints are less than acceptable.

Also, the cable must not be too long. I've soldered a cable directly to the Teensy 4.0 and it works perfectly, since I've shortened the cable to about 30cm.
With longer cable I had dropouts/crashes, similar to what you descrive. I even use a hub, so hot plugging does no longer crash the Teensy 4.0, but the hub is powered from VIN and GND directly, because I hook up only some less power-hungry devices and it works perfectly.
 
There is a #define DEBUG switch in the one USBHost header that will turn on SPEW to see other messages that may be missed to see if other things are passing through perhaps and what might be missing.

Ah, nice!


Also - the wait is over ::

Even nicer! :D


I soldered a new cable to the teensy and now it works a bit better. My OP-1 doesn't get recognised when I hook it up, but my Seaboard block now does! And it's sending midi messages to the teensy.

Strangely enough the keyboard still only works for one keypress but my goal was to get midi working so I decided to move on :)

Thanks for the help!
 
@LobotomyKid
have you tried to resolder the two data lines? It looks like the solder joints are less than acceptable.

Also, the cable must not be too long. I've soldered a cable directly to the Teensy 4.0 and it works perfectly, since I've shortened the cable to about 30cm.

I now resoldered with a new cable and my midi devices appear to be working! Keyboard still acts strange but I've got some progress :)
 
Hmmm, cheerd a bit too soon.

I turned on debug mode and my keyboard says:

"ERROR Followup"

And my unrecognised midi devices do connect but show a lot of questionmarks and 'ignored' messages.

Code:
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
01 01 01 00 
New Port Status
  status=10101  port=1
  state=1
  Device is present: 
  Has Power
USBHub control callback
Port Status Cleared, port=1
timer event (20000 us): Debounce Timer, this = 20003F40, timer = 20004258
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=2
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 20003F40, timer = 20004258
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=3
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 20003F40, timer = 20004258
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=4
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 20003F40, timer = 20004258
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=5
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 20003F40, timer = 20004258
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
sending reset
send_setreset
USBHub control callback
unhandled setup, message = 40323
timer event (19999 us): Debounce Timer, this = 20003F40, timer = 20004258
ports in use bitmask = 0
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
03 05 10 00 
New Port Status
  status=100503  port=1
  state=7
  Device is present: 
  Enabled, speed = 480 Mbit/sec
  Has Power
USBHub control callback
unhandled setup, message = 140123
timer event (25000 us): Hello, I'm resettimer, this = 20003F40, timer = 20004274
port_doing_reset = 1
PORT_RECOVERY
new_Device: 480 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 00 00 00 40 82 29 67 19 00 01 01 02 00 01 
    VendorID = 2982, ProductID = 1967, Version = 0100
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: Ableton AG
enumeration:
Product: Ableton Push 2
enumeration:
Config data length = 126
enumeration:
Configuration Descriptor:
  09 02 7E 00 03 01 00 80 FA 
    NumInterfaces = 3
    ConfigurationValue = 1
  09 04 00 00 02 FF FF FF 03 
    Interface = 0
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 255 / 255
  07 05 01 02 00 02 00 
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
  07 05 81 02 00 02 00 
    Endpoint = 1 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
  09 04 01 00 00 01 01 00 00 
    Interface = 1
    Number of endpoints = 0
    Class/Subclass/Protocol = 1 / 1 / 0
  09 24 01 00 01 09 00 01 02 
  09 04 02 00 02 01 03 00 00 
    Interface = 2
    Number of endpoints = 2
    Class/Subclass/Protocol = 1 / 3 / 0
  07 24 01 00 01 25 00 
  06 24 02 01 01 04 
  06 24 02 01 02 05 
  09 24 03 01 03 01 01 01 04 
  09 24 03 01 04 01 02 01 05 
  09 05 02 02 00 02 00 00 00 
    Endpoint = 2 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
  06 25 01 02 01 02 
  09 05 82 02 00 02 00 00 00 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
  06 25 01 02 03 04 
enumeration:
HIDParser claim this=20003920
KeyboardController claim this=20002BE0
USBHub memory usage = 960
USBHub claim_device this=200046C0
USBHub memory usage = 960
USBHub claim_device this=20003560
HIDParser claim this=20005180
Descriptor 4 = INTERFACE
HIDParser claim this=20003920
KeyboardController claim this=20002BE0
09 04 00 00 02 FF FF FF 03 07 05 01 02 00 02 00 07 05 81 02 00 02 00 09 04 01 00 00 01 01 00 00 09 24 01 00 01 09 00 01 02 09 04 02 00 02 01 03 00 00 07 24 01 00 01 25 00 06 24 02 01 01 04 06 24 02 01 02 05 09 24 03 01 03 01 01 01 04 09 24 03 01 04 01 02 01 05 09 05 02 02 00 02 00 00 00 06 25 01 02 01 02 09 05 82 02 00 02 00 00 00 06 25 01 02 03 04 
MIDIDevice claim this=20002500
len = 117
  Interface is unknown (might be Yahama)
type: 5, len: 7
    MIDI Endpoint: 1
      tx_size = 512
type: 5, len: 7
    MIDI Endpoint: 81
      rx_size = 512
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=20004AA0
len = 117
  Interface is unknown (might be Yahama)
type: 5, len: 7
    MIDI Endpoint: 1
      tx_size = 512
type: 5, len: 7
    MIDI Endpoint: 81
      rx_size = 512
type: 4, len: 9
This interface is not MIDI
MIDIDevice claim this=20002E80
len = 117
  Interface is unknown (might be Yahama)
type: 5, len: 7
    MIDI Endpoint: 1
      tx_size = 512
type: 5, len: 7
    MIDI Endpoint: 81
      rx_size = 512
type: 4, len: 9
This interface is not MIDI
HIDParser claim this=20005180
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
HIDParser claim this=20003920
KeyboardController claim this=20002BE0
09 04 01 00 00 01 01 00 00 09 24 01 00 01 09 00 01 02 09 04 02 00 02 01 03 00 00 07 24 01 00 01 25 00 06 24 02 01 01 04 06 24 02 01 02 05 09 24 03 01 03 01 01 01 04 09 24 03 01 04 01 02 01 05 09 05 02 02 00 02 00 00 00 06 25 01 02 01 02 09 05 82 02 00 02 00 00 00 06 25 01 02 03 04 
MIDIDevice claim this=20002500
len = 94
  Interface is unknown (might be Yahama)
type: 36, len: 9
    MIDI Header (ignored)
type: 4, len: 9
MIDIDevice claim this=20004AA0
len = 94
  Interface is unknown (might be Yahama)
type: 36, len: 9
    MIDI Header (ignored)
type: 4, len: 9
MIDIDevice claim this=20002E80
len = 94
  Interface is unknown (might be Yahama)
type: 36, len: 9
    MIDI Header (ignored)
type: 4, len: 9
HIDParser claim this=20005180
Descriptor 36 =  ???
Descriptor 4 = INTERFACE
HIDParser claim this=20003920
KeyboardController claim this=20002BE0
09 04 02 00 02 01 03 00 00 07 24 01 00 01 25 00 06 24 02 01 01 04 06 24 02 01 02 05 09 24 03 01 03 01 01 01 04 09 24 03 01 04 01 02 01 05 09 05 02 02 00 02 00 00 00 06 25 01 02 01 02 09 05 82 02 00 02 00 00 00 06 25 01 02 03 04 
MIDIDevice claim this=20002500
len = 76
  Interface is MIDI
type: 36, len: 7
    MIDI Header (ignored)
type: 36, len: 6
    MIDI IN Jack (ignored)
type: 36, len: 6
    MIDI IN Jack (ignored)
type: 36, len: 9
    MIDI OUT Jack (ignored)
type: 36, len: 9
    MIDI OUT Jack (ignored)
type: 5, len: 9
    MIDI Endpoint: 2
      tx_size = 512
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
type: 5, len: 9
    MIDI Endpoint: 82
      rx_size = 512
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
MIDIDevice claim this=20004AA0
len = 76
  Interface is MIDI
type: 36, len: 7
    MIDI Header (ignored)
type: 36, len: 6
    MIDI IN Jack (ignored)
type: 36, len: 6
    MIDI IN Jack (ignored)
type: 36, len: 9
    MIDI OUT Jack (ignored)
type: 36, len: 9
    MIDI OUT Jack (ignored)
type: 5, len: 9
    MIDI Endpoint: 2
      tx_size = 512
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
type: 5, len: 9
    MIDI Endpoint: 82
      rx_size = 512
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
MIDIDevice claim this=20002E80
len = 76
  Interface is MIDI
type: 36, len: 7
    MIDI Header (ignored)
type: 36, len: 6
    MIDI IN Jack (ignored)
type: 36, len: 6
    MIDI IN Jack (ignored)
type: 36, len: 9
    MIDI OUT Jack (ignored)
type: 36, len: 9
    MIDI OUT Jack (ignored)
type: 5, len: 9
    MIDI Endpoint: 2
      tx_size = 512
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
type: 5, len: 9
    MIDI Endpoint: 82
      rx_size = 512
type: 37, len: 6
    MIDI Endpoint Jack Association (ignored)
HIDParser claim this=20005180
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 36 =  ???
Descriptor 5 = ENDPOINT
Descriptor 37 =  ???
Descriptor 5 = ENDPOINT
Descriptor 37 =  ???

Do I need to figure this all out and make a PR for my devices? ;)
 
Status
Not open for further replies.
Back
Top