How to customize via spacing rules for individual layers?


Years ago, when Eagle was bought out by Autodesk, I tried to jump ship but Kicad didn’t have various features I desired or needed (such as curved traces). A couple of days ago I realized I have to switch to designing a 6-layer board and I really don’t want to spend the $$$ on Fusion 360 as I have no need for anything mechanical, the autorouter, etc. So, lo and behold, when I checked the options, I just found out that Kicad has just been refreshed with version 6.0. Boy, what a difference, and it even has curved traces :sunny: There are so many other things that are worlds apart from what Kicad was years ago. Kudos to the whole team. Great job. It took me literally just a day to start my design, including the generation of new symbols and footprints.

But I just hit the first bump in the road: I need to lay out a PCB with two BGAs with a ball pitch of 0.8 mm. The design rules from one manufacturer would enable me to define the vias that allow a track to barely scrape through two adjacent vias on the 0.8 mm grid on the front and back layers, not so on the inner layers though. Because of the tight routing resources, I really need the space between the vias for the extra tracks on the front and back layers.

It seems there is a way to define custom rules and I have seen the topic via-in-pad in this forum but I can’t find information on how to create custom rules. What I need is this:

Via hole: 0.1 mm
Via size: 0.40 mm on front and back layers, 0.45 mm on inner layers

Clearance on all layers is 0.125 mm, minimum track width is 0.125 mm.

Can someone steer me in the right direction so I can start writing proper custom design rules for that? Or is there even a kind soul that can show me the appropriate code for it?

Thanks a bunch in advance.

1 Like

What you describe is called “custom pad stacks” and unfortunately isn’t supported in KiCad yet (even in 6.0).

There is a partial step towards it that is in 6.0 and may help your application, though: removal of unconnected annular rings.

In the properties for a via you can select the annular ring behavior (see lower right):

The “Start, end, and connected layers” option will remove internal annular rings unless a trace exits the via on that layer, which may be what you want for BGA fanout.

The custom rule system will allow you to vary the clearance on different layers, but not the via pad size.

Thanks for your post. The problem is that I can’t just remove the entire annular ring. The vias are of fixed size on each individual layer.

KiCad can’t do this yet (a via with 0.4mm on one layer and 0.45mm on another layer) so you have to find another way to do the design that will work for your manufacturer. Removing the entire annular ring on some layers may be an option depending on your fanout, as may using a smaller clearance in some areas.

Is there a way to group shapes in KiCad? Could I define the smaller via size and merge it with circular, slightly larger shapes on the inner layers? I could use that group and copy it into the various places where I need them. I would have to assign nets to the copied groups though and I am not sure if that’s possible.

Maybe this post will help you figure out how to do what you want to do:

the whole thread is full of useful information about it.

So if I understand this correctly, what it boils down to is that I need to create a footprint that I place around my design. While I haven’t tried this out yet, I understand that’s a solution but seems very cumbersome to apply across my PCB.