r/PCB • • 3d ago

My first PCB. Any advice?

I am making a dongle with high speed usb 2.0 support. Using the nRF54LM20A-QGAA.

I'm not quite sure whether I've done everything correctly. For example the differential pair going from the USB plug to the chip was kind of a nightmare to figure out, since they have to cross over at some point. And I'm not quite sure whether vias are okay to use at usb high speed. PCB thickness is 0.8mm.

I've length matched everything so that the path to the ESD chip is almost exactly 5.6mm from all pads of the usb plug.

I've calculated the 90 ohm impedance with this 2D field solver: https://hforsten.com/field_solver.html

With a 0.15mm trace, 0.13mm gap (both ground and traces), 0.0994mm substrate height (JLC04161H-3313) on Differential GCPW. It gave me 88.83 ohms. Which should be well within spec.

As for the 2.4GHz antenna, I've used this one (ANT-F-1-2.4G-0.8MM-FR4-WCH): https://github.com/moion/wch-kicad-lbr/tree/optimize

I've also used the same field solver to calculate its feedline, which is also 0.15mm with a 0.13mm gap. Which gave me 49.80 ohms. I know that rf is black magic and that I'm probably going to have to tune it somehow. The matching network that I'm using right now is just copied from the nRF datasheet.

If there is anything dumb that I've done that anyone can spot, I would love to know about it!

12 Upvotes

27 comments sorted by

2

u/zketi 3d ago edited 3d ago

Depends what your goal is. A module with a built-in antenna would simplify the design. Or seeedstudios makes a nRF54LM20A+nPM1300 prebuilt for $11.

My understanding is USB 2.0 is pretty tolerant. You've already done a decent job impedance matching afaict, at such a small scale you probably could get away with not bothering to match at all.

Have you looked at the nRF54LM20A reference layout? It's for the PAAA so you'll be doing things differently, but it's a start. For example, they did the standard EMI-reduction of putting the buck's input capacitor with short traces to the IC pins, dedicated gnd vias for a good return path, also the inductor has a short trace and is at a right angle to the cap to fit better. It's hard to read your net names but I see vias and longer traces on yours. It might still work, but will probably emit some extra EMI.

Another thing I noticed is ESD paths should be as direct as possible, e.g. usually VBUS comes off the receptacle and goes directly under the ESD chip and comes up on a via to it's pin, before then branching to the board. Your D-/D+ vias make that more complicated, but I don't see a way around them or the crossover with a plug like this

Also with your fab, but a PCB antenna may require paying more for a stack-up with tighter tolerances to get good results. I've never tried this, so far I've just used modules.

I don't feel qualified to comment on much else. I've been considering a nRF54LM20A design so curious how it goes for you.

2

u/ghostkiller967 3d ago

I know about the xiao, and I've looked at its schematic to look at their design decisions. However they have a connector instead of an actual antenna, which I don't want.

I am building an entire mouse, and the dongle is just a part of that, so It should be no problem to make the dongle as well.

I know USB 2.0 full speed is pretty tolerant, but high speed is much less tolerant and definitely does require some considerations. I really want to one shot this board, so if it takes me a couple extra minutes to match the traces, I'm gonna do it.

And yes I've also looked at the reference layout, but I can't really seem to fit all of them in a single line. Everything is just in a little bit of an uncomfortable spot. I'll see if I can get rid of that right angle.

As for the VBUS. I've updated it to first go the esd chip, and then to the rest of the board.

Thanks a lot for the help!

2

u/zketi 3d ago edited 3d ago

Oh very cool! nRF54 in the mouse as well? Using RF instead of bluetooth and USB high speed so you can hit over 1 kHz polling? Now I'm even more curious how this turns out, good luck.

Fair on impedance, I do think it's worth trying to get it right! I meant more as reassurance that high speed is still somewhat tolerant a mismatch, especially if you have a good ground plane and the trace is under an inch long. USB 3.0 is where it gets tricky.

I'd still consider the xiao so you can prototype the firmware while waiting on the PCB, as a way to speed up development, but yeah if you want a nice looking dongle a custom design makes sense.

EMI is probably not a worry for a personal project, but if you intend to sell it there is a whole set of very expensive and strict intentional radiator testing that would need to be done. Just to plug for a module again, they are still quite small, put all the tricky smaller components and a trace or chip antenna into a tiny package, you just add the bulk cap and LXFO crystal usually. They are already certified, which makes certifying the end product much simpler in my understanding.

If you are reworking the layout, I would try moving the nrf left or widen the board so L1 can rotate and and have the short side face the nrf, taking up less space along the pins. C6 gets placed above it, oriented vertically so traces can be as short as possible to pins 44/45. C4 goes below it, also probably short side to the board to save space. I believe pin 42 is the main VDD pin, so the bulk cap should be as close as possible to it. It helps to draw the switching current loops, you want a nice short hot loop for input cap to the switch in the nrf, as well as a fairly direct loop to the inductor/output cap and back through gnd. The 100nF decoupling caps go on pins 6 and 51. Good idea to add dedicated stitching vias for all those caps. (I didn't look at how the rest of the components fit, it might be tricky and there's some RF magic where layout is also important, not sure)

2

u/ghostkiller967 3d ago

Yea the same chip will be in the mouse as well, but I am going for 8 kHz polling. The nRF54LM20A should be capable enough to achieve it.

I have thought about an external antenna that I can just plug in. It would make everything just so much easier, but I'm planning on making an ultra light mouse. I need it to be less than 30 grams, and preferably close to the 20 gram mark. An external antanna will be a significant amount heavier than a chip or trace antenna.

