Hello,
It appears that Pspice models of TI devices are not available on TI website and on this page:
Can anybody provide TI SPICE library files?
Thanks.
Hello,
It appears that Pspice models of TI devices are not available on TI website and on this page:
Can anybody provide TI SPICE library files?
Thanks.
I added a small section about finding spice models to:
For models from TI, itâs probably best to go directly to TIâs website. They have quite a lot of models available, but not all work with ngSpice.
It appears the spice models are hidden in TI website. They were not available in âDesign and developmentâ section of an op amp opa1641. They have moved the spice models from this page:
It seems to work for me.
From there I downloaded sbom627d.zip (30.2 KB) and that contains an OPA164x.LIB file which has a .SUBCKT OPA164x IN+ IN- VCC VEE OUT with a whole bunch of lines following. It looks like something that should be readable by ngSpice, but I have not ran any simulation.
Perhaps they have country specific export or website restrictions. That page was not visible in the region where it was accessed. Thanks for the models.
The model opa164x.lib from the zip file doesnât work. There is no amplification in the simulation of Op amp in ngspice.
The schematic and spice lib opa164x.lib are attached below:
opa1641.zip (91.3 KB)
I canât look at your project directly as I am still using KiCad V8 but claiming:
is premature. Quite often the pin mapping of spice models is different from the pin mapping of the symbols in KiCad, and you have to add a translation table in your symbol properties with: Symbol Properties / Simulation Model / Pin Assignments (tab)
From the spice model file:
.SUBCKT OPA164x IN+ IN- VCC VEE OUT
And that defines the 5 pins (with pin numbers 1 through 5) for the spice model. (I.e, IN+ is pin number 1 in the model, OUT is pin number 5 in the model)
I tried setting these pins as above in the model and it doesnât work. I am attaching screenshots of the settings.
This selection gives an error in ngspice simulation.
Here is the error in ngspice:
Note: Codel model file loading path is /home/name/Documents/Kicad projects/opa1641/opa1641/
Note: Compatibility modes selected: ps lt a
Circuit: KiCad schematic
Error on line 311 or its substitute:
a.xu1.x_s1.as_s1 %gd xu1.n2992267 xu1.clamp %gd xu1.n2992267 xu1.clamp xu1.x_s1:a_s1
MIF-ERROR - unable to find definition of model xu1.x_s1:a_s1
Error: circuit not parsed.
That line 311 is in opa164x.lib and its associated lines are below
.SUBCKT BLOCK_DC_S1_OPA164x 1 2 3 4
S_S1 3 4 1 2 _S1
RS_S1 1 2 1G
.MODEL _S1 VSWITCH ROFF=1E12 RON=10M VOFF=0.0V VON=10MV
.ENDS BLOCK_DC_S1_OPA164x
I donât know what this code means.
The option 1 or 2 in image 1 gives output as a replica of input. The Pin 5 is NC in these models and there is no OUT configuration for pin 5 in these selections and the pin 5 is not configurable.
KiCad is also crashing if selecting a few sub selection options in opa1641.lib in image 1 and clicking Ok.
What can be done?
Your pin mapping is obviously wrong (as I suspected). You are just using the default mapping (one to one, two to two, etc).
Note that in this Pin Assignment tab, the Symbol Pins on the left are from the symbols (duh) and the symbols have both pin numbers, and pin names. while on the Model Pins on the right, the order (1 through 5) is implicit by the .subckt pin ordering. Now try to create the following mapping:
(I assume here that pin 6 is the opamp output, this usually has no text in the symbol of an opamp, as itâs function is implied by the triangle outline of the opamp).
I am not so sure about the rest of your post. My knowledge of ngSpice details is quite limited.
Thanks for the mapping. I did the same now. Even after that, I get the same error in ngspice. I am quite new to ngspice so I have to wait until an expert on ngspice can answer this.
Strangely , OUT pin at pin# 6 left is missing in the model.
I had some time left over, so I created a simple schematic and added the model downloaded earlier. And after fixing the pin mapping it runs without problems in KiCad V8.0.9.
I zipped up the project, you should be able to open it and run it in KiCad V9 without modification.
2025-11-01_asdf_opa164x.zip (35.5 KB)
I got the same error in ngspice as before with your zip file:
Note: Compatibility modes selected: ps lt a
Circuit: KiCad schematic
Error on line 311 or its substitute:
a.xu1.x_s1.as_s1 %gd xu1.n2992267 xu1.clamp %gd xu1.n2992267 xu1.clamp xu1.x_s1:a_s1
MIF-ERROR - unable to find definition of model xu1.x_s1:a_s1
Error: circuit not parsed.
Warning: vector time not or not yet available!
Warning: vector time not or not yet available!
It appears my earlier configuration of the simulation was correct. Somehow I got the above error for that too.
Here is the image of schematic:
Can you or anybody else check if this Kicad project has the correct result similar to yours?
opa1641.zip (61.0 KB)
I am curious if the above error has something to do only with my Kicad installation /setup version 9.0.5.
Thanks for your effort.
I did a very brief search and found the site below:
It suggest:
This is typically caused by an ngspice installation problem.
Some other things you can do:
Can you run a few of the examples you can find via the FAQ: Getting started link I posted earlier?
Adding the full version info (from Help / About KiCad / Copy Version Info) to this thread can aid with fault finding.
Version of kicad is this:
Application: KiCad Schematic Editor x86_64 on x86_64
Version: 9.0.5+1, release build
Libraries:
wxWidgets 3.2.8
FreeType 2.13.3
HarfBuzz 10.2.0
FontConfig 2.15.0
libcurl/8.14.1 OpenSSL/3.5.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 libidn2/2.3.8 libpsl/0.21.2 libssh2/1.11.1 nghttp2/1.64.0 nghttp3/1.8.0 librtmp/2.3 OpenLDAP/2.6.10
Platform: Debian GNU/Linux 13 (trixie), 64 bit, Little endian, wxGTK, X11, cinnamon, x11
OpenGL: Intel, Mesa Intel(R) HD Graphics 2500 (IVB GT1), 4.2 (Compatibility Profile) Mesa 25.0.7-2
Build Info:
Date: Oct 11 2025 10:45:10
wxWidgets: 3.2.8 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.83.0
OCC: 7.8.1
Curl: 8.14.1
ngspice: 44.2
Compiler: GCC 14.2.0 with C++ ABI 1019
KICAD_IPC_API=ON
Locale:
Lang: en_IN
Enc: UTF-8
Num: 1,234.5
Encoded кΊä¸: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)
Strangely, the plot works correctly after I updated ngspice with the command
apt install -t trixie-backports ngspice
It appears that ngspice that came with kicad installation was not complete and I had to install it separately. The version number of ngspice is same in both cases Attached is output for given input.
.The previous ngspice that came with kicad installation did work for some simulations from Getting started link especially the BC546 example although it didnât work for opa164x.lib spice model.
I needed to uncheck use initial conditions then it worked without modification