Teensy 4.1 USB Host with external power

Status
Not open for further replies.

Myreauks

Active member
Hi!

I have managed to establish USB-Midi communication between my USB-Midi keyboard and Teensy 4.1 through the USB Host port, I am even powering the keyboard through the Teensy! This is pretty awesome. Everything works fine as long as I am powering the Teensy through the mini-usb, whether from a computer or a wall outlet.

However, if I power the Teensy through the Vin pin, USB Host stops all communication with the midi keyboard. I have verified that my power source has enough power to give to my USB Midi controller by powering the USB port straight from the power source instead of through the teensy, but this still doesn't give me the communication.

Is there something about the USB Host port functionality I am missing here?

Best,
Miro
 
Any chance there's a leftover "while (!Serial) ; " somewhere in the code, which is waiting for the serial monitor?
 
Any chance there's a leftover "while (!Serial) ; " somewhere in the code, which is waiting for the serial monitor?

Hi Paul! Thanks for the reply.
Unfortunately not. The USB-host connection works just fine when I power the Teensy from the micro-usb port even with just a phone charger. This makes me think that the code is not the problem here.

At the moment, with external power from VIN, the lights turn on on my MIDI keyboard but the Teensy is not receiving any messages. Everything else is working fine and I have tested the Guitar example to make sure that my DAC (PCM5102A) works with external power.

Best,
Miro
 
Unless you've cut the pads apart on the bottom side, the VIN pin is connected directly to the USB power. Here's the schematic.

https://www.pjrc.com/teensy/schematic.html

If the voltage really is 5 volts, they really should be the same, at least power-wise. But whether the USB port is active is a major difference. I hear you, that you're convinced it's power. Use a voltmeter to watch VIN both ways, so you can confirm the power in both cases. If that checks out, you really should reconsider the assumption that it's power and start looking closely as your code. Try adding LED blinks or other very simple ways to confirm things are happening. We see this sort of problem all the time, where something works with USB power but not with external power. It's almost always something about the code.
 
And indeed it was a problem with my wiring/breadboard. I should never trust breadboards without trying at least a couple of different holes for the connections...
Anyhow, problem solved.

Best,
Miro
 
Status
Not open for further replies.
Back
Top