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

Thread: USB-C Adapter

  1. #1
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,447

    USB-C Adapter

    Inspired by vjmuzik's thread https://forum.pjrc.com/threads/65633...SB-C-Connector and my quest to get familiar with KiCad I thought it might be fun to do a simple USB-C adapter board. The CC configuration (two 5k1 pulldowns) will signal the host to provide 5V, up to 3A on VBUS.
    If necessary, the actual power provided by a host (0.5A/2.5W, 1.5A/7.5W or 3A/15W) can be found out by measuring the voltage on CC1/CC2. Here a corresponding Microchip App note http://ww1.microchip.com/downloads/e.../00001953a.pdf. The CC signals and GND/5V are available on the pin headers which will also provide mechanical stability.


    Click image for larger version. 

Name:	schematic.jpg 
Views:	40 
Size:	101.5 KB 
ID:	23011 Click image for larger version. 

Name:	kicad_3d_1.jpg 
Views:	20 
Size:	43.0 KB 
ID:	23012Click image for larger version. 

Name:	kicad_3d_2.jpg 
Views:	16 
Size:	51.1 KB 
ID:	23013Click image for larger version. 

Name:	breadboard1.jpg 
Views:	23 
Size:	136.4 KB 
ID:	23014Click image for larger version. 

Name:	breadboard2.jpg 
Views:	21 
Size:	30.9 KB 
ID:	23015

    I wonder if this setup will also work for the higher usb frequency on the T4 boards. Here the relevant DP/DN traces:

    Click image for larger version. 

Name:	datatracks.jpg 
Views:	26 
Size:	62.6 KB 
ID:	23016

    Click image for larger version. 

Name:	top.jpg 
Views:	24 
Size:	118.6 KB 
ID:	23017Click image for larger version. 

