Teensy 4.1 - don't have +5V on USB host

Andy Belov

Well-known member
I have the USB host GND connected to the common GND. Is that the problem?
I use my own PCB. Should I connect USB GND to the USB connector only?
The funny thing is that there is +5V between "5V" on the USB and "3.3V" pin, not the GND.

There is not really much documentation on Teensy 4.1. Or am I missing something again?

Thanks.
 
Have you tried using the USBHost_t36 library yet? The USB Host power is turned off until that library toggles the pin to turn it on.
 
Have you tried using the USBHost_t36 library yet? The USB Host power is turned off until that library toggles the pin to turn it on.

I can verify that. With just a blink sketch loaded, there was no voltage on the USB host +5 pin. Once USBHost_t36 was loaded and enabled the output that switches on USB host power, there was +5V(ish). And the USB host ground pins are connected to the common ground.
 
I ran this example, which worked fine with Teensy 4.0: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\examples\Test\Test
No response, no 5V.
 
I ran this example, which worked fine with Teensy 4.0: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36\examples\Test\Test
No response, no 5V.

I loaded up the Test example from USBhost_t36 it on a T4.1 here and saw +5V on the USB host power pin as soon as I opened the Serial monitor so that the program could start and the USB host object could be initialised.
 
What Teensyduino you guys are using?
I got the latest a couple of days ago: 1.53 with Arduino 1.8.13

I just got a new and untouched Teensy 4.1, connected the power, loaded the test, see "USB Host Testing", but no +5V on the USB host.
I do see +3.3V on Teensy, in case you wonder about my voltmeter (he-he).
 
Did you select Teensy in the Tools > Ports meny and then open the Arduino Serial Monitor? What do you see in that window?

The very first line in setup() for the Test program is this:

while (!Serial) ; // wait for Arduino Serial Monitor

So if you don't open the serial monitor window, it will just sit there waiting for you.
 
What Teensyduino you guys are using?
I got the latest a couple of days ago: 1.53 with Arduino 1.8.13

The same: 1.53 with Arduino 1.8.13.

Ran one more test with Optimize = Faster, which is the default in the IDE. (I always use Optimize = Fast because, though I can't prove it with a simple example program, I know there's something wrong in Optimize = Faster.) Anyhow, same result; open the Serial monitor, see +5V on the host power pin.

Silly question: do you have a header soldered to the USB host pins? Did you solder all the pins? I ask because recently I neglected to solder one VCC pin on a PCB I was populating... That had me scratching my head for a while.
 
New findings.
It has to do with the Teensy ports, the way Arduino sees them.

This morning, after a PC reboot, I plugged in the bare Teensy 4.1 with nothing on it.
The port name that Arduino showed was not COM, but like "USB..." and a longer string after that, not "COM..."
Loaded the test, see 4.8V on USB host, not 5V. Hope it's not a problem.

Then I plugged in my old board with the USB connector and other things on my PCB. Arduino shows it as COM4.
Loaded the test - no 5V.

Ok. Plugged the bare Teensy back. Now Arduino still shows COM4 and COM3 for the board plugged in.
But it shows 2 of them: "COM4 Serial (Teensy 4.1)" under "Teensy ports" and "COM4 Teensy" under "Serial ports".
So, Arduino selected "COM4 Teensy" for me. Ran the test, nothing.

Selected "COM4 Serial (Teensy 4.1)" next time, see 4.8V.
I need to check now how VisualMicro works with the ports in Visual Studio. This is what I use with my PCB.

Thanks for your help, everybody.
 
Teensy is not always a serial device (COM port in Windows). During programming, and with a brand new Teensy, HID protocol is used, not serial. Teensy only becomes a serial device when it runs your program, and only if Arduino's Tools > USB Type menu was set to one of the options with "Serial", which causes your program to be built with USB serial support.

If you're used to Arduino's "everything is always a serial port" model, you might mistakenly believe Teensy isn't working when it's in one of the non-serial modes. But that is indeed how it is supposed to work.
 
Thanks for clarifying, Paul.

If this is how it works, that's fine. It just makes it difficult to understand what's happening sometimes.

The confusing part was that the test sketch seemed to work fine.
I've added another serial "printf" at the end of "setup", to make sure that it all goes through, and it would show up in the serial monitor no matter what port I used.
The problem was that it would actually enable the USB host only if I had one of the "Teensy ports" selected.

