Eventually in most hobbyists’ path, one will end up working with high speed signals. These days so many microcontrollers support USB and even ones that don’t can use software USB. Of course using a microcontroller is the answer to every engineering problem, right? Most of us just work with USB 2.0 connected directly to a microcontroller for uploading and serial communications. With advent of the USB Tester, I have learned more about USB than I ever thought I would. Recently I have dived into USB 3. Which compared to 2.0, is so much more sensitive to your PCB routing as I found through trial and error. I have seen many projects on the various blogs and for sale on the usual sites that don’t follow or even try to route correctly. With USB 2.0 for the most part you can get away with it and it will still work. To help save you some time, I would like to share my findings that should help prevent PCB re-spins just due to USB not working. This is by no means an exhaustive guide to high speed routing as there are plenty of application notes across the web for that. I will list a few at the end of this post that I found helpful.
- Branching is when the traces are not direct from one point to another and have a split.
- Stubs is if the signal hits a via with a pin in it from the top layer instead of the bottom layer to from a straight path.
- Calculate trace width and spacing to maintain 90Ohm differential (Calculator) This will also depend on the PCB you will be using. In my case OSHPark lists the specs of their PCB.
- Maintain trace length of each pair. CAD tools have a differential pair routing tool along with meander to adjust traces for matching. A better way is to add a little length on the end of the short trace before connecting to your pad instead of having to meander which will affect the 90Ohm differential target. It can take a bit of time though to get it just right.
- Use as few vias as possible as they affect signal integrity.
- Route using 45degree angles instead of 90. I think this is to avoid reflections.
- Avoid stubs by using a via before routing to a through hole part so you are on the bottom layer.
- As much as possible, route above/below a continuous ground plane. On 2 layers boards this is pretty much impossible. With USB 3 it really should be a 4+ layer board.
- Signals should be on the outer layers.
- As always use the shortest path possible. (The Wozinack way ;))
- Another one that may be hard to do is don’t cross signals above or below another signal. Ideally there should be a ground plane there anyway.
- One way to avoid inverted pairs having to cross over each other is to mirror a part but then you have to deal with parts on both sides which may or may not be an issue for you. You should check with your assembly house if going that route. I have been able to reflow boards twice in this case. Surface tension usually keeps parts them from falling off.
- Remember that higher speed signals travel along the skin of the copper so surface area is your friend and reduces impedance and attenuation on the signal. (More info)
- Type-C cable only has 1 pair of differential pairs for USB 2.0 on the A side of the connector. B is unconnected. So I believe that means you should tie A and B together or maybe there is a mux IC for USB 2.0.
|Eagle CAD Differential Trace Settings
|Eagle CAD Length Settings
There is a minimum error in length but I always try to get it 100% matched.
Links I found during my research:
http://www.xmultiple.com/xwebsite-forum-USB-TypeC.htm (Good one with cable wiring)
http://www.belden.com/blog/broadcastav/understanding-skin-effect-and-frequency.cfm (Skin Effect)
http://www.appfruits.com/2015/03/building-your-own-custom-teensy/ (Links to calc)