¿ªÔÆÌåÓý

Re: Creating My Own Library


 

Ivan,
?
There are a few ways to maybe make it easier to select from among your transistor .SUBCKT models.
?
RULE #1:? Forget about trying to select them by right-clicking on the transistor symbol and clicking "Pick New Transistor" or "Pick New MOSFET".? That works ONLY for .MODEL models, and NEVER for .SUBCKT models.? Don't try.
?
METHOD #1:? Make a new symbol for every transistor .SUBCKT model you have.? Take LTspice's transistor symbol (NMOS, BJT, whatever), copy it to your own directory, and then edit it.
?
You would need a unique symbol for every transistor .SUBCKT model you have.? If you have 350 transistor .SUBCKT models, you will need to make 350 unique symbols.? Tedious, but it works.? This is the way Linear Technology / Analog Devices does it with their IC models, and it explains why they have so many unique symbols (hundreds? thousands?) for their parts in the library, even though many of them are nearly identical to others.
?
Each symbol needs to have the Prefix attribute set to "X", and its ModelFile attribute value set to the filename of your model file that has all those .SUBCKT models.? Then put that file in a place where LTspice can find it (in one of your User-defined Library Search Path entries).? No fancy messing around with links is needed.
?
METHOD #2:? ?Make just one new symbol for each transistor type - one new NMOS symbol, one PMOS, one NPN, one PNP, etc.? Make each of those symbols "generic" in the sense that it has no part number, yet.? Set its Prefix value to X, and its ModelFile attribute value to the filename of your .SUBCKT models.? ?I recommend using just the filename.ext here, not the path, so there should be nothing before the filename.ext.? Then have that file in one of your User-defined Library Search Path entries.
?
But its Value attribute should be nondescript, such as "NPN" or "PMOS".
?
Now when you need one of your transistors, place that symbol on your schematic, and manually edit the Value to be the transistor you want.? The Value is the name next to the transistor, so just right-click on that text and change it.? For this to work,?you need to know in advance what is the model name you want.? You may need to open the model file periodically and check what models you have in it, and what are their names.
?
METHOD #3:? Use one of LTspice's slightly more obscure features for selecting models from library files.? It is documented in the Help pages but may be difficult to follow.
?
Again start by creating a copy of LTspice's transistor symbol.? Set it up with these attributes:
  • Prefix = X
  • SpiceModel = the name of ONE (any one) of the .SUBCKTs in your model file
  • ModelFile = the filename.ext of your .SUBCKT library file
  • Set the SpiceModel attribute so it is Visible ("X" in the "Vis." column)
Now when this symbol is added to a schematic, you can click on the name which opens up a drop-down list of ALL the .SUBCKT models inside your model library file.? Pick one.
?
Andy
?
?

Join [email protected] to automatically receive all group messages.