LM311 LTspice hangs when using hysteresis schmitt trigger ..#2

Thread Starter

WARDEVIL_UFO

Joined Nov 16, 2010
22
Here is LM311 model, symbol, and circuit (attached).
I am trying to use eetech00's LM311 file in LTspice. I have followed some tutorials on how to add models with the .lib directive. I created a folder under \Documents\LTSpiceXVII\EET403B\Lab1to place Lab1 and any corresponding files into. When I click on my directive ".lib LM311" LTspice complains "Couldn't find any hierarchical resolution of LM311".

I tried to avoid bumping this, but I have already sank a good couple of hours into this. Thanks.

@eetech00

Mod: Created a new thread.
 
Last edited by a moderator:

eetech00

Joined Jun 8, 2013
3,951
I am trying to use eetech00's LM311 file in LTspice. I have followed some tutorials on how to add models with the .lib directive. I created a folder under \Documents\LTSpiceXVII\EET403B\Lab1to place Lab1 and any corresponding files into. When I click on my directive ".lib LM311" LTspice complains "Couldn't find any hierarchical resolution of LM311".

I tried to avoid bumping this, but I have already sank a good couple of hours into this. Thanks.

@eetech00

Mod: Created a new thread.
Hi

Which LTspice version are you using?


The directive should be:

.lib LM311.txt
The LM311.txt file should be placed in the same folder as the schematic .asc file.
 

Thread Starter

WARDEVIL_UFO

Joined Nov 16, 2010
22
I am using LTspice XVII 17.0.37.0

I appreciate your reply so much! What you said resulted in the file opening!
So it looks like I had 2 mistakes: (1) It looks like the file type extension must be appended even if the file did not have ".txt" next to the name in Windows. (2) the file must be in the immediate project folder (and thus not in a subfolder of the project).

I have one more issue though...


I followed the tutorial on the following video:

They have us put a generic Op-Amp as a place holder, and then later on right click on the op-amp and change the "value" to (should be "LM311" in this case). But when I run the simulation, LTSpice complains:

Port(pin) count mismatch between the definition of subcircuit "lm311" and instance "xu1". The instance has fewer connection terminals than the definition.
 

crutschow

Joined Mar 14, 2008
34,452
when I run the simulation, LTSpice complains:
There is an apparent mismatch between the model file and the symbol file.
You right-click on each node in the .asy symbol file and see that the label and Netlist order corresponds to that in the model file.
For example below, the In-pin has a Netlist order of 2 which corresponds to the second node shown the the lib file.

Also make sure the number of pins in the .asy file equals the number of nodes in the lib file

Note that it's the order that the function occurs in the model file, not necessarily the number for that function.
In this case they happen to be the same number, but that's not always the case.

1707321189788.png

1707321231026.png
 
Last edited:

eetech00

Joined Jun 8, 2013
3,951
I am using LTspice XVII 17.0.37.0

I appreciate your reply so much! What you said resulted in the file opening!
So it looks like I had 2 mistakes: (1) It looks like the file type extension must be appended even if the file did not have ".txt" next to the name in Windows. (2) the file must be in the immediate project folder (and thus not in a subfolder of the project).

I have one more issue though...


I followed the tutorial on the following video:

They have us put a generic Op-Amp as a place holder, and then later on right click on the op-amp and change the "value" to (should be "LM311" in this case). But when I run the simulation, LTSpice complains:
The LM311 symbol is a special symbol designed specifically for the LM311. The LM311 has more pins than a generic opamp. Hence, the error message when you change the value. So you won't be able to just change the "value".
You will have to replace the symbol with the universalopamp symbol for the tutorial. If you want to use a symbol and supply your own model, generally, use the opamp2 symbol and change the name value. As long as the model definition has 5 pins, in the correct order, it should work.
 
Top