4
\$\begingroup\$

Should the ground return path of this microcontroller be forced through the bypass capacitor gnd pin like in the first picture, or will it be better off left floating in the (green) GND plane like in the second picture?

guided non-guided

EDIT:

That big ugly far away bypass capacitor: I am quite bad at hand soldering SMDs and this is what is going to happen for this board... and already ordered my parts... and, it is only going to run at 1 MHz and 3.3V... Still seems like a poor choice ? I just need it to make the board work reasonably well for hobby level.

regarding SMD closer placement vs THT cap placement - it is not clear to me what the THT spacing should be. The IPC2211a standard is talking about

  • some 0.13 mm clearance in table 6.1 on page 43: first row, column A6
  • 0.75 mm clearance in section "8.1.8 Clearances" on page 58

I went on the safe side with 0.75, but maybe I misunderstood and it is 0.13 Care to comment on that ? Maybe make it an answer for this qeustion

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Can you show more of the PCB layout, such as where the VDD trace runs? Why not widen that Cap_VDD trace, to reduce inductance? \$\endgroup\$ Mar 16, 2017 at 11:44

2 Answers 2

9
\$\begingroup\$

It's not clear what the "bypass capacitor" is. I see two thru-hole pads plus some of the microcontroller pads. I can only assume that these two pads are for the bypass capacitor, although that otherwise makes little sense.

First, use a SMD bypass cap! I can't even guess what you were thinking, but using a thru-hole bypass cap is ridiculous here. SMD caps will have less series inductance. They are smaller and can be placed closer to the micro. Their connections are already on the same plane as the micro's pins, so they simplify routing by not taking space in other layers. As a bonus, they are easier to solder by hand, cheaper to install with automated manufacturing, and cheaper to purchase.

To answer your question, neither layout is great because they are encumbered with the thru-hole cap, but the top concept is somewhat better. Even better would be for the ground from the cap to be connected directly to the GND pin right under the power pin, not back to the local ground star point.

Keep the bypass currents local and the loops small.

I see you are getting some bad advice in other answers. No, do not run the bypass cap return current across the ground plane.

Think of the microcontroller as a high frequency current source between power and ground. The bypass cap is the shunt for those high power currents. It keeps the local power supply voltage steady despite the noise current. It must be connected with short leads to do its job well.

However, you want to keep those high frequency noise currents off the ground plane. In your bottom layout, your ground plane is now a center-fed patch antenna.

Here is a snippet of a recent layout I did:

The 44 pin QFP device near the middle is a microcontroller. It has three pairs of power and main ground pins. These are bypassed by C19, C20, and C26. This is a four layer board, with all but the ground plane in layer 3 shown. The three ground pins are tied together on the top (red) layer in the middle under the micro. That point is tied to the main ground by the double thru-hole pads labeled SH3.

The SHx devices are what I call "shorts". These constructs are just connections on the circuit board, but allow each side of the connection to be a different net in Eagle. This guarantees a single connection point between the local microcontroller ground net and the main ground, and allows me to explicitly place where that connection point is.

C21 (above the micro) bypasses the analog power and ground. Again the bypass cap is immediately between the two power and ground pins. However, in this case the analog ground pin is connected to the main ground with a via immediately at the pin. This is because that pin is used as the analog reference voltage for the A/D. The bypass current still flows in a small local loop between the two pins and C21, but the analog ground pin gets a clean ground connection. In this case, I also filtered the analog power thru the chip inductor L5.

The power connections can be a bit more circuitous when you practice good bypassing. The 3.3 V power is the fat traces connecting to C20 (bottom), C19 (left), and L5 (top). C26 (right) doesn't connect to power. It is on the Vcap pin to stabilize the internal voltage regulator in the micro.

Note that the crystal connections are also grounded to the local net. The crystal is Y1 (left), and its filter and load caps are C24 and C25. The ground of these caps go back to the local microcontroller ground, not the main ground. To keep it from radiating, you don't want the MHz crystal signals running across the main ground.

For reference, here is a snippet of the schematic showing this microcontroller and its power, ground, and crystal connections:

The point is to give the local loop currents good and short loops to flow over, and to keep these currents off the main ground. The main power and ground currents should only be the total power and ground current going into and out of the subsystem.