Just want the folks here to know about this catch: beware of the actual port you use to talk to Teensy.
You may be talking to a ghost.
 
Turns out that it's my battery charger. When I use power from the PC USB, the USB host works fine.
As soon as I enable the battery charger, the USB host never puts out the 5V. I'm sure the charger limits the current going to Teensy and there is not enough of it for the USB host and the keyboard plugged into it.

I've spent so much time trying to make a LiPo battery charger and still no luck. I need the "load sharing", so that I can use Teensy while charging the battery.
Tried 5 "simple" solutions - the voltage goes to 2.8V when the battery is charging with Teensy on.
Tried this: https://www.digikey.com/product-det...88EDE-2-TRPBF/LTC4088EDE-2-TRPBFCT-ND/9555771
Nothing really works good enough.

Well, back to the research. Daaaaaamn!!!!!!!!!!
Please, somebody, share a working (not "try this" or "I've seen this"), diagram of a 3.7V battery charger with load sharing.

Thanks.
 
Please, somebody, share a working (not "try this" or "I've seen this"), diagram of a 3.7V battery charger with load sharing.

Thanks.

Andy:

I may be answering a question quite different from the one that you are asking, but I have successfully used the Adafruit PowerBoost 1000C in my TeensyMIDIPolySynth project, both to power my project & to charge/manage the LiPo battery. In case you aren't already familiar with it, the PowerBoost 1000C accepts USB micro input to charge the battery, it provides 5VDC pass-thru, & it also boosts the 3.7VDC LiPo battery to 5VDC output at 1A of current, automatically & seamlessly switching between USB input power & boosted battery power. Even if you don't use the actual product itself from Adafruit, you can view the schematic <here>, which may provide some ideas for your own battery charger circuit.

Good luck & have fun !!

Mark J Culross
KD5RXT
 
Thanks guys. Just got the 1000C at DigiKey. Looks twice as complex as what I had, but I hope it works.
Will let you know.

This is so strange. This is the third time I'm posting a reply and they just keep disappearing.
 
Thanks guys. Just got the 1000C at DigiKey. Looks twice as complex as what I had, but I hope it works.
Will let you know.

This is so strange. This is the third time I'm posting a reply and they just keep disappearing.

Don't know if it matters to your project, but be aware that the PowerBoost 100C does not pass the D+/D- lines thru (from microUSB input to full-size USB output). I bought a panel-mount microUSB socket to microUSB plug cable to add to my TeensyMIDIPolySynth. I split the +5VDC & GND wires, wired them to the appropriate connections on each side of the PowerBoost 1000C, & left the D+/D- wires intact to carry USB data from the front panel socket all the way to the Teensy at the heart of my project. I also connected the USBhost connection from the Teensy to the front panel & use that for connecting my MIDI keyboard. I have not had any trouble with the PowerBoost 100C successfully running the Teensy & all of the electronics around it, as well as the external MIDI keyboard, & I generally get at least 8-hours of operating time out of my 2500mAH LiPo.

Good luck & have fun !!

Mark J Culross
KD5RXT
 
Thanks, KD5RXT. I'm just going to see if the board works, which it does, as you say. Them I'm going to "reflow" it to my absolutely awesome guitar/keyboard/composer board.
8 hours is amazing, but I'm afraid the battery will be too big. I need my whole thing to be small enough to be attached to a guitar belt with no bulky feeling.
I'll let you know how it goes.
 
Thanks, KD5RXT. I'm just going to see if the board works, which it does, as you say. Them I'm going to "reflow" it to my absolutely awesome guitar/keyboard/composer board.
8 hours is amazing, but I'm afraid the battery will be too big. I need my whole thing to be small enough to be attached to a guitar belt with no bulky feeling.
I'll let you know how it goes.

Andy:

Sorry, I should have posted the <link> earlier for the specific battery that I used . . . it's actually small & light, but that's not necessarily a relative comment when you're talking about a "belt sized" project (very cool !!) !! For me, it seems that the battery is almost always one of the bigger challenges, no matter what the project !!

Looking forward to seeing the end result !!

Mark J Culross
KD5RXT
 
Thanks guys. Just got the 1000C at DigiKey. Looks twice as complex as what I had, but I hope it works.
Will let you know.

This is so strange. This is the third time I'm posting a reply and they just keep disappearing.

The other two posts are 'present' but marked "This message has been deleted by Andy Belov." {Sr+ view) - like the '! triangle' icon was hit on them ???

As far as Adafruit - their NRF Sense board has onboard LiPo JST and charger - looks like 5 parts with status LED and resistor here at location "5 E" :: adafruit.com/ .../sensors_Feather_Sense_sch.png
 
Thanks for checking my posts, defragster. I didn't delete them. I tried to fix some typos in them and the moment I started to type they just disappeared, so I had to do it again. Doesn't matter.
But the Adafruit 1000C works fine for me. I'll use it, even though it's much more complex and expansive than I expected.
Just need a bigger battery. the 450 mah I have lasts under 2 hours with the screen on. Want to have more.
 
A sad update.

I've found Adafruit's diagram for the 1000C board and decided to "reflow" it onto my board. Got all of the specified parts, all in proper footprints, and made a new board with the charger on it.
Plugged in the battery and connected for charging. Looks good, but gets a little hot, which is probably normal. I thought, I finally have a good charger with load sharing.
Fine. Then I thought "Wait, I never tried charging the battery, and Teensy on and humming, AND my little MIDI keyboard plugged in at the same time".

Here is what happened next: first a little smoke from the charger chip, then more smoke, then more, then a crackling sound like from a campfire. I unplugged the USB and the battery as fast as I could, but by that time the charger chip (not the booster) turned in a little ball of coal with a beautiful black star around it. Amazingly, Teensy survived with no problem. I just put the jumper back to bypass the charger and left my little Chernobyl to stink there.

Then I mutilated the Adafruit board and removed all of the resistors from it and measured them to make sure that it is what it shows on the schema. It was all good.
The only thing I can think of it that my tracks are all 0.127mm, which works fine for powering from the USB. So, I'm going to make them all as massive as they are on the 1000C board. Hope this was the problem, but I don't see how it would burn the charger chip itself and not the tracks or anything else.

And I really don't think the MIDI keyboard takes a lot of current. It's just a cheapest piece of plastic with a MIDI port I could find, but it works fine.

If you have a word of wisdom for me, I'm all ears.
Thanks.
 
A sad update.

I've found Adafruit's diagram for the 1000C board and decided to "reflow" it onto my board. Got all of the specified parts, all in proper footprints, and made a new board with the charger on it.
Plugged in the battery and connected for charging. Looks good, but gets a little hot, which is probably normal. I thought, I finally have a good charger with load sharing.
Fine. Then I thought "Wait, I never tried charging the battery, and Teensy on and humming, AND my little MIDI keyboard plugged in at the same time".

Here is what happened next: first a little smoke from the charger chip, then more smoke, then more, then a crackling sound like from a campfire. I unplugged the USB and the battery as fast as I could, but by that time the charger chip (not the booster) turned in a little ball of coal with a beautiful black star around it.
Something definitely wrong there...
The only thing I can think of it that my tracks are all 0.127mm
5 thou? Well that's only good for logic signal, definitely not for any kind of power, too much inductance,
too much resistance and voltage loss, will act as fuse all too easily too. 1.27mm wide would be more
reasonable, 50 thou. 5 thou traces are rather too much like resistors here.

USB power traces can be handling upto 0.5A, and you probably want to limit voltage droop to 50mV or so for
USB connection and probably less for the battery connections as the chip senses its voltage and any IR
voltages between the battery and the chip will introduce measurement error.

With power converters like the DC DC converter the layout is crucial too, as well as requiring low-inductance
routing of the current paths and careful placement of feedback components.
 
Thanks, MarkT.

This is my first board of this complexity and I'm still learning while doing it.
The weird thing is that it all works absolutely fine while powered from USB. No audio noise, no hot spots on the board or on any components.
The tracks are thin, yes, but the total current I've measured would not go above 110mA.
The disaster only stroke withe new charger. Must be some distorted resistance somewhere.
And nothing else has burned at all, just the charger chip itself, to ashes.

I'm making the GND and +3.3V tracks 0.3mm now, this is all I can afford. I need to keep my device with the screen to be "pocket size".
And I'm going to get a "copper fill" where I can, like they did on the Adafruit board.

If none of this helps, I quit and go to Florida Keys to live as a beach bum.
I spend more time on making a good battery charger than on all other units combined.
This is my 4th generation of a charger and the first one to give fireworks.
 
Back
Top