Electronic – How tomport a P Spice model into LT Spice

ltspicepspice

I want to import the part LM393 into my LT Spice program library. The file down load doesn't have a .lib or . asy file that my other files have. It's from texas instruments and is supposed to be a P Spice file but only comes with a 5_1 File.

https://www.ti.com/product/LM393A?dcmp=dsproject&hqs=sw&#desKits

If you could go over in depth how I could get it over into my library.

Best Answer

If you go to your link and select the "LM393A PSpice Model" download, you will get a ZIP file. If you reach into the ZIP file you'll find a simple text file with the following contents:

* LM393A VOLTAGE COMPARATOR "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS VERSION 4.03 ON 03/07/90 AT 14:17
* REV (N/A)
* CONNECTIONS:   NON-INVERTING INPUT
*                | INVERTING INPUT
*                | | POSITIVE POWER SUPPLY
*                | | | NEGATIVE POWER SUPPLY
*                | | | | OPEN COLLECTOR OUTPUT
*                | | | | |
.SUBCKT LM393A   1 2 3 4 5
*
  F1    9  3 V1 1
  IEE   3  7 DC 100.0E-6
  VI1  21  1 DC .75
  VI2  22  2 DC .75
  Q1    9 21  7 QIN
  Q2    8 22  7 QIN
  Q3    9  8  4 QMO
  Q4    8  8  4 QMI
.MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
.MODEL QMI NPN(IS=800.0E-18 BF=1002)
.MODEL QMO NPN(IS=800.0E-18 BF=1000 CJC=1E-15 TR=807.4E-9)
  E1   10  4  9  4  1
  V1   10 11 DC 0
  Q5    5 11  4 QOC
.MODEL QOC NPN(IS=800.0E-18 BF=20.29E3 CJC=1E-15 TF=942.6E-12 TR=543.8E-9)
  DP    4  3 DX
  RP 3  4 46.3E3
.MODEL DX  D(IS=800.0E-18)
*
.ENDS

Do a "copy" of this by using ctrl-A and then ctrl-C or whatever works for you in coping the above contents.

Once that is done, hit ctrl-S in LTspice to start up a Spice dialog box. When that is opened up, hit ctlr-V to paste that prior information into the new Spice dialog box. Click OK and then place this contents somewhere on your schematic.

Now. you need to find an appropriate symbol to match up with the above. You could just make one, if you like. But it turns out that there is already a convenient one. Hit F2 and then investigate the [Opamps] folder and then find "opamp2" within that section. Pick it and drop it onto your schematic.

Right-click over that new schematic symbol and it will pop up a "component Attribute Editor" dialog box. Here, under the the line (or row) that says "Value" you can change this to "LM393A". Click on the OK button to accept that choice.

You now have a symbol and also the test version of the folder. That's all good.

Hook up your (-) and (+) lines appropriately, now. And then add in the rest of the circuit. That should do the job.