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

Thread: Level shifter needed for USB input/host port?

  1. #1

    Level shifter needed for USB input/host port?

    So I need to reroute the USB input port (the original Micro USB port on board) to another USB female connector. Will I need to desolder the Micro USB port and use the pads or if I can just use pin D0 and D1? Will I need to use a level shifter/resister voltage divider? What kind of speeds are needed for the level shifter? Any recommendations?
    How about the host port? I think I can directly connect them to 5v? The Teensy 4.0 breakout/evaluation board have the D+/D- directly connected to the pogo pins for the host pins.

    Click image for larger version. 

Name:	USB.jpg 
Views:	47 
Size:	136.6 KB 
ID:	19065
    This is my USB C port, to replace the Micro USB port. It is in device mode (the pulldown resister to CC pins) so it can actually draw more current to charge the lipo. A6/B6 or A7/B7 goes to D0 or D1? The TX RX D+ D- thing is quite anoying and I am not sure which one is corect.
    Also the host port as well, D+ to D+ and D- to D- on the SMD pad under the Teensy?
    Click image for larger version. 

Name:	USBHOST.jpg 
Views:	20 
Size:	84.2 KB 
ID:	19066
    It is not very clear on the T4 breakout/evaluation board, it looks like D+ is directly connected to D+ and vice versa. 5V logic level...

    BTW the USBLC6-2SC6 ESD protection chip's I/O1 is connected together, and I/O2 as well. Not sure if needed.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Sorry I am not fully understanding your question, especially when you talk about D0 and D1?

    But if you are asking can you use Digital pins 0 and 1 as connections and use it to do USB to replace the USB connector on the T4? The answer is NO. That is on some Arduinos they use an external processor/chip to do the USB communications for it and it connects up to the processor through a UART (which on some is pins 0 and 1)... That is not the case for Teensy boards, They have USB built into the main processor.

    So to replace the functionality of the USB connector on a T4, you need to replace the USB connector and/or use an extension connector that plugs into the existing USB port.

    Note: on some other Teensy boards like T3.2, there are bottom pads for the D+ and D- pins which you could use. But this is not the case with the T4. This is because the USB communications on a T4 can go a whole lot faster than a T3.x...

    The Bottom pads D+ and D- go to the USB Host (USB2) and these signals are setup to be able to go directly to a USB connector. As for the Power to go to the USB connector, there are different options you can do. Often times you can use a power management chip to help with not overpowering the USB power usage... Look at the T3.6 schematic for an example on how to do this.

    And again remember I am a retired software engineer not an electrical... SO hopefully someone who is more of an EE type can give you a more complete answer.

  3. #3
    Senior Member
    Join Date
    Feb 2015
    Quote Originally Posted by jerrymonkey View Post
    Will I need to desolder the Micro USB port and use the pads
    Yes. I would scavenge (cut) an existing cable with the desired connector, solder the wires directly to the Teensy 4.0, and use UV curing glue or epoxy to help keep the wires in place.

    I'm not sure how I'd do a connection to a separate board with the connector and the ESD protection. Very short wires, maybe? But multistrand wire (flexible) tends to wick the solder up, so very short multistrand wires tend to become suffused with solder, so essentially become single-strand; and repeated movement tends to cause such (and single-strand) wires to eventually break with metal fatigue. Longer wires (inch/25mm or longer) are susceptible to picking up noise (like an antenna!).

    Personally, I wouldn't bother. I do have USB2.0 devices that gulp current (way beyond the 100mA/500mA allowed by the USB 2.0 standard -- an LTE modem dongle for example) that work just fine with ordinary USB ports. My chargers don't care either, and provide about 2A quite happily.

    Quote Originally Posted by jerrymonkey View Post
    or if I can just use pin D0 and D1
    My Teensy 4.0 does not have such pins. As KurtE mentioned, the 0 and 1 pins at the corner of the board are unrelated I/O pins.
    The underside does have D+ and D- pads for the USB host port, which is a completely separate port, unrelated to the existing micro-USB port.

    Quote Originally Posted by jerrymonkey View Post
    Will I need to use a level shifter/resister voltage divider?
    No. While USB has a 5V voltage line, the D+ and D- are actually 3.3V logic level signals.

    Quote Originally Posted by jerrymonkey View Post
    How about the host port?
    Connecting the pads to the correct pins on the connector is enough.

    You might also be interested in my EasyEDA USB and 1-cell (3.7V) LiPo to 3.3V 1A project. It uses a MCP73871 battery charger with power path management, and a very efficient but cheap TPS82084 step-down converter. At low currents (1mA to 10mA load at 3.3V), it is "only" 90% efficient; at high load (200mA to 1000mA) it is 94%+ efficient. This means that even if you draw 3W of power, the circuit only generates 0.2W of waste heat.

    In particular, if there is no battery (it does not need one to work!) or the battery is fully charged, drawing 500mA via USB provides some 710mA on the 3.3V output; it's that efficient (according to datasheet and TI Webench Power Designer, that is).

    This is more intended for powering circuits from a charger, but you can use it with ordinary USB hosts as well. You can use a different USB connector and/or connect the D+ and D- signals (directly or via ESD protector chip) to Teensy. The MCP73871 has two "jumpers" (connected to either VUSB or GND) that you can use to limit the total current drawn from USB to 500mA or 1000mA. When both are connected to VUSB, the circuit should be able to provide almost 2A of power.

    While the components are cheap, they are very hard to solder; really need a reflow oven to safely solder, I think. I don't have one.

    Oh, and the project is in Public Domain, so you can do whatever you like with it. Just don't blame me if it breaks your Teensy; I'm not an EE, just a hobbyist myself. But I did include links to the design report, TI Webench, and the datasheets, so one can easily verify the circuit. It really is very straightforward implementation.

  4. #4
    That is very clear, so the USB interfaces, both the programming port and host port are not like normal digital pins. They are also designed to directly connect to a USB port, so 5v levels then.
    Thanks for the clarification.

    A software engineer... cool~

  5. #5
    Quote Originally Posted by Nominal Animal View Post
    No. While USB has a 5V voltage line, the D+ and D- are actually 3.3V logic level signals.
    Oh I am a dumbass, USB is 3.3V logic levels! USB 2.0 is 0.4V!
    So no worries right there, to connected it directly to the pads for sure. Just maybe add an ESD protection.

    For the power USB port I think some very thin single strand wires? Micro USB pin pitch is not particularly small, and is quite easy to solder.

    Current limiting, for the host port, yeah... My 2A kinda efficient boost converter can handle standard USB loads for sure, maybe a 1A limit will do.
    I boost to 5V because USB host will be used quite often, and if without a boost I will rely on a linear 3.3v power supply, which normally have 0.5v dropout @500mAh, so no USB load, and wastes a lot of Lipo juice as it is not useable @3.7V.
    If I boost, I better boost to 5V so I can directly get power for the host port, and from 4.2v down to 3.0v requires a buck boost instead of a boost, which is kinda b.s.

    Because I've got myself a 5000mAh battery, it will be optimal to use a 2A charger, and so TP5100 is what I found, 4.2/8.4v 2A lipo charger, cool.

    Rest of it is just a copy from GreatScott's lipo charge boost circuit. Just remember to keep traces short and THICK.

    I am not sure if MAX17043 can be used that way. Sparkfun and the Maxim Integrated datasheet both suggest use Lipo power as VDD. I think my circuit will work, they are grounded together, and the chip is just a voltage monitor thing, so just give it a voltage reference. It... doesn't have current measurements I think. The how many fuel left in your lipo, alert you when lipo go to low is all from the voltage. Should I monitor the voltage myself? Using a voltage divider and an analog pin? Or stick with Maxim? Did I connect it correctly? I couldn't test the circuit first, and I'd better get things right. PCB is cheap, but I don't want to waste. Living beside China makes both PCB and shipping cheap, AWESOME!!

    I am neither EE nor more serious hobbiest, and not a software engineer, even a retired one, so OOOOPS.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	註解 2020-02-16 104107.jpg 
Views:	28 
Size:	249.8 KB 
ID:	19076  

Posting Permissions

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