Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Teensy 4.1 USB Host with external power

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Location
    Finland
    Posts
    10

    Teensy 4.1 USB Host with external power

    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

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,270
    Any chance there's a leftover "while (!Serial) ; " somewhere in the code, which is waiting for the serial monitor?

  3. #3
    Junior Member
    Join Date
    Jan 2020
    Location
    Finland
    Posts
    10
    Quote Originally Posted by PaulStoffregen View Post
    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

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,270
    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.

  5. #5
    Junior Member
    Join Date
    Jan 2020
    Location
    Finland
    Posts
    10
    I will do as you suggested and see what comes up.

    Thanks!
    -Miro

  6. #6
    Junior Member
    Join Date
    Jan 2020
    Location
    Finland
    Posts
    10
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •