@Christe4nM indeed! I owe you (and a few others on this thread) a beer.
Thanks, you're welcome. I really like these PCB layout topics. Thinking along and reading other replies really helps understanding this stuff. Fellow forum member free_electron also has posted great posts about several of these topics. That is how I started to learn. Note that I’m still learning. I’m currently working my way through ‘EMC and the printed circuit board’ by Mark I Montrose. So my mind is trying to digest all this stuff anyway.
Re rerouting for ground return path: In the app notes about proper grounding it usually says to avoid noisy return paths to go through sensitive areas. The other way around, sensitive return paths going through noisy areas (like arguably in my design) I didn't see mentioned.
It all comes down to preventing the coupling of noise into the sensitive traces. Routing a sensitive trace under or right next to noisy stuff is in essence the same as putting a noisy trace through a sensitive area. The latter can be compared to the proverbial elephant in a china shop. But you don’t want to stack your china right next to a happily jumping around elephant’s paddock either
The LDO being at the other end of the PCB makes it tricky to route a separate radio GND path without major detours for some return paths, e.g. the radio/MCU signal lines. In my next layout I could move the LDO to the left, between MCU and radio. Is that the right approach?
There isn’t just one ‘right’ approach as I’m afraid. There are some common steps to guide you though. As you’ll see a layout is almost always a tradeoff between certain best practices. Certainly on a 2 layer board you just cannot help but having to make a compromise here and there. It will help though to take a moment to think it over first.
Even then, I did a over-engineered conceptual 4 layer layout for a very simple, really simple, USB to UART board. I went through several revision before I got the board out. I learned from that, that sometimes it’s just as hard to distinguish what is actually important in your current design as it is to understand all matters that might be going on. That being able to distinguish comes from experience and practice. Something I’m still trying hard to gain anyway
OK on to the practical tips.
- If your board shape is known, spend some time with paper and pencil to determine which sub-circuits are to be placed where. Draw important signal(busses) too. See Robert Feranec’s video on PCB layout planning for an example of what I mean. (Sorry no link provided since I didn't want it embedded in my post. Just search for "pcb layout planning" on YT) This planning beforehand helps in simple circuits as well as for really complex circuits.
- Connector placement is usually predetermined, so those go as very first. Make sure that after placement of all connectors each cable plug can still fit even if all other connectors are plugged as well. This is a trap as the cable plugs are usually quite a bit broader than the actual connector on the PCB. Placing those connectors to close together could mean that you can't have everything connected at the same time...
- This pre-planning is also where you already think a bit about how/where to place the power rails.
- Since high frequency stuff is the most noisy you want to place and route those components and traces first and keep them as short as possible. I.e. crystals, clock traces, and signals needing a specific controlled characteristic impedance.
- Same goes for communication buses: usually they are busy, higher frequency digital and thus inherent more ‘noisy’. Personally I even try to route them without via’s in the trace, except for possible one very close to the pin of the ICs involved. This is more personal preference and certainly not always possible, but for very high frequency stuff via inductance might play a role. I’m still learning too, so let’s just keep this as my personal preference for now.
- Those higher frequency traces are best if routed above a ground plane / pour. That pour has to be connected to the gnd pins of the IC’s at both ends of course since it will most probably contain the return current. This is because for high frequency the return current seeks the route of lowest inductance. This is actually right beneath the trace. For low frequency this does not apply as those currents seek the path of lowest resistance back to the source. In case of a pcb that is usually the shortest path as resistance increases per length unit.
- As said: keep decoupling caps as close to the pins as possible. Larger, bulk caps can be placed further away.
- Optionally you can rotate the MCU by 45 deg. To make accessing the pins a little easier along the sides of the board. Do whatever works best for you.
- Where you place the LDO is a tough one. It doesn’t need to be that close to any IC as the local decoupling caps will keep the line ‘clean’. I personally would say that the SPI bus from the MSP430 to the RF IC gets priority in routing. What if you push the USB D+ and D- all the way ‘down’? That means they get a bit longer, but also out of the way of the other stuff. You now have an area between the MCU at the left, the USB connector at the right, the USB signal traces at the bottom and the 100mil header at the top. This could be your LDO’s new home?
Your power rail has to cross the width of the PCB one time or another anyway as the MSP430 has its VCC on the ‘top’ as I interpret the layout, and the RF IC on the ‘bottom’. As you have communication buses on both sides of the MCU I think that going under the MCU itself is basically the least worst option. I'd go on the bottom side though and make sure that there is a return path for the current.
Or try both your own idea and mine. See what works best and let us know.
- Semi-Final note. I see that you have a small stub of ground pour between the USB signal traces. That one is best removed as it can pick op noise. If you have other 'stubs', it's good practice to put a via to a ground plane (if available) at the end.
- Final note regarding the USB connector shield and ground tie: that USB to UART board I mentioned was to gain an understanding of EMI, and ESD protection. I made a topic about that in the past, but still have to reply with the final board layout. I'll have to come back to that.
edit: typos