Castellated edge; plated half holes in board edge

image

This kind of edge where the board edge goes through plated holes and the holes are cut in the middle is called

  • castellation
  • castellated edge
  • plated half-holes
  • semi-plated holes
    etc.

It’s used in PCB modules which can be soldered to other PCB’s.

Castellation is made so that there are normal PTH pads first and they are surrounded by the board material. Then the board edge is milled or cut in some other way so that half of the holes are left. Cutting copper with milling bits is more costly, therefore castellation often costs more for you.


In general, there’s no special support for this in KiCad v5, nor in the Gerber X1 format. Gerber X2 has meta-information attributes, including CastellatedPad which is also supported in KiCad v7, but it isn’t universally supported by all manufacturers yet. The board manufacturers usually interpret certain kinds of gerbers as having castellation. Basically it needs nothing else than PTH pads – holes and some copper on and around them – on the board edge.

image

Castellation in KiCad 5.1 3D viewer which didn’t have any special support for castellation.

image

Castellation in KiCad 7.0 3D viewer which supports castellation.

You can do this easily if you ignore the DRC in KiCad – allow DRC violations while routing and just ignore the DRC check errors with tracks which go too close to the edge or exclude these violations. In the next post we will see how castellation can be made with KiCad so that it’s possible to route it without DRC problems and without ignoring DRC.


Here it’s important to notice that castellation isn’t cheap, so you may want to avoid it if possible. It easily multiplies the (small batch) board price by 5 or 10. Sometimes you can consider avoiding the cost by surrounding the hole with an extra piece of board which you cut off manually yourself (with reduced quality and chance of breaking the board, of course, but for cheap prototypes this could be acceptable).

IMPORTANT NOTE

Castellation is a matter of interpretation and manufacturing capabilities. Never trust generic advice blindly, always check what your manufacturer wants and is capable of doing. See for example what OSH Park says:

the castellated vias must be indicated with round pads for copper and stop mask. The pads must also not extend more than 40 mil from the board edge. Square pads or pads that extend far beyond the edge will be trimmed, and the via will not be plated.

Some manufacturers require checking Castellation option when you make the order or they don’t plate the holes.

Find also other technical requirements of your manufacturer. The minimum hole diameter may be e.g. 0.6 mm. Holes must have enough edge to edge clearance, but your pitch requirement comes more probably from other mechanical considerations – for example fitting for standard pin headers.

7 Likes

Routing with castellated pads

KiCad 7 supports castellation in pad properties:

Unfortunately this isn’t enough for many board manufacturers which don’t support or use all Gerber features. Existence of castellation should still be communicated to the manufacturer in their preferred way.

This property, however, helps with creating the layout. The on-the-fly DRC understands it and allows drawing a track on a castellated pad. Otherwise the board edge clearance prevents it.

Zones with castellated pads

Using zones is more complicated. A zone can cover the whole board and ideally it should fill into a castellated pad so that the board edge clearance doesn’t prevent it, but everywhere else it should obey the normal clearance rules. This is not possible automatically, at least in version 7.

The most simple solution is to leave the zone as it is and connect it to a castellated pad with a short track. This doesn’t have big cons and might be the easy recommended solution for all except the most perfectionist users.

If you still want automatic filling into a castellation you need custom design rules but there’s no way to make it behave perfectly in all possible cases. The closest you can get is probably combining a custom rules with certain kind of Edge.Cuts graphics.

  • First, use a footprint with castellated pads and draw a courtyard around it.
  • Second, add an edge line segment on top of it which goes through the castellated pads but not too much further.
  • Third, draw the rest of the edge so that it connects to the ends of the line which goes through the castellation.
  • Fourth, add a custom rule like this:
(rule castellation_with_zone
# J2 is an example reference designator of a castellated footprint.
# Another option is to use a named rule area in the footprint or in the board
# instead of courtyard and refdes.
(condition "A.intersectsCourtyard('J2') && A.Type=='Zone' && B.intersectsCourtyard('J2') && B.existsOnLayer('Edge.Cuts')")
(constraint edge_clearance(min -1mm))
)

The result looks like this:

The arrow shows where the Edge.Cuts lines are connected. The zone fills until the line which is inside the courtyard but avoids the line below it.

If you need to keep a zone edge away from the board edge inside the footprint area, you can modify the zone shape, add a keepout area or add graphics to the Margin layer which works like Edge.Cuts graphics for clearance:
image

3 Likes