USB-C Adapter

luni

Well-known member
Inspired by vjmuzik's thread https://forum.pjrc.com/threads/65633-T4-1-External-USB-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/en/appnotes/00001953a.pdf. The CC signals and GND/5V are available on the pin headers which will also provide mechanical stability.


schematic.jpg kicad_3d_1.jpgkicad_3d_2.jpgbreadboard1.jpgbreadboard2.jpg

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

datatracks.jpg

top.jpgbottom.jpg

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/4...e88da873fdf43474fa/e/86c68fc449c82f47aacdc46e
 
Last edited:
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?
 
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.
 
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
 
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.
 
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.
 
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?
 
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.
 
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.
 
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.
 
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
 
Back
Top