Multi-unit components
For components that have a larger number of pins, it might be easier to split up the component into different units.
Defining multi-unit components
To split a component into different units, use the unit property within the create component command.
Multiple unit properties can be defined to create additional symbols in the circuit.
my_large_component = create component:
unit:
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
4: "D"
5: "E"
6: "F"
at my_large_component pin "A"
at my_large_component pin "D"
Selecting component unit
There is not need to specifically select a unit, when the component's pin is referenced, the corresponding unit will be automatically selected.
In this example below, when pin "E" is referenced, the correct unit (J1B) is used.
from std import *
gnd = dgnd()
my_large_component = create component:
unit:
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
4: "D"
5: "E"
6: "F"
at my_large_component pin "A"
wire right 200 to pin "D"
at my_large_component pin "E"
wire right 100 down 100
to gnd
This automatic selection of component units makes it easier to think it terms of the component itself rather than specific units.
Unit reference designator suffix
Each unit will have a alphabetical suffix that corresponds to the order that it is defined in the create component command.
In this example below, the first unit is assigned "J1A", the second defined unit is assigned "J1B" and the third defined unit is assigned "J1C".
my_large_component = create component:
unit:
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
7: "G"
8: "H"
9: "I"
unit:
pins:
4: "D"
5: "E"
6: "F"
at my_large_component pin "A"
at my_large_component pin "E"
at my_large_component pin "I"
Custom suffix
It is possible to overwrite the unit suffix by using the suffix property within the unit property.
my_large_component = create component:
unit:
suffix: "Z"
pins:
1: "A"
2: "B"
3: "C"
unit:
pins:
4: "D"
5: "E"
6: "F"
at my_large_component pin "A"
at my_large_component pin "D"
Unit properties
These properties determine the pins within the unit symbol and also how the unit pins are arranged.
| Name | Description |
|---|---|
pins | If a single number is specified, the number of pins will be automatically created. Otherwise, pins with the given ID and names will be generated. |
display | Specify the graphic to display as the symbol of the component. If unspecified, a default rectangular symbol is generated. |
arrange | If display is not specified, then the arrangement of pins must be specified. |
angle | Sets the default angle of the component's graphical symbol. Please refer to this page on how angles are specified. |
suffix | Sets a given refdes suffix to the given unit. |