Pad¶
pad statement defines an electrical connection point in a pcb-landpattern. A pad is an object that you can associate with a component pin.
Signature¶
pad <REF> : <DEF> at <POSE>
pad <REF> : <DEF> at <POSE> on <SIDE>
<REF>- The pad's ref name in thepcb-landpatterncontext. Common ref names arep[1],p[2], etc. Notice the index starting at one instead of zero.<DEF>- A reference to apcb-paddefinition. This will define the geometry and configuration of this specific pad in the land-pattern.<POSE>- APoseinstance that transforms thepcb-paddefinition into the appropriate location in thepcb-landpatternframe of reference.<SIDE>- ASideinstance ofTop|Bottomthat indicates whether this pad is located on the top or bottom side of the board. The default side if theon <SIDE>expression is not provided isTop.
Usage¶
The pad statement is used as part of a pcb-landpattern definition to define the electrical connection points between the PCB and a component. There are typically multiple pad statements in a pcb-landpattern definition.
Reference Examples¶
When defining the pad reference, we can use any dot notation or array indexing feature:
pad a : square-pad at loc(0.0, 0.0)
pad p[0] : smd-pad(0.5, 0.5) at loc(5.0, 0.0)
pad dp.P : pth-pad(0.5, 0.9) at loc(-2.0, 0.0)
pad dp.N : pth-pad(0.5, 0.9) at loc(2.0, 0.0)
The dot notation example dp.P and dp.N is particular useful when attempting to create a pcb-landpattern that interfaces to a diff-pair bundle component port. See pcb-component for more information.
Constructing Pads in Loops¶
We can use typical stanza for-loop constructions inside the pcb-landpattern to make it easier to build many pins:
val pdef = smd-pad(0.8, 0.3)
for i in 1 through num-pins do:
val pose = loc(to-double(i) * 1.27, 0.0)
pad p[i] : pdef at pose
Notice the use of 1 through num-pins as the sequence generator. If num-pins = 4 - then this will construct the sequence [1, 2, 3, 4] for a one-based index.
Using on <SIDE>¶
When constructing a board edge connector (like a PCIe card), we often need to place pads on both side of the board:
pcb-landpattern Card-Edge (num-pins:Int):
val pdef = smd-pad(0.4, 1.6)
val pitch = 1.2
for i in 1 through num-pins do:
pad A[i] : pdef at loc( to-double(i) * pitch, 0.0) on Top
pad B[i] : pdef at loc( to-double(i) * pitch, 0.0) on Bottom
Careful with Ref Names¶
It is an error to create two pads with the same reference. For example, this case:
pcb-landpattern diode-lp :
pad c : smd-pad(0.4, 0.75) at loc(-1.25, 0.0) on Top
pad a : smd-pad(0.4, 0.75) at loc(1.25, 0.0) on Top
pad a : smd-pad(0.4, 0.75) at loc(1.25, 2.0) on Top
Notice the duplicate a pad. This will throw an exception when the design is run:
Uncaught Exception: StmtTable adding duplicate record - key: a ...
Programmatically Generated Ref Names¶
Often times it can be useful to programmatically generate a ref name for a pad. To do this we need to use a special syntax to force the compiler to interpret a variable as a reference by value instead of a symbol:
val prefix = Ref("RP")
pad (prefix)[4] : bga-pad(1.0) at loc(1.0, 0.0)
This will construct a pad with ref RP[4]. Notice how in this case the prefix value is wrapped in parenthesis (). This forces the compiler to interpret the value of prefix as the reference. Compare this to the case where there is no ():
val prefix = Ref("RP")
pad prefix[4] : bga-pad(1.0) at loc(1.0, 0.0)
In this case the pad would have the literal reference name prefix[4].