Teensy 4.0 external USB-B connector: board D+ D- pads not connected to microUSB ?

Status
Not open for further replies.

fab672000

Active member
Hi Paul,

First of all, thanks for these great boards you developed, I bought two 4.0's and I enjoy very much the MIDI functionality on them (using latest 1.49 beta 3) !

Context:
Enthusiastic I developed a bunch of new PCB's, that accept an external big USB-B connector, more adequate for a fairly large midi to usb interface (see pic below)
IMG_0059.jpg
(the pic does not show the wiring between the teensy and the MIDI motherboard but of course they are connected there as my design provides all four 5V GND D+ and D- signals to the USB-B connector, i have then to solder D+ and D- to the Teensy pads at the end of the build)

Problem:
A. On the Teensy 3.2 boards I also tested with; it worked as expected with my PCB:
i could connect my new midi interface pcb to its big external USB B connector and use it for both programming and MIDI -> no problem.

B. Now with both of my new Teensy 4.0 boards (that I bought from your site directly), it does NOT work with the USB-B big connector,
and after investigating, found out that D+ and D- are not connected to the micro usb connector pins (checked with my multimeter several times and both signals are not connected.

Am I missing something?
I hope I dont need to unsolder the micro USB connector to use a bigger USB B connector ?

-Fab
 
Last edited:
Are you referring to the D+ and D- pads on the underside of the board? Those are for the USB HOST port, not connected to the micro-USB connector.
 
Yes, thanks at least that confirms why it does not work!
Do I need to unsolder the microUSB port to get this build working with USB-B then?
 
Yes, thanks at least that confirms why it does not work!
Do I need to unsolder the microUSB port to get this build working with USB-B then?

If the Device USB is to be moved it would have to be from the upper micro USB. Since it is 480 Mbps USB not the prior T_3.x 12 Mbps they are not routed anywhere else on the Teensy 4.0.
 
USB2 (480Mbps) can also work on USB-B connectors right? so I don't see yet why it would not be be possible to interconnect the microUSB connector with a second (tougher) USB-B connector?
I don't need the USB host ID pin (as I use the port as a device) so the 4 USB-B pins should work fine as a replacement connector?

Sadly, that's the only thing that does not work, my new midi interface baby works 100% when using the micro USB port from the first proto PCB batch :)
 
Was thinking about this adapter too and this is probably the easiest way to work this around.

Thanks a lot for your feedback defragster + tele_player, I certainly have learned a lot on this board in a very short time thanks to both of you guys, should have used the forum sooner!
(as usual with me i always think first about my PCB being buggy so I wasted a lot of time on the 4.0 teensy version inspecting my pcb signals first)
 
Was thinking about this adapter too and this is probably the easiest way to work this around.

Thanks a lot for your feedback defragster + tele_player, I certainly have learned a lot on this board in a very short time thanks to both of you guys, should have used the forum sooner!
(as usual with me i always think first about my PCB being buggy so I wasted a lot of time on the 4.0 teensy version inspecting my pcb signals first)

The Teensy card is a handy tool - like the forum - on bottom side is the tan color code to those D+ / D- pads for 'USB Host' - which I see is also printed in silkscreen I just saw as well … with a bit of help from a lens.
 
The Teensy card is a handy tool - like the forum - on bottom side is the tan color code to those D+ / D- pads for 'USB Host' - which I see is also printed in silkscreen I just saw as well … with a bit of help from a lens.

True and I read that too, but I was thinking originally that it could fullfill both host and device functions, which it does but simply not the D+/D- signal pads which I did not know were actually dedicated host only lines, maybe the 4.5 version will feature both device and host pads with a larger form factor similar to 3.6 :)
PS: thinking about it, it is veryl cool to have also usb host independlty from the device functions, it means that potentially we could use a usb midi keyboard as well as serial midi and route all this to one (micro-usb) link.
 
Now that is a much better workaround in my use case, so that I can keep my small form factor originally planned that way and wire my pcb connector.
Thanks a lot for sharing this mjs513.
 
PS: thinking about it, it is veryl cool to have also usb host independlty from the device functions, it means that potentially we could use a usb midi keyboard as well as serial midi and route all this to one (micro-usb) link.

Yes, but to do USB host correctly and supply DC, you need something like tpd3s014, as used on Teensy 3.6. Teensy 3.6 works fine as host for my Arturia Keystep.
 