The ground return currents from the digital signals going into and out of the micro to elsewhere will run across the main ground. That's what it's for. That will cause some radiation from the ground plane, but a lot less than if the local currents were to excite it as a patch antenna.

I go into more detail about this at https://electronics.stackexchange.com/a/15143/4512.

\$\endgroup\$
6
  • 3
    \$\begingroup\$ Non-45° tracks! How dare you! My OCD is killing me here. \$\endgroup\$
    – pipe
    Mar 16, 2017 at 13:01
  • \$\begingroup\$ @pipe :-) You can see the difference between the auto-routed tracks and the manually routed ones. The auto-router does adhere to angles that are multiples of 45 deg. For example, see the two vertical red tracks going up to vias at top right. I wouldn't have routed them that way, but they weren't worth routing manually. The local ground and the crystal connections are worth routing manually. The auto-router then can route other traces around them later. \$\endgroup\$ Mar 16, 2017 at 13:10
  • \$\begingroup\$ I thought Olin would do it manually. Autobots for the win! \$\endgroup\$
    – ammar.cma
    Mar 16, 2017 at 13:53
  • 2
    \$\begingroup\$ That looks wrong to me... Patch antennas work against the ground plane, not as part of it, the usual gotcha being a copper island above a plane with a single via tie and something to excite it. For jellybean microcontroller stuff strapping things to the plane as directly as possible is IMHO usually the correct design, there are exceptions but you know them if you are dealing with them. \$\endgroup\$
    – Dan Mills
    Mar 16, 2017 at 14:31
  • \$\begingroup\$ Oh, hello Olin :) I got some edit if you feel like addressing them \$\endgroup\$
    – kellogs
    Mar 16, 2017 at 16:13
2
\$\begingroup\$

Every ground pin of the IC should go directly to the ground plane as in the second picture. They should not be isolated, bundled together, and grounded to some random remote point on the ground plane through a long inductive trace as in your first picture.

Whether the bypass capacitor is in the right place is another matter. It also seems to have a very long trace leading off to (presumably) the IC's power pin. Through hole bypass capacitors do not offer the lowest bypass impedance, SMD types are better. If you're worried about your layout, fix the capacitor issues, the IC is just fine with the ground pins grounded.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ I very rarely downvote a competing answer, but in this case I really strongly disagree with your advice. \$\endgroup\$ Mar 16, 2017 at 12:22
  • \$\begingroup\$ Having read your answer, I think we're saying the same thing. But, the subject is too complex for a short answer like mine. It's too complex for a long answer like yours. The thrust of my advice is that messing up the IC's grounding for some random bypass cap's position is the tail wagging the dog. The only way to do it is to understand the issues, and then engineer rationally. I stand by my short, incomplete, answer as a useful addition. Have you found out what his IC is yet, what speed it runs at, analogue or digital, and perhaps most important, what other devices are around it? \$\endgroup\$
    – Neil_UK
    Mar 16, 2017 at 14:04
  • \$\begingroup\$ He says it's a microcontroller. If it was handling RF or GHz signals, then the ground strategy would be different, and more specific to the particular project. The big thing I don't like about your answer is running the bypass cap return currents across the main ground plane, and deliberately avoiding a local ground net. If you feel you must downvote my answer, I certainly understand. \$\endgroup\$ Mar 16, 2017 at 14:18
  • 3
    \$\begingroup\$ Upvoted, because this fits for what works for getting things thru EMC test for me. Unless you are doing precision very low frequency stuff, a single common ground plane is usually the way to fly, the path of lowest impedance will tend to very strongly minimise the loop areas without you having to do anything. Bypass cap return currents HAVE to get back to the bypass cap, the plane is the lowest inductance way for them to do it. If I was building a 24 bit precision DC measurement set, the answer might (MIGHT!) be different, but direct connection to a solid plane is right 90+% of the time IMHO. \$\endgroup\$
    – Dan Mills
    Mar 16, 2017 at 14:24
  • \$\begingroup\$ @OlinLathrop I didn't, and I don't intend to downvote you, where do you get that idea from? \$\endgroup\$
    – Neil_UK
    Mar 16, 2017 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.