Name:	bottom.jpg 
Views:	17 
Size:	71.3 KB 
ID:	23018

    Bottom fill -> GND, Top fill -> VBUS

    Anything to improve? Comments?

    EDIT: here the link to the Onshape 3d design if someone is interested: https://cad.onshape.com/documents/4e...c82f47aacdc46e
    Last edited by luni; 12-29-2020 at 09:16 AM.

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,913
    That looks nice, makes sense.

    Are there any parts to add to help 'clean' the power without breaking the rules? USB-C input noise, or the noise of whatever might want 2+ Amps on the 5V shared with Teensy micro USB?

  3. #3
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,447
    Quote Originally Posted by defragster View Post
    That looks nice, makes sense.

    Are there any parts to add to help 'clean' the power without breaking the rules? USB-C input noise, or the noise of whatever might want 2+ Amps on the 5V shared with Teensy micro USB?
    Not on this board but since you would connect power hungry devices to the pin headers I'd say you can always do any required filtering there.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,913
    Quote Originally Posted by luni View Post
    Not on this board but since you would connect power hungry devices to the pin headers I'd say you can always do any required filtering there.
    okay, wasn't sure if a cap (or other?) here or there might fit and help

  5. #5
    Deleted User
    Guest
    The DP line is longer than the DN. It may well be within tolerances as is now, but just to mention, DP/DN are a differential pair.

    Measuring on Rd is a nice diea, but this has to be done really carefully, as any influence, let's say an accidential connection or a misprogrammed I/O could lead to smoky surprises.

    Edit: Also, keep in mind an ADC can load the input with charging pulses or it's own impedance, this way would detune the Rd.

    I'd add a rtr dual OpAmp as a voltage follower, where the Rd is formed as a voltage divider with the tap to the OpAmp input. On the output I'd set a 330Ω to protect any connected I/O or against short circuit.

    This way the Rd pins can not be mistreated and you instantly get a voltage limited signal for 3.3V or even 2.56V ADC inputs.

    A dual OpAmp is just a few pennies but gives a great safety.

  6. #6
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    732
    It’s definitely better to make sure you have the differential pair length and impedance matched just to be compliant with spec. However, there is a some wiggle room allowed and even with running the signals over hookup wire in my case it has worked fine. So I doubt these board would have any problems handling the faster signals even if the trace lengths aren’t perfectly matched.

  7. #7
    Deleted User
    Guest
    Forgot:

    A misbehaving PSU could deliver VBUS well beyond Teensy's input range.
    I'd add a (autoreset) fuse and a voltage clamping diode, just to make sure there will be no higher than 5.5V at the MicroUSB.

    As written, the DP/DN difference is may well be within specs tolerances. It is just a matter of tolerences here one there and so they add up. Who knows the host is not stretching specs already?

  8. #8
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,447
    Thanks a lot for the input. Made me recalculating and rereading some stuff.

    Regarding the differential line: IIRC, a rule of thumb says as long as your wires are shorter that 1/10 of the wavelength you don't need to worry. At c = 1.5E8 m/s, f = 500MHz, one gets lambda = c/f = 30cm -> lines smaller than 3cm should be fine. The dp/dn tracks in the layout are approx. 5mm long, their length difference is about 0.5mm (which corresponds to about 3ps). So, I think this should be on the safe side right? Being a physicist not an EE, I might be very wrong though.

    Measuring on Rd is a nice diea, but this has to be done really carefully, as any influence, let's say an accidential connection or a misprogrammed I/O could lead to smoky surprises.
    Edit: Also, keep in mind an ADC can load the input with charging pulses or it's own impedance, this way would detune the Rd.
    Yes, in principle you could generate the correct pulse sequence on the CC lines to mimic the power delivery protocol and accidentally switch the host to some higher voltage. I think I'll just take that risk ;-)

    I'd add a rtr dual OpAmp as a voltage follower, where the Rd is formed as a voltage divider with the tap to the OpAmp input. On the output I'd set a 330Ω to protect any connected I/O or against short circuit.
    This way the Rd pins can not be mistreated and you instantly get a voltage limited signal for 3.3V or even 2.56V ADC inputs.
    A dual OpAmp is just a few pennies but gives a great safety
    Sure, but IMHO all this doesn't need to be done on the adapter. If one actually wants to measure the voltage on the CC lines and worries about damage, protection can always be done on the breadboard. Isn't this the same with measuring any signal with a Teensy? None of the inputs has protection against overvoltage so, if you worry about overvoltage you have to protect them somehow.

    I think I'll try to avoid overengineering this simple adapter and just order a couple of them do some experiments and post my experiences here.

  9. #9
    Deleted User
    Guest
    At least the overvoltage protection is highly recommended.

    I have here in my hand a USB-C charger. This freakin p-o-s gives fixed 12V basta, completely out-of-specs. It is a very popular power supply / charger for a variety of rechargeable power tools of a well-known brand.

    On one hand I can not believe things like this are set in the wild, but this is happening. And the writing USB-C is huge while that 12V marking is 3pt microfont.

    Imagine this being connected by makers to your adapter and the howling coming up.

  10. #10
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,447
    And the writing USB-C is huge while that 12V marking is 3pt microfont.
    :-)

    Any recommendations on a fuse and the clamping diode?

  11. #11
    Deleted User
    Guest
    Even better than a slow fuse:

    https://circuitdigest.com/sites/defa...it-Diagram.png
    https://circuitdigest.com/electronic...ection-circuit

    The real thing, 2A:

    https://www.ti.com/product/TPD4S014

    Or this, 1.5A current:

    https://www.maximintegrated.com/en/p...MAX4987AE.html

    By using one of these two, you add a proper ESD protection to Teensy as well.

  12. #12
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,447
    Works :-)

    Click image for larger version. 

Name:	02.jpg 
Views:	15 
Size:	124.9 KB 
ID:	23170Click image for larger version. 

Name:	01.jpg 
Views:	14 
Size:	95.7 KB 
ID:	23169Click image for larger version. 

Name:	04.jpg 
Views:	20 
Size:	119.6 KB 
ID:	23167Click image for larger version. 

Name:	03.jpg 
Views:	20 
Size:	175.2 KB 
ID:	23168Click image for larger version. 

Name:	05.jpg 
Views:	17 
Size:	143.8 KB 
ID:	23166

  13. #13
    Senior Member
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    194
    Are you going to be selling them? I would be interested.

  14. #14
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,447
    Quote Originally Posted by BriComp View Post
    Are you going to be selling them? I would be interested.
    No, this would hardly be economical :-). However, If you want, I can put the design files on GitHub so you can order/make them yourself. Board cost (JLPCB) where EUR12 for 10pcs including shipment and customs handling. USB connectors were about
    EUR 1.50 each in single quantities.

  15. #15
    Senior Member
    Join Date
    Jan 2014
    Posts
    181
    I am very interested in these design files as I need high current for other components through the USB-C yet want to program the Teensy through usb-c D+, D-.

    thank you very much,

    Richard

  16. #16
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,447

  17. #17
    Senior Member
    Join Date
    Jan 2014
    Posts
    181
    thank you. I will dive in.

    Richard

Posting Permissions

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