qfn_thermal_and_power_fanout module#

Thermal vias in a QFN’s exposed pad, and power pins fanned out to a plane.

The part is the RP2040 from jitxexamples.components.mcus: a 56-lead, 0.4 mm pitch QFN whose 3.1 mm square exposed pad is its only ground pin. The board is a 4-layer substrate: parts and fanout on layer 0, a ground plane on layer 1 and a 3.3 V plane on layer 2.

Thermal vias#

thermal_via_grid() places the largest grid of vias that fits the exposed pad with its vias at least THERMAL_VIA_PITCH (1.1 mm) apart and each via pad’s rim edge_margin inside the pad’s copper. The default margin is the substrate’s min_soldermask_bridge plus its solder_mask_registration: each via is tented by a soldermask dam that reaches solder_mask_registration past its pad, so the dam ends one mask bridge inside the pad edge and meets the mask frame there. On the RP2040’s pad with this substrate’s ThermalVia, that is a 2 by 2 grid at a 2.036 mm pitch.

ThermalVia is the smallest via on the substrate’s floors: a 0.254 mm drill, the min_drill_diameter, in a 0.56 mm pad, which leaves a 0.153 mm annular ring against the 0.1524 mm min_annular_ring. The smallest via leaves the most of the pad open for paste.

The function refuses a via class whose via_in_pad is False and a pitch below min_stitch_pitch (the larger of one via pad and one drill plus min_hole_to_hole). JITX accepts a via inside a pad whose via class disallows it without raising a design issue, so the check lives here. ThermalVia sits inside a pad, so it declares via_in_pad = True; confirm with your fabricator that tented, unfilled vias inside a pad are accepted.

thermal_pad_opening() builds the soldermask and paste opening: the pad less a frame one mask bridge wide, a web one mask bridge wide along each row and column of vias, and a dam around each via, with every corner of what is left rounded to half of min_soldermask_opening. The rounding drops any part of a cell narrower than min_soldermask_opening: here the four corner cells, where each via’s dam meets the frame, so 5 cells remain. The same shape is the pad’s soldermask and its paste (thermal_pad_config()), so solder lands only in those cells and cannot wick down an open via barrel. StitchedRP2040 passes that config to the landpattern’s thermal_pad before the RP2040 maps its pads, and the circuit places a ThermalVia at each grid position on the ground net.

The paste covers 5.32 of the pad’s 9.61 square millimetres, 55 percent, where the unstitched RP2040 pastes the whole pad. Check that against your assembler’s stencil guidance for an exposed pad. The pitch sets the tradeoff: a larger THERMAL_VIA_PITCH gives fewer vias, so fewer paths for heat into the planes, and more paste; a smaller one gives the reverse.

Power fanout#

The six IOVDD pins fan out to the 3.3 V plane, each through three pieces of copper, on the rules layout_qfn_escape teaches:

  1. An escape from the pad to a RoutePoint 1.0 mm past the pad’s outer edge. Its width is derive_escape() read from the landpattern: 0.13 mm on these 0.15 mm pads, narrower than the pad so it never comes closer to a neighbouring pad than the pads are to each other. A QfnEscapeTag on each escape Route and a priority-4 rule on that tag set the width.

  2. A trunk from the RoutePoint to a fanout via, at POWER_WIDTH (0.8 mm) from the priority-2 rule on the net’s PowerTag. Both rules match the escape, and the higher priority wins there.

  3. The fanout via, a PowerVia with a 1.0 mm pad, wider than the trunk, through every layer. On layer 2 it sits inside the 3.3 V pour and joins it.

The fanout vias are where a designer would choose to drop to the plane, so designer_placed_fanout_points() returns them in a function of its own: a designer would place them in the physical design view instead, and they are written here so the example is complete.

Each plane is held by vias of its own net inside it, the thermal vias for the ground plane and the fanout vias for the 3.3 V plane. A pour with no pad or via of its own net inside it comes back empty.

All copper and mask stay at or above the substrate’s FabricationConstraints: the escapes are 0.13 mm against a 0.127 mm min_copper_width, both via classes meet min_drill_diameter and min_annular_ring, the thermal via drills sit 1.782 mm apart against a 0.254 mm min_hole_to_hole, every mask web is min_soldermask_bridge wide, and every part of the opening is at least min_soldermask_opening across.

The test, tests/test_qfn_thermal_and_power_fanout.py, checks the grid, the opening and the escape width offline. With JITX_PATTERN_RUNTIME=1 and a runtime started at the project root, it builds the design and measures the realized escapes, trunks and planes.

THERMAL_VIA_PITCH = 1.1#

The smallest centre-to-centre spacing of the thermal vias, in mm.

FANOUT_RUN = 1.5#

From an escape’s RoutePoint to its fanout via’s centre, in mm.

GROUND_PLANE_LAYER = 1#

The ground plane’s layer, under the parts.

POWER_PLANE_LAYER = 2#

The 3.3 V plane’s layer.

PLANE = Polygon(elements=((8.0, 8.0), (-8.0, 8.0), (-8.0, -8.0), (8.0, -8.0)), holes=())#

