bga module#

The BGA Landpattern Generator#

BGA (Ball Grid Array) packages use an array of solder balls on the bottom surface instead of peripheral leads. This module provides generators for creating BGA landpatterns with customizable grid configurations.

The BGA landpattern has three entry points:

  • BGA: Complete generator with BGA-style alphanumeric numbering (row letters from A, columns from 1, e.g. .A[1], .B[3])

  • BGADecorated: With silkscreen but no numbering scheme

  • BGABase: Basic pads only

Constructor Parameters:

num_rows: Number of rows in the ball grid (vertical) num_cols: Number of columns in the ball grid (horizontal) ball_diameter: Copper land diameter from the PCB design guidelines, not the drawn ball (see BGABase) pitch: Center-to-center spacing between balls (typical: 0.4-1.27mm)

>>> from jitx import Component, Port
>>> from jitx.landpattern import PadMapping
>>> from jitxlib.landpatterns.generators.bga import BGA
>>> from jitxlib.landpatterns.pads import SMDPadConfig
>>>
>>> class MyBGA(Component):
...     # 3x3 BGA, rows A to C, columns 1 to 3
...     balls = [[Port() for _ in range(3)] for _ in range(3)]
...     def __init__(self):
...         self.landpattern = BGA(
...             num_rows=3,
...             num_cols=3,
...             ball_diameter=0.4,  # copper land diameter
...             pitch=0.8,
...         ).pad_config(SMDPadConfig())
...         rows = (self.landpattern.A, self.landpattern.B, self.landpattern.C)
...         self.mapping = PadMapping(
...             {self.balls[r][c]: rows[r][c + 1] for r in range(3) for c in range(3)}
...         )

Note

BGA packages require careful PCB design for routing escape paths. Consider via-in-pad or dog-bone patterns for dense arrays.

class BGABase(num_rows, num_cols, ball_diameter, pitch)[source]#

Bases: GridPlannerMixin, GridPadShapeGeneratorMixin, GridLandpatternGenerator

BGA Landpattern Generator Base

Pads only, on a regular rectangular grid centered on the origin, with no silkscreen, courtyard or numbering scheme.

Parameters:
class BGADecorated(*args, **kwargs)[source]#

Bases: SilkscreenOutline, Pad1Marker, ReferenceDesignatorMixin, ExcessCourtyard, BGABase

Decorated BGA Landpattern Generator, with no pad numbering scheme.

Adds a silkscreen outline, a pad 1 marker, a reference designator and a courtyard to BGABase. Subclass it to build a package whose balls are not all on one regular grid (a second pitch in one region, offset ball groups, a staggered or split grid): override _generate_layout to yield one GridPosition per ball, then compose a numbering scheme in front of the subclass the same way BGA does. row and column in each position are the zero-indexed indices the numbering uses, and pose places the ball. Row 0 is lettered A and is the top row, at the largest y, so compute y as (center_row - r) * pitch as BGABase does. Any .grid_planner(...) is still applied to the yielded positions.

>>> class StaggeredLayout(BGADecorated):
...     # Odd rows shifted right by half a pitch.
...     def _generate_layout(self) -> Iterable[GridPosition]:
...         pitch = 1.0
...         center_row = (self._num_rows - 1) / 2.0
...         center_col = (self._num_cols - 1) / 2.0
...         for r in range(self._num_rows):
...             y = (center_row - r) * pitch
...             shift = pitch / 2 if r % 2 else 0.0
...             for c in range(self._num_cols):
...                 x = (c - center_col) * pitch + shift
...                 yield GridPosition(r, c, Transform.translate(x, y))
>>> class StaggeredBGA(A1, AlphaDictNumbering, StaggeredLayout):
...     pass
>>> lp = StaggeredBGA(num_rows=4, num_cols=4, pitch=1.0, ball_diameter=0.5).pad_config(
...     SMDPadConfig()
... )
class BGA(*args, **kwargs)[source]#

Bases: A1, AlphaDictNumbering, BGADecorated

BGA Landpattern Generator

A regular ball grid with BGA-style pad names. Rows are lettered from A at the top (largest y) and columns are numbered from 1 at the left, so pads are reached as lp.A[1] or lp.B[12]. Row letters skip I, O, Q, S, X and Z and continue with two letters after Y; see AlphaDictNumbering.

The constructor takes num_rows, num_cols, ball_diameter and pitch (see BGABase); ball_diameter is the copper land diameter, not the solder ball. Everything else is set by chaining:

  • .pad_config(SMDPadConfig()) is required; the generator has no default pad configuration.

  • .grid_planner(...) removes depopulated positions; see GridPlanner. Without a planner every grid position gets a pad.

  • .package_body(RectanglePackage(...)) is optional; when set, the courtyard covers the body as well as the pads.

For balls off a single regular grid, subclass BGADecorated and override _generate_layout.

>>> class MyBGA(Component):
...     def __init__(self):
...         self.landpattern = (
...             BGA(num_rows=12, num_cols=12, pitch=0.5, ball_diameter=0.25)
...             .pad_config(SMDPadConfig())
...             .grid_planner(PerimeterGridPlanner(3))
...             .package_body(
...                 RectanglePackage(
...                     width=Toleranced.exact(7.0),
...                     length=Toleranced.exact(7.0),
...                     height=Toleranced.min_max(0.8, 1.0),
...                 )
...             )
...         )