Pin Properties
We created pin-properties to make it easy to quickly model a component from a datasheet, capture the pin assignment, and create a box symbol. pin-properties generates the usual low-level JITX statements for symbols, pin creation, and pin assignment.
Example of Modeling a Component
#use-added-syntax(jitx)
defpackage mygenerator :
import core
import collections
import box-symbol
pcb-component mycomponent :
;Each row has format:
pin-properties :
[pin:Ref | pads:Int ... ]
[a | 1 ]
[b | 2 ]
[c | 3 ]
[gnd | 4 5 6 7 8 ]
[d+ | 9 ]
[d- | 10 ]
;Make a generic box symbol for the pins
make-box-symbol()
;Assign the given land pattern the pad associations
;in the table.
assign-landpattern(mylandpattern)
Note that when the pad name is given as a raw integer, i
, then it is assumed that the full pad name is p[i]
in the land pattern definition.
Assigning a Direction in the Box Symbol
pcb-component mycomponent :
;Each row has format:
pin-properties :
[pin:Ref | pads:Int ... | side:Dir ]
[a | 1 | Left ]
[b | 2 | Left ]
[c | 3 | Left ]
[gnd | 4 5 6 7 8 | Down ]
[d+ | 9 | Right ]
[d- | 10 | Right ]
;Make a generic box symbol for the pins
make-box-symbol()
;Assign the given land pattern the pad associations
;in the table.
assign-landpattern(mylandpattern)
Programmatic Tables
The tables can be generated programmatically:
pcb-component mycomponent :
;Each row has format:
; [pin name | pad numbers ... | side]
pin-properties :
[pin:Ref | pads:Int ... | side:Dir ]
for i in 0 to 10 do :
[A[i] | i, i + 20 | Left]
;Make a generic box symbol for the pins
make-box-symbol()
;Assign the given land pattern the pad associations
;in the table.
assign-landpattern(mylandpattern)
Working with Land Patterns with Named Pads
pcb-component mycomponent :
;Each row has format:
; [pin name | pad name ... | side]
pin-properties :
[pin:Ref | pads:Ref ... | side:Dir ]
[a | A[1] | Left ]
[b | A[2] | Left ]
[c | A[3] | Left ]
[gnd | C[0] C[1] C[2] | Down ]
[d+ | B[1] | Right ]
[d- | B[10] | Right ]
;Make a generic box symbol for the pins
make-box-symbol()
;Assign the given land pattern the pad associations
;in the table.
assign-landpattern(mylandpattern)
Multi-bank Box Symbols
Use a fourth column to indicate the bank. The bank can either be given as an integer:
pcb-component mycomponent :
pin-properties :
[pin:Ref | pads:Ref ... | side:Dir | bank:Int]
[a | A[1] | Left | 0 ]
[b | A[2] | Left | 0 ]
[c | A[3] | Left | 0 ]
[gnd | C[0] C[1] C[2] | Down | 1 ]
[d+ | B[1] | Right | 1 ]
[d- | B[10] | Right | 1 ]
Or the bank can also be given as a Ref, which saves you the hassle of generating unique integers yourself.
pcb-component memory :
pin-properties :
[pin:Ref | pads:Ref ... | side:Dir | bank:Ref ]
[pwr | A[1] | Left | base ]
[gnd | B[1] | Down | base ]
[clk | C[1] | Left | base ]
[sig | A[2] | Right | base ]
[en | C[2] | Up | base ]
[data[0] | A[3] | Left | data-bank[0] ]
[data[1] | A[4] | Left | data-bank[0] ]
[data[2] | A[5] | Left | data-bank[0] ]
[data[3] | B[3] | Left | data-bank[0] ]
[data[4] | B[4] | Left | data-bank[0] ]
[data[5] | B[5] | Left | data-bank[0] ]
[data[6] | C[3] | Left | data-bank[1] ]
[data[7] | C[4] | Left | data-bank[1] ]
[data[8] | C[5] | Left | data-bank[1] ]
[data[9] | D[0] | Left | data-bank[1] ]
[data[10] | D[1] | Left | data-bank[1] ]
[data[11] | D[2] | Left | data-bank[1] ]