The outline of both planes, centred on the RP2040, in mm.

DAM_SEGMENTS = 24#

Segments per quarter circle of each via’s mask dam and corner rounding.

class FanoutSubstrate(*args, **kwargs)[source]#

Bases: Substrate

Four copper layers with the sample fabrication constraints, a via allowed inside a pad, and a power via.

stackup: Stackup = SampleStackup(4)#
constraints: FabricationConstraints = <jitx.sample.SampleFabConstraints object>#
class ThermalVia(*args, **kwargs)[source]#

Bases: Via

A through via allowed inside a pad: 0.56 mm pad, 0.254 mm drill.

start_layer: int = 0#

Starting layer for the via. Setting this to a layer index other than the top layer allows for creating buried or blind vias.

stop_layer: int = -1#

Ending layer for the via.

diameter: float | ViaDiameter = 0.56#

Pad diameter of the via, in mm. Can be overridden on a per-layer basis by diameters.

hole_diameter: float = 0.254#

Drilled or laser-cut hole diameter for the via, in mm.

type: ClassVar[ViaType] = 1#

MechanicalDrill or LaserDrill.

Type:

Type of via drilling method

via_in_pad: bool = True#

Whether the via is allowed to be placed inside a component’s pads.

class PowerVia(*args, **kwargs)[source]#

Bases: Via

A through via for the fanout: 1.0 mm pad, 0.5 mm drill.

start_layer: int = 0#

Starting layer for the via. Setting this to a layer index other than the top layer allows for creating buried or blind vias.

stop_layer: int = -1#

Ending layer for the via.

diameter: float | ViaDiameter = 1.0#

Pad diameter of the via, in mm. Can be overridden on a per-layer basis by diameters.

hole_diameter: float = 0.5#

Drilled or laser-cut hole diameter for the via, in mm.

type: ClassVar[ViaType] = 1#

MechanicalDrill or LaserDrill.

Type:

Type of via drilling method

via_pad_diameter(via)[source]#

The via’s pad diameter, from a plain diameter or a ViaDiameter.

Return type:

float

Parameters:

via (type[Via])

default_edge_margin(fab)[source]#

Via pad rim to exposed-pad edge: one mask bridge plus the mask registration, so each via’s dam ends one bridge inside the pad edge.

Return type:

float

Parameters:

fab (FabricationConstraints)

thermal_via_grid(pad_size, via, fab, *, pitch, edge_margin=None)[source]#

Thermal via centres for an exposed pad, in the pad’s own frame.

Along each axis the grid holds as many vias as fit with centres at least pitch apart and each via pad’s rim edge_margin inside the pad edge (default_edge_margin() when None), spread evenly over that span and centred on the pad. Rows run along x, bottom row first.

Raises ValueError when via does not allow a via in a pad (JITX does not report one), when pitch is below min_stitch_pitch(), and when the pad has no room for one via.

Return type:

list[tuple[float, float]]

Parameters:
thermal_pad_opening(pad_size, positions, via, fab)[source]#

The soldermask and paste opening of a stitched exposed pad.

The pad, in its own frame, less a frame min_soldermask_bridge wide along its edge, a web of the same width along each row and column of positions, and a dam around each via that reaches solder_mask_registration past its pad. Every corner of what is left is rounded to half of min_soldermask_opening, which drops any part narrower than min_soldermask_opening. Raises ValueError when nothing of the pad is left open.

Return type:

Shape

Parameters:
thermal_pad_config(pad_size, positions, via, fab)[source]#

An SMDPadConfig whose soldermask and paste are both thermal_pad_opening().

Return type:

SMDPadConfig

Parameters:
pad_bounds(pad)[source]#

The pad copper’s bounds in its landpattern’s frame.

Return type:

tuple[float, float, float, float]

Parameters:

pad (Pad)

class StitchedRP2040(via, fab, pitch)[source]#

Bases: RP2040Component

The RP2040 with thermal vias in its exposed pad.

thermal_via_positions are the via centres in the landpattern’s frame; the circuit that places the part places a via at each.

Parameters:
designer_placed_fanout_points(escapes)[source]#

Where each power pin’s trunk drops to the plane: one fanout via per escape, FANOUT_RUN straight out past its RoutePoint.

A designer would place these interactively, where the board has room for each via; they are written here so the example is complete.

Return type:

list[tuple[float, float]]

Parameters:

escapes (Sequence[Escape])

class QfnThermalAndPowerFanout[source]#

Bases: Circuit

The stitched RP2040, its ground plane, and its six IOVDD pins fanned out to the 3.3 V plane.

transitions: list[RoutePoint]#
fanout_vias: list[PowerVia]#
escape_routes: list[Route]#
trunks: list[Route]#
class qfn_thermal_and_power_fanout_design(*args, **kwargs)[source]#

Bases: Design

The stitched, fanned-out RP2040 on the 4-layer substrate.

board: Board = SampleBoard()#
substrate: Substrate = FanoutSubstrate()#
circuit: Circuit = QfnThermalAndPowerFanout()#