In the previous articleLet's use LTspice-Let's make a circuit diagram into components, we introduced how to make the created circuit diagram into components (hierarchical). This time, I will introduce how to add a part model that is not in the existing parts library.


There may be times when you want to use parts that are not registered in the parts library for simulation. LTspice supports the basic SPICE syntax, so SPICE models supplied in common SPICE formats (such as Pspice) can basically be used as is. Also, semiconductor manufacturers provide SPICE models free of charge on their websites.
This time, we will add an analog devices op amp that is not registered in the library.

 

If you are just starting LTspice, we recommend that you look at the "basics" from the list below.

Let's use LTspice series list is here


Also, if you would like to see a video on how to write a basic circuit and how to execute it, there is an on-demand seminar that does not require you to enter personal information, so please take a look if you are interested. Detailed information about the seminar is also provided to those who fill in the questionnaire.

LTspice On-Demand Seminar - Function check with RC circuit -

Part models required for simulation

A part model consists of two files.

  1. SPICE model (.sub/.lib/.cir, etc.): Text format file that expresses electrical characteristics
  2. Schematic symbol (.asy): A representation of a shape on a circuit


There are several ways to add a component model, but this time we want to obtain the SPICE model from the Analog Devices website and use the already registered 5-pin schematic symbol “opamp2” as the schematic symbol. think.

Article header library 130421 pic01 1
Figure 1: Schematic symbol and SPICE model

As of December 20, 2018, over 500 op amp component models have been registered in the library. The registered op-amp component models are in the folder below, so please check the contents.

  • SPICE model: LTspiceXVII\lib\sub
  • Schematic symbol: LTspiceXVII\lib\sym\Opamps


* SPICE models of operational amplifiers are described in files such as ADI.lib. Since it is a text format, you can check the contents with Notepad etc.

Get the SPICE model

As soon as possible, I would like to obtain the SPICE model from the Analog Devices website. This time, we will proceed with "OP162", which is not registered in the library.

Please select "SPICEModels" from the OP162 product page and download. This time, I created a folder called "test_op162" on the desktop and stored the files in it.

Click here for the OP162 product page

Article header library 130421 pic02 1
Figure 2: SPICE model download

Since the downloaded "op162.cir" is a text file, it can be checked with an editor such as Notepad, and it can also be checked on LTspice.

The point to note here is that the character string "OP162" following ".SUBCKT" is the "part name (symbol name)" referenced in the circuit diagram. In addition, the part number of the node is the order of the pins connected to the outside, and in a 5-terminal structure, the order is "non-inverting input", "inverting input", "positive power supply", "negative power supply", and "output". I understand.

Article header library 130421 pic03 1
Figure 3: SPICE model of OP162

Associating a SPICE model with a schematic symbol

Now that the SPICE model is ready, let's associate it with the schematic symbol.

Launch LTspice, create a new file, and save it in the same folder as the downloaded SPICE model file. This time, we will use the schematic symbol of a 5-terminal operational amplifier that has already been registered in the library. Select “opamp2” in the “SelectComponent Symbol” dialog Box and place it on the schematic.

Article header library 130421 pic04 1
Figure 4: Component selection

Next, create a circuit diagram as shown in Figure 5, using an inverting amplifier with Gain=2 as an example. If you run the simulation as it is, you will get an error message "Unknown subcircuit ....." as shown below. This is because opamp2 is a schematic symbol and has been assigned an internal SPICE model. Therefore, it is necessary to associate the obtained SPICE model of OP162.

Article header library 130421 pic05 1
Figure 5: Circuit diagram of an inverting amplifier (Gain=2)

Right click on Opamp2 and a dialog Box will appear. Replace “Value” with the symbol name “op162” that was confirmed in the file earlier. Uppercase and lowercase letters are treated as the same in SPICE grammar. Therefore, there is no problem even if it is described as "OP162".

Article header library 130421 pic06 1
Figure 6: Change symbol name

Then select SPICEdirective and fill in “.include op162.cir“. .include is a SPICE instruction (syntax: include(.inc) <file name>) that reads a file. Please check the Help menu for details.

Article header library 130421 pic07 1
Figure 7: Loading the SPICE model with the .include directive

The schematic symbol and SPICE model are now associated. After that, when I ran the simulation, I was able to obtain the simulation results without the previous error message.

Article header library 130421 pic08 1
Figure 8: Inverting amplifier result using OP162

LTspice demo file verified this time

test_op162__1.zip

The simulation file executed this time is stored. Please try!

At the end

This time, I introduced how to add a model that is not in the existing parts library. Regarding the addition of component models, if there is an opportunity, I would like to introduce the automatic symbol creation function and how to support models for operational amplifiers with 5 or more terminals.

If you haven't used LTspice yet, please download LTspice from the link below!
Please try once.

Download LTspice here

We also hold regular LTspice seminars for beginners. You can learn the basic operation of LTspice, so please participate.

Click here for LTspice seminar information

Click here for recommended articles/materials

List of articles: Let's use LTspice Series

LTspice FAQ:  FAQ list

List of technical articles:  technical articles

Manufacturer introduction page:  Analog Devices, Inc.  

Click here for recommended seminars/workshops

Click here for LTspice seminar information

Inquiry

If you have any questions regarding this article, please contact us below.

Analog Devices Manufacturer Information Top

If you want to return to Analog Devices Manufacturer Information Top, please click below.