← Back to team overview

kicad-developers team mailing list archive

Re: [RFC] Symbols and Pin mapping in v6 - Proposal

 

Hello all,

I saw this discussion and joined this mailing list to share how I 
currently deal with generic (group of parts, e.g. n-channel MOSFET) vs 
atomic components (a specific part with specific pin mapping).

I created a schematic symbols library with symbols for components which 
come in various different packages, such as transistors or op-amps. All 
of these are saved in the library as generic symbols, i.e. their pins 
have names, but no numbers assigned. Often when designing a circuit I do 
not yet have a specific part in mind, so I just drop in one of these 
generic symbols for the moment. For example, I know that I need a MOSFET 
in some place, but I have not decided which one to use yet and would 
like to move on with the schematic before that.

Later, when I have decided which part I would like to use, I create a 
new field in the symbol properties, where I enter the pin mapping for 
this part (e.g. for a MOSFET the assignment would be something like "G>1 
S>2 D>3"). I wrote a Python script which then creates a new symbol 
library in the project's directory and in this library it places a copy 
of the generic symbol with the pin numbers corresponding to the mapping 
specified in the symbol properties. A description of the pin mapping is 
appended to the name of the symbol, so the pin-assigned version of our 
MOSFET would be called something like "MOSFET#G_1_S_2_D_3". So in the 
end, the library created by the script contains multiple copies of the 
generic symbol, one for each pin configuration found in the schematic, 
which are atomic versions of the generic symbol in the first library. 
The script also changes the library references of the symbols in the 
schematic to the corresponding atomic version in the new library.

An additional advantage of this setup is that, if later on I decide that 
I want to replace one part with another with a different pin mapping, I 
do not need to replace the symbol in the schematic. Instead, I simply 
change the pin assignment in the symbol properties and rerun the script, 
which generates an atomic version for the new pin assignment and changes 
the library reference of the part in the schematic accordingly.

The script uses the KiCad library utils ( 
https://github.com/KiCad/kicad-library-utils/ ) to read the schematic 
and symbol libraries. In case someone is interested I am happy to share 
the script.

Having the pin mappings in the symbol properties avoids to maintain a 
separate file with pin assignments and using a script which creates 
atomic versions of generic parts avoids the need to maintain a library 
with hundreds of different parts which are very similar and mainly 
differ in their pin mappings. Maybe such a functionality could be 
directly integrated into KiCad in the future, though I have to admit 
that I do not know what the current plans for version 6 are.

Best,
Michael


References