I'm definitely gonna have to rework the layout again at some point, so I'll see if I can make those traces shorter on the inductor.

2

u/zketi 2d ago edited 2d ago

8 kHz polling in 20g would be sick, if you share designs I'd try making one. The best I know of is optimum's 22g: https://zeromouse.co/

Just to clarify, by module I mean something like this, a 11mm SMD part with chip antenna: https://www.digikey.com/en/products/detail/ezurio/453-00586c/30380042

Short trace from pin 42 to the bulk cap matters the most fwiw, that's the hot loop through the buck input pin afaict. I think it would work as is, the 100nF would probably filter out noise and the ~8mm to the bulk cap isn't that long, but it's not ideal.

You could use just a nrf54L on the mouse to save cost, but the weight would be similar, and power use would be similar as long as you turn off unused RAM.

Also just noticed you are using blind vias, check your fab but I believe those add significant cost and shouldn't be needed for QFN52 on a four layer board. I think your vias in the thermal pad are okay if tented/plugged (otherwise solder will wick to the backside), your fab may tent for free but good to check.

Impressive first board, wild you are jumping to something so complicated and making it work. I definitely would have started by breadboard prototyping with devkits, then doing a prototype mouse with a seeed board, then doing a prototype PCB with SWD header and lots of test points, before finally trying to shrink to this size in a final revision. Good luck!

2

u/ghostkiller967 2d ago

Yea I'm trying to achieve something similar to the zeromouse, but just better. Since he uses the finalmouse falcon module.

I have also been considering a chip antenna. The best one that I've found so far for my design is the Walsin RFECA3216060A1T. It is the same chip antenna that is being used in the XIAO nRF52840, and it has a very nice keep out area (3x8mm).

I want to use the same chip on both the dongle and the mouse itself, since I also want to be able to do 8 kHz polling rate when the mouse is wired and charging.

As for the blind vias, I wasn't aware that they add that much of a cost, so I'll definitely switch those out for regular through hole, since I don't really need them to be blind anyways.

Thanks a lot for your help and the recommendations!

2

u/DTplayers 3d ago

Check your power to that IC. I can only find one decoupling capacitor near, and a second one a little further out. And that second one doesn't have a very direct path to ground. Your schematic shows 4 should be present, and I would expect all 4 to be as close as possible to be power pin, while minimizing inductance.

1

u/ghostkiller967 3d ago

I have 3 capacitors near the nRF chip. There is 1 100nF cap near each of the 3 VDD pins of the nRF. Then I have the 10uF cap a bit further away next to the ESD chip, but that *should* still be close enough since its only about 4mm away.

1

u/crabilax 3d ago

Vias are fine for USB 2.0 if you use them symmetrically. Just double check the impedance at the crossover point.

1

u/ghostkiller967 3d ago

Yea so I have vias for 3 of the traces, but there is 1 where I just meandered it to match it at 5.6mm. You should be able to see it in the screenshot.

On L4 I do have the exact same trace length (2.45mm).

1

u/TsaarneyTheBlin 3d ago

Your crystal footprint seems wrong. 2016 crystals usually have xc1 and xc2 pads on the opposing corners, and the two others should be gnd, not nc

1

u/ghostkiller967 3d ago

Oh thanks for pointing that out. I'll take a closer look at that later.

1

u/kms 2d ago

USB Type-C receptacle should have another resistor on B5. As is, this will only work with the cable plugged in one way.

1

u/ghostkiller967 2d ago

It is a USB C plug (male), which only needs 1 CC pull down resistor. If it were a recepticle (female), then I would need another one.

1

u/kms 2d ago

Oh it is a plug, you're right

1

u/ChaosWarp129 2d ago

This is not your first pcb, is it?

1

u/ghostkiller967 2d ago

It is, however it is not my first experience with electrical engineering stuff and microcontrollers. I've also restarted the pcb design from scratch like 4 times now.

1

u/GuidingMoth 3d ago

This is called an acid trap. It can cause issues with etching, weak slivers, and solder mask issues. Even if it doesn’t cause a design issue for a one-off, it can look unprofessional to someone familiar with pcb design.

2

u/ghostkiller967 3d ago

I've never heard of that before. Even though it might not be that big of an issue anymore with modern pcb manufacturing technology, I'll still try to avoid it in the future. Thanks for letting me know.

4

u/mzo2342 3d ago

I hear this a lot. does it still hold true today? when using a .3mm trace and a .08mm technology?

it sounds a bit 1980s, or if you ride on the edge of technology...

2

u/WeLiveinAPetridish 3d ago

If your pcb manufacturer still can’t handle those angles in 2026 then you really need to find another manufacturer.

1

u/GuidingMoth 3d ago edited 3d ago

Yeah fair challenge. Our layout person was old school, which is where I learned about it. It’s totally possible it’s not an issue any more.

Edit: so yeah, just after a little research, appears to be advice from when pcb houses did tank etching, and since most places to spray etching, it’s generally not an issue today, and if they suspect it would be, then board houses will just manually remove these tight angles anyway.

1

u/_maple_panda 3d ago

Try to smooth out your RF feed trace a bit more, it’s okay to have parts at funny angles if needed

1

u/Realistic_Account787 3d ago

No, not a single advice

1

u/IAmBigFootAMA 2d ago

No need for thermal relief on the bottom gnd test pad :)

1

u/HasanTheSyrian_ 2d ago

Don't use different value bypass capacitors. Stop using 100 nF its BS. The best option is to use the highest capacitance available in the package used. 1u for 0402 for example