.model file similar to standard.mos


 

Is it possible to create your own user file that contains .model components statements (i.e. user.mos) where you can place a mosfet from a symbol you created "nmos_user.asy" and then from that symbol you can right click on it and select a mosfet from the "users.mos" file.  I know you can go into the standard.* files and add components to those but would like to setup separate files if possible.  Been searching the web and have not seen anything specific whether this is possible or not.  If there is information out there I would appreciate someone pointing me to the link.


 

On Mon, Nov 25, 2024 at 11:36 AM, <larry.gunseor@...> wrote:
Is it possible to create your own user file that contains .model components statements (i.e. user.mos) where you can place a mosfet from a symbol you created "nmos_user.asy" and then from that symbol you can right click on it and select a mosfet from the "users.mos" file.
LTspice lets you create a special kind of symbol that can select from a sub-menu of parts.  But they use .SUBCKT models instead of .MODEL models.  That should not be an obstacle, because it is easy to create .SUBCKTs from .MODELS (but not the other way around).
 
Read the LTspice Help page for Schematic Capture > Editing Components > Super Expert Mode (a.k.a. General Attribute Editor).  Scroll down until you find the words, "The third exception", and read from there to the end.  Your symbol should have at least these:
  • Prefix = X,
  • A ModelFile attribute to your library model file,
  • A SpiceModel attribute, set to the name of one of the model file's subcircuits.
Then each of the models in the library file must be a subcircuit.  Each one might look like this (for an N-channel MOSFET with a Substrate pin):
 
.SUBCKT abcd1234 D G S B
MN D G S B 1234abcd
.MODEL 1234abcd NMOS (...)
.ENDS abcd1234
 
Each .SUBCKT would have one .MODEL line.
 
I recommend copying LTspice's NMOS.asy or NMOS4.asy symbol (and their PMOS counterparts), and editing your copies for your use.  Start with the NMOS4 symbol if your MOSFETs have a Substrate pin.  If they don't, then copy the NMOS symbol instead, and remove the "B" node from two places in the .SUBCKT definition (above).
 
There might be other ways too.
 
Andy
 


 

An alternative is to make your own standard.mos file for new parts, which you put into your user-defined Library Search Path in the LTspice Control Panel (Settings).  It is my understanding that, when done correctly, LTspice will include both its own "standard.mos" file and your own "standard.mos" models, when referencing MOSFETs that are defined with .MODEL statements.
 
Mixing .MODEL and .SUBCKT models has always been a problem.  You can use both, but they don't merge in the library and you must select between one or the other.
 
Andy
 
 


 

On 25/11/2024 18:04, Andy I via groups.io wrote:
Each .SUBCKT would have one .MODEL line.
 
I recommend copying LTspice's NMOS.asy or NMOS4.asy symbol (and their PMOS counterparts), and editing your copies for your use.  Start with the NMOS4 symbol if your MOSFETs have a Substrate pin.  If they don't, then copy the NMOS symbol instead, and remove the "B" node from two places in the .SUBCKT definition (above).
The other issue for this approach, is that there is no easy way of incorporating both NMOS and PMOS models in the same library. Only the built-in method using standard.mos has a filter that distinguishes between the two, based on the nchan (default) or pchan parameters. One would have to use two separate symbols and two separate library files.

--
Regards,
Tony


 

On Mon, Nov 25, 2024 at 09:35 AM, Tony Casey wrote:
On 25/11/2024 18:04, Andy I via groups.io wrote:
Each .SUBCKT would have one .MODEL line.
 
I recommend copying LTspice's NMOS.asy or NMOS4.asy symbol (and their PMOS counterparts), and editing your copies for your use.  Start with the NMOS4 symbol if your MOSFETs have a Substrate pin.  If they don't, then copy the NMOS symbol instead, and remove the "B" node from two places in the .SUBCKT definition (above).
The other issue for this approach, is that there is no easy way of incorporating both NMOS and PMOS models in the same library. Only the built-in method using standard.mos has a filter that distinguishes between the two, based on the nchan (default) or pchan parameters. One would have to use two separate symbols and two separate library files.

--
Regards,
Tony
Hi Tony
 
I don't understand what you wrote, could you explain a little more please?
 
 


 

On 25/11/2024 19:46, eetech00 via groups.io wrote:
The other issue for this approach, is that there is no easy way of incorporating both NMOS and PMOS models in the same library. Only the built-in method using standard.mos has a filter that distinguishes between the two, based on the nchan (default) or pchan parameters. One would have to use two separate symbols and two separate library files.

--
Regards,
Tony
Hi Tony
 
I don't understand what you wrote, could you explain a little more please?
I'll try.

If the custom NMOS or PMOS symbols still refer to .models, i.e. the Prefix attributes remains "MN" or "MP", LTspice will still open standard.mos regardless of whether the ModelFile attribute has a value, or what it is. Only by making the Prefix attribute "X" will the ModelFile attribute be accepted, i.e. a custom drop-down model selector can only be a .subckt.

In the former case of the Prefix being "MN" or "MP", LTspice can readily filter the standard.mos contents into N-channel or P-channel devices by using the "nchan" or "pchan" model parameters, thus facilitating the use of only one standard.mos file for both types of devices. There is no means of identifying types of (MOSFET) device from a .subckt. Therefore, two library files are required for myNOS and myPMOS symbols because there is no other means of distinguishing between them.

Hope that helps.

--
Regards,
Tony


 

Oh....you were referring to mosfets and use of the mosfet "pick list".
 
Thanks Tony..