- Hey everybody. Thanks for tuning in. I'm Zach Peterson. I'm a technical consultant with Altium. And today we're gonna
talk a little bit more about routing high-speed
on a two-layer board, and specifically, we're gonna
look at an example with USB. USB is a real simple
protocol to work with. It has a real simple layout, has some pretty simple routing rules. And so we're gonna look
at all that stuff today. Let's get into it. (lively rhythm music) So in the previous video where we looked at high-speed
routing on a two-layer board and some of the initial considerations that you need to think about as you're preparing
your high-speed routing on the two-layer board, we looked at a specific example that involved a 500 picosecond
rise time digital signal and what its critical length should be. What we found was that, in
a pretty conservative limit, we found that a half-inch
critical length was about the longest trace
length you should have before you need to start worrying about controlled impedance. Why I looked at that specific example because that is the rise time
in the USB 2.0 specification for the high-speed generation. And so that's the example
that we wanna look at today. What we're gonna do is,
we're gonna do a few things. First, how do you even design
the traces to make sure that you have controlled impedance? Where's your host gonna go, or your host processor,
I should say, gonna go? What does the routing topology look like? And then, how do you actually
get to that impedance target? Generally, if you're gonna do
a board where you have to have something like USB, you've probably got your
host processor right here. Maybe it's an MCU with a USB interface. And somewhere on the edge, you've got your connector. And so you have to route somewhere on the board in order to get your traces from the MCU over to the connector. Generally, if you're gonna do this, the best way to orient the MCU is so that the USB
interface is on this side, facing the connector. This is actually one of
those really basic things about layout with high-speed devices, is you should lay out or
orient the devices such that, you know, if you got USB
interfaces on this side of the component, you put
the USB stuff over here. And maybe you've got like DDR or something over on this side of the component. The DDR stuff should go over
here, and so on and so forth. And so you're gonna have to
get the traces over to here. So you've got a D+ and a D- signal. So these are the two sides
of your differential pair that is going to carry
your signal or your data over here to the connector. Now, there's also a ground connection. And then there's also a power connection. And all four of these are gonna feed over a standard USB cable that uses USB 2.0. That will eventually be
received at the other device, which is your peripheral device. And that device is then going to receive all four of these signals. These are gonna get routed
into the peripheral device and then get read out. And then the peripheral
is gonna do its thing. So here, the first challenge is, we have some impedance, Z
zero and Zd, differential. So we have a characteristic/odd impedance. Remember from our previous discussion on differential impedance, that we don't actually care about the characteristic impedance. We really care about the odd impedance. That's the impedance of
just this individual trace. And then we have a differential impedance. Usually when I start
discussing this with people, people bring up, "Well, you know, you only care about the odd impedance and that's what you have to design to." And, I mean, technically they are correct, in this case with USB. The differential impedance is essentially like a mathematical shortcut
to the odd impedance. So if you're using your
Layer Stack Manager in Altium Designer, maybe you're using another program to determine the differential impedance and to design the spacing and the width, this is usually what
you're gonna design to, is the differential impedance spec. And then you can use that, divided by two. That gives you your odd impedance spec. So what's actually
happening with this route? Remember, you have a connector. Connected to this connector is a cable and the cable has some defined impedance. We're just gonna call it Z sub c. And you need to have some matching between the trace impedance and then the connector
plus the cable impedance. And then same thing down here at this end where your peripheral is. Eventually, this will
then need to also match to the connector and then the trace is going into whatever the peripheral controller is. So that's everything that's going on along this entire route. And now your job as the
PCB designer is to design to the odd or differential
mode specification, as well as to include some
pull-up or pull-down resistors, depending on the generation of USB 2.0 that you're working with. So the pull-up and pull-down
resistors need to be placed based on which generation of
USB 2.0 you're working with. So here, so far, where we're talking about
500 picosecond rise time, we're dealing with the
high-speed specification. There are two other specifications. There's also low speed, which has the lowest
rise time and data rate. And then there's also a full speed, which has kind of a midrange
rise time and data rate. So here with full speed, the specification is 4 to 20
nanoseconds for the rise time. So immediately what you should see here is that for high speed versus full speed, it's gonna be a lot easier
to design this whole thing and violate these impedance constraints if you're only designing
to the full speed spec versus the high speed spec. So another important point that we kind of alluded
to in the previous video when we were talking about sizing traces so that they can work on a two-layer board is how wide do they need to be? How much spacing do you need
between differential pairs? What board thickness are you working with? So that's another important point. And there was actually a question on the previous YouTube
video on high-speed routing on the two-layer board and we're gonna look at that right now. Christopher Matthews writes, "Haven't stopped to do the
trace width calculation, but using an 8 millimeter
thick 2 layer board would make the trace
widths more manageable? Surely this would be better than the usual 1.6 millimeter board." So Christopher is exactly right. It is easier to work with traces that are on
a .8 millimeter board or a 1 millimeter board than it is to work with the
full 1.6 millimeter board. So I brought up the 1.6 millimeters because it is kind of the
standard PCB thickness that you'll generally work with. However, there are standard stackups and material compositions, and everything, that are on a .8 or a 1 millimeter board. So that's one of those things, if you're gonna do this type of system where you're doing high-speed
routing on a two-layer board, just talk to your fabricator. Ask them what thicknesses they can do. If you wanna do this on
a 1 millimeter board, you totally can. So here's how this is
gonna affect the impedance. So if you remember from
the previous video, when we're looking at our stackup, what we said we wanted to do
was put ground plane down here, or at least, you know, ground pour that spans
underneath the trace far enough. And then we've got our trace up here. So what we found was that if this is something like 1.6 millimeter height, or about 62 mils, I'll work in mils. Here we found that this
trace width was like, you know, 105 or 110 mils, depending on the Dk-value
of your dielectric. If you just wanna start
putting a single trace up here as part of your USB route
on a 62-mil thick board above a ground plane, this is really wide. That's 1/10 of an inch. So
how do we overcome that? We can't just take the board, and I'll draw out the top for you here, and have our MCU here and then
route one of these things up like this and then the other
one over around like this. And then, you know, eventually get to our connector and then expect everything to work. Because we're gonna have a
bunch of impedance mismatches along this route. Let's just say, this is
gonna be a 10-mil wide trace. This is actually gonna be
a really high impedance. And then same thing over here. We'd have really high
impedance for this trace. And so if we wanted to work
with the high-speed spec, we'd have a big impedance
mismatch here at this connector. And so as a result, we'd
have a lot of reflections, and it's unlikely that
the channel would work. This would ideally be our odd impedance instead of the characteristic impedance. So remember, this is the value for a
characteristic impedance of 50 ohms. Now, what we actually need to do is, we need to do a differential
impedance of 90 ohms. So this is the spec that we wanna meet. Now, if we had a differential
impedance of 90 ohms, and we try to design the odd
mode impedance to be 45 ohms, in this arrangement, where we just have a single
trace routing along by itself as part of the differential pair, what would happen? Well, it would still
be a really big trace. So this isn't gonna work. So we've got two options
here to try and figure out how we're gonna route our board. Either we need to fill
in everything with ground so that we create some
parasitic capacitance that then lowers the
impedance of this trace for a given width, and then we would do
the same thing over here and the same thing everywhere else. So we try and create a
coplanar arrangement, but this is really messy. In this case, what we should do, and what I would recommend you do, is you instead route the
traces very close together because this coupling between
them is now going to cause the trace width that you need
to hit a Z odd of 45 ohms, as well as a Z differential of 90 ohms to be much more manageable. So it's gonna be somewhere in the neighborhood of
about 15-mil trace width with about a 5 mil spacing. And so that's basically how
you're gonna have to size your traces, is to bring
them close together and allow the natural coupling between your parasitic capacitance and their mutual inductance
to lower the impedance and therefore cause you to
actually hit the impedance spec with a manageable trace width. So this essentially
just comes from the fact that when I bring in another trace, they start to couple to each other through the electric field. All right, so if this is my ground region below my two traces and I
bring in trace number one, as soon as I bring in trace number two, the two traces are going to have some electric field coupling between them. So this is just the electric field. This is basically my plus
side. This is my minus side. So that means this is my D+
line. This is my D- line. And it's this coupling between them that is going to really
dominate the determination of impedance. So because this ground
plane is so far away, there's actually gonna
be really weak coupling to the ground plane. And so that's why if I take this trace and I move it really far away, meaning it practically
doesn't exist from the view of this trace, this trace will then
have very high impedance because I have very
weak coupling back here to the ground plane. You're actually gonna have
most of your coupling over here to this D- line. And that explains why we need to actually have the
two either close together or we just need to fill
in a bunch of ground around these two. And so now what I wanna do before we actually finish
designing the rest of this route, is actually show you an
example in Altium Designer that shows that you can
actually do either of these. You can do the two traces close together or you can put them close together and bring in some external ground pour. And if you bring in some
external ground pour, that's also going to modify
the trace width that you need in order to hit the
differential impedance spec. So let's go ahead and
look at that right now. So the first thing I wanna do to try and figure out the trace impedance that we're gonna need, is I just wanna use Altium Designer to create a impedance profile. Now, that impedance profile
is what's gonna allow us to actually set a design rule
based on what we calculate for the impedance. So it's gonna enforce the trace spacing and it's gonna enforce the trace width. So what I'm gonna do is just open up the Layer Stack Manager. So first things first, you'll see the default
dielectric thickness for a two-layer PCB is only 12.6 mils. Let's just for the moment make it 62 mils. And actually we would
wanna make it about 60 mils since we have one ounce
copper weight here. So let's just go ahead
and make it 60 mils. That makes our overall board size just a little over 63 mils. So that's fine. So we've
got a 60-mil thickness. And what I wanna do is go
down here to the very bottom and click on the impedance profile tab. And I'm just gonna add
an impedance profile. And so immediately what
you can see here is, to hit a 50-ohm impedance, you would have 105.5-mil wide traces. So huge traces. Obviously, as I mentioned before,
we don't really want that. So there are a couple of
ways to approach this. And so first what I
wanna do is go over here to the Atmel USB Design Guidelines. I think this is one of
those starting points that a lot of people use to start looking at
high-speed USB trace routing and trace design. And so what they're telling you to do is to determine the width, such that you get a individual
trace impedance of 50 ohms. You can see they have a
typo here in their document. They've written "50W." They actually meant to write 50 with the omega symbol, so 50 ohms. And then get the S-value so that you get a differential
impedance of 90 ohms. The reality is that the
50-ohm single-ended portion only matters if you're gonna
actually route everything as a single-ended trace. So that's really important. So remember, earlier, when I said, when we were looking at the whiteboard, that if you wanna route
a single-ended trace, you have to fill in a bunch of ground in order to get to a
manageable trace width, to get to a 50-ohm trace, that's essentially what
you would have to do. Frankly, in this case it's a lot easier to just keep the lines close. And then what you're gonna have is, you won't actually have a 50-ohm trace, you'll have a 45-ohm trace due to the coupling
between the two traces. So let's just look really
quick at what would happen if instead of just having a individual trace, routed over ground with nothing around it, so no ground pour on the signal layer, what would happen if we change
this to a single coplanar, okay, and we enforce five-mil clearance? So what we immediately see is now the width is a lot more manageable, it's actually 20.256 mils, pretty good. Let's say we went down to
a one-millimeter board. So we had 38-mil thickness and we're just slightly
over one millimeter on this core thickness. Even then, we only get
down to a 19.458-mil width on our traces, okay? So it barely changed at all,
like practically nothing. Let me just switch back to
a 62-mil board real quick. So just for comparison. I mean, it was like about a
mil change in the trace width that you needed. So in this case, you would have
to get the board really thin in order to start seeing an
effect from the ground plane on the actual trace width that you're gonna need in routing, assuming you're working with
the high-speed classification. The other option, if you
look here where my mouse is, you'd have to change the clearance. But at five mils, you're already getting close
to the required clearance that you need to maintain in order to ensure manufacturability. So just to kind of make the point, I could go down to one mil, but no one's gonna be able to manufacturer down to one mil clearance. That will unfortunately be so small that the device would short. Three mil clearance, that's
really right at the edge. And you can see you get down
to about 10 1/2 mil wide trace. So hopefully that kinda
illustrates the point here that, you know, even just
with ground on the top layer trying to hit to a
differential impedance spec, even with just ground on the top layer, you're still gonna have really wide traces when you're on a two-layer board. So this is why it's gonna be better to just do it as a differential
pair on a two-layer board and bring the traces closer together because you're gonna get thinner traces. They're gonna be easier to work with. Then once you go a step further and add the ground in around
the differential traces, now you're gonna get them even smaller and they're gonna be even more manageable, but they're not gonna be so small that you can't manufacture them. So let's look at that right now. So what I'm gonna do is I'm gonna add in another impedance profile, I'm just gonna set it up as a differential impedance profile. And setting it up as a
differential impedance profile with a target of 90 ohms, we can see right here that
the width is 15.967 mils. So that that's even more manageable. We went from 20 down to 16 mils. And this is still with a nice,
easy trace gap of five mils, pretty standard. So now what happens if
I add in the ground pour around my differential route? Well, now if I've turned this into a differential coplanar line. What I'm doing is I'm
now adding in some ground around the two traces and it has an enforced
clearance of five mil and then we have an enforced
trace gap of five mils. And now you can see the width
gets down to 9.467 mils. That's really nice. Okay? So that's our 10-mil wide trace. That's a really nice,
easy trace to work with. It's not too big. It's not too small. Pretty much every
manufacturer on the planet is gonna be able to
fabricate that reliably, as well as the five-mil
gap around your traces. So this is a really good
way to route the board. And it's essentially what you'll see if you look at a lot of
microcontroller boards that are done on two layers. They take the two traces, they bring them close together so that it sets the
differential impedance. Then they pour in the ground around it. Pouring in the ground around is gonna set that differential impedance
to a smaller value for a smaller trace and that's what's going to allow you to really have a manageable route here in this type of board. So the last thing that we
wanna look at here is just what happens with the topology. So I mentioned before we have some pull-up and pull-down resistors. So that's what we're looking at right here is just those pull-down resistors for the high-speed topology. You'll notice here we have a Type A and we have a Type B
connector in this link. And then you can see where the series and the pull-up resistors are located. So these series resistors
may or may not be needed, just make sure you check the data sheets for your components, but these different resistors
for pull-up or pull-down, depending on your generation
of USB are gonna be specified in the standard. So again, just make sure to
review that in your data sheets, and you'll see a good guide on what you need to do to make sure that you can hit the differential
impedance requirements, as well as balancing the need for those pull-up or pull-down resistors. So these series resistors here, R, those can be 22 ohms, 45 ohms. They can be different values. It just depends on the output
impedance from the host and the peripheral controller interface. Again, data sheets will tell
you what you should use. Just make sure to check that. From here you should have
everything that you need to be able to build your schematics and then import all your
components into your PCB layout. And then once you create
this impedance profile and enforce it as a
design rule on those nets for your USB link, you're ready
to go, just start routing. Hopefully this shows
you what you need to do in order to start
designing a USB 2.0 channel to run at full speed on a two-layer board. Now, hopefully the takeaway
you might have noticed is this: It's actually gonna be easier to do it on a four-layer board, but you can certainly do
it on a two-layer board if you design your routes correctly. Make sure that you don't forget those pull-up or pull-down resistors depending on the generation
of USB you're working with. That's gonna determine that whether or not the device can actually detect that another device is
plugged into the connector and then the route can actually
start operating properly. All right everybody. If you liked this video,
hit that like button, hit that subscribe button, leave your questions and comments as always in the comments section. We love getting your questions and we will do our best to hit those in our next Q&A session, which we have coming up very soon. All right, everybody. Thanks for watching. And don't forget to call your fabricator.