True and I read that too, but I was thinking originally that it could fullfill both host and device functions, which it does but simply not the D+/D- signal pads which I did not know were actually dedicated host only lines, maybe the 4.5 version will feature both device and host pads with a larger form factor similar to 3.6 :)
PS: thinking about it, it is veryl cool to have also usb host independlty from the device functions, it means that potentially we could use a usb midi keyboard as well as serial midi and route all this to one (micro-usb) link.

Indeed the (months away) T_4.1 is in the larger T_3.6 form factor and will have similar USB Host connect configuration. Without the switch chip it seems to work on T_4 going through a powered HUB - also gives needed power. There are breakouts that add the switch.

Indeed the @mjs513 item linked looks to be a perfect match.
 
Yes, the D+ and D- are for the second USB on T4.0. However, there is no reason why you cannot use the 2nd USB (USB2) in device mode. You only need to duplicate the usb stack to work on the 2nd port.
 
Yes, the D+ and D- are for the second USB on T4.0. However, there is no reason why you cannot use the 2nd USB (USB2) in device mode. You only need to duplicate the usb stack to work on the 2nd port.
Very interesting (because i would prefer a software fix, and also because it potentially gives the possibility of having an extra usb port for debug serial use ) ,

Would the USB characteristics be similar in terms of speed ?
(I would like to use the USB2 480Mbps speed if possible).
 
Very interesting (because i would prefer a software fix, and also because it potentially gives the possibility of having an extra usb port for debug serial use ) ,

Would the USB characteristics be similar in terms of speed ?
(I would like to use the USB2 480Mbps speed if possible).

Yes, Both USB ports are 480 Mbs and use the same underlaying design. In how far cloning USB1 to USB2 is easy or not, depends on your programming skills (and the reading of the IMXRT documentation)
(not sure if renaming is all what needs to be done)
 
Yes, Both USB ports are 480 Mbs and use the same underlaying design. In how far cloning USB1 to USB2 is easy or not, depends on your programming skills (and the reading of the IMXRT documentation)
(not sure if renaming is all what needs to be done)

Just had a quick look now and after analysing from:

usb_midi_class usbMIDI;
Then looking inside the class and following for sending only already:
usb_midi_class define in a send() method that then calls (wraps) usb_midi_write_packed((uint32_t n) c code.
There is as you can notice no dependency injection approach to parameterize the usb lines on which the send is going to operate...
Then getting further into that code, then calls usb_transmit(MIDI_TX_ENDPOINT, xfer), which again here shows the endpoint is hardcoded.
Similar analysis shows a lot of hardcoding in usb_midi_flush_output().

Sorry but no, not a good idea unless you are a core developer with a lot of available time to do that :)

Maybe in future we will have a template class version of the usb_midi_class<injected_dependency_types> and/or parameterized constructors (i.e. usb_midi_class(int pinDP, int pinDM) ) and methods to achieve portable midi usb handling without code duplication, usually a proper use of c++ templates should allow reusability while not sacrificing performances (the compiler will generated the 'hardcoding' for you).
But for now it does not seem reasonable / good time spent to do this with the current code base.

I'll be done in minutes with the cable recommended by mjs513 ...
-Fab
 
Last edited:
Hi Paul,

First of all, thanks for these great boards you developed, I bought two 4.0's and I enjoy very much the MIDI functionality on them (using latest 1.49 beta 3) !

Context:
Enthusiastic I developed a bunch of new PCB's, that accept an external big USB-B connector, more adequate for a fairly large midi to usb interface.

Problem:
A. On the Teensy 3.2 boards I also tested with; it worked as expected with my PCB:
i could connect my new midi interface pcb to its big external USB B connector and use it for both programming and MIDI -> no problem.

B. Now with both of my new Teensy 4.0 boards (that I bought from your site directly), it does NOT work with the USB-B big connector,
and after investigating, found out that D+ and D- are not connected to the micro usb connector pins (checked with my multimeter several times and both signals are not connected.

Am I missing something?
I hope I dont need to unsolder the micro USB connector to use a bigger USB B connector ?

-Fab

Hi, this is a timely thread for me because I am designing my own midi controller using a Teensy. Can you clarify something for me? Currently with a Teensy 4.0, like you I can design a PCB that has a USB-B which connects to d+ and d- (and 3.3V + gnd) on the Teensy, and this connection will allow me to plug my midi controller to my computer and communicate with my audio/midi software. However, I will not be able to use the USB-B port to program the Teensy board. To program the Teensy, I have to use the micro usb port, or wire in a different connecting cable as suggested in this thread?

Secondly, I was actually planning on using a Teensy 3.2. In this case, the USB-B on the pcb will allow me to plug my controller to my computer software and it will work as a midi controller, and the USB-B will also work for programming the Teensy?

thanks
 
Hi, this is a timely thread for me because I am designing my own midi controller using a Teensy. Can you clarify something for me? Currently with a Teensy 4.0, like you I can design a PCB that has a USB-B which connects to d+ and d- (and 3.3V + gnd) on the Teensy, and this connection will allow me to plug my midi controller to my computer and communicate with my audio/midi software. However, I will not be able to use the USB-B port to program the Teensy board. To program the Teensy, I have to use the micro usb port, or wire in a different connecting cable as suggested in this thread?

No you can't without a workaround (see mjs513 suggestion), that's what I realized at my expense as DP and DM are USB host *only*, not USB device.
Using the second USB midi port was what I was analysing this morning and it does not seem easily feasible (lot of hardcoded, fast but not parameterized code)

shmsih said:
Secondly, I was actually planning on using a Teensy 3.2. In this case, the USB-B on the pcb will allow me to plug my controller to my computer software and it will work as a midi controller, and the USB-B will also work for programming the Teensy?
Correct, it will work because on Teensy 3.2, these D+ D- pads are actually connected to the same DP DM pins of the microUSB connector as there is only one USB port available from the pins/pads. But of course the Teensy 3.2 only has 3 hardware serial ports versus 5 for the T4.0 so I'm going the extra mile (mjs513's cable extra wiring workaround) to still get my T4.0 based midi interface work as I intended.
 
Last edited:
No you can't without a workaround (see mjs513 suggestion), that's what I realized at my expense as DP and DM are USB host *only*, not USB device.

Thank you. I haven't bought a Teensy yet and I just realized that the 4.0 and 3.2 are the same price but the 4.0 has a much faster processor. I wonder what is the preferred path forward for making a midi controller - 3.2, or 4.0 and use the micro usb with a cable as mjs513 suggests. Since I plan on using a USB-B panel mount connector with a cable to the PCB anyways, maybe I'll just use the 4.0 and a cable like this: https://www.pjrc.com/store/cable_usb_panel_micro.html
 
It all depends on your design choice, my form factor and enclosure does not easily allow for an extra panel mount like this so i preferred to reuse my pcb USB connector.
Frankly, the increased T4.0 speed should not matter in this application, as midi speed is about 31250 bps, but the reason why I wanted it is because it has 5 serial ports which suited well my design needs.
 
If I go with the teensy 3.2 and put a header on my PCB, I'm slightly confused on where the USB-B pins go. pins 2 and 3 go to d- and d+, pin 4 goes to gnd. But does pin 1 go to VUSB?

thanks!
 
If I go with the teensy 3.2 and put a header on my PCB, I'm slightly confused on where the USB-B pins go. pins 2 and 3 go to d- and d+, pin 4 goes to gnd. But does pin 1 go to VUSB?

thanks!

Until you get an external power supply ; it does not really matter if you connect to VUSB or VIN as they are connected, you get more than enough power from VUSB to feed the entire board and USB powered devices are simple to use.

If you plan to use an external power supply, then you have to cut the trace on the board between VUSB and VIN and power you card with VIN.
And in that last case it matters now and you probably should use VUSB for pin4.

Alternatively you use few shottky diodes to make it easier and still safe to power with either of these, Paul has a great discussion on this, see:
https://www.pjrc.com/teensy/external_power.html

Remember: According to the USB standard specification, you should NOT connect the shield to GND on USB devices, only connect it on USB hosts.
 
Last edited:
The usb port of mine teensy 4.0 was accidentally broken, I tried to solder a new usb port wires to d+ and d- pads but the board isn't recognized by PC.

Could you say me where can I solder new usb port wires to be able to upload programs into the board... ?

I already tried to solder on broken usb port pins, but they are too small...
 
Status
Not open for further replies.
Back
Top