Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
using LTSPICE symbols for representation of spice netlist of OPAMP
Hello, In ltspice there are many modles and I like to use the standart symbols to represent the model.
When I create model from a netlist at worst I use a recrangle with pins? and at best I try to draw opamp by myselse and? the result genrally is not looking good.
Is there a way to plug somehow the attached CIR file to standart LTSPICE symbol.
(in AD797 they also have extra decompensation pin)
What could be done ??
Thanks.
?
/g/LTspice/files/Temp/ad797.cir |
On Fri, Feb 21, 2025 at 09:03 AM, john23 wrote:
No you can't use the normal op-amp symbol directly, because of that extra pin.? The normal op-amp symbol is "opamp2", and it works for the majority of op-amps.? But not this one. ?
Here is something to consider doing.? Make a copy of the opamp2 symbol.? Then edit that symbol (in LTspice's symbol editor) to add the extra decompensation pin, and save the symbol with a new name, in your own symbol library.
?
Alternatively, start searching through the vast numbers of Analog Devices op-amps that come with LTspice, until you find another one that has an extra pin but still looks like an op-amp.? Make yourself a copy of that one.
?
If you know that you will never use the decompensation pin, there is another alternative:? Wrap a 5-pin subcircuit around the Analog Devices AD797 model, and don't bring that extra pin out to the outer subcircuit.? Now you have a 5-pin subcircuit, which CAN be used with the built-in "opamp2" symbol.
?
.SUBCKT MyAD797 In+ In- V+ V- Out
X? In+ In- V+ V- Out Decomp? AD797
.LIB AD797.cir
.ENDS MyAD797
?
Andy
? |
On Fri, Feb 21, 2025 at 10:30 AM, john23 wrote:
I'm sorry, but that question does not make sense. ?
The photo does not show a symbol menu.? It is a photo of your auto-generated symbol.? If you want to not use the auto-generated symbol, then do not add it to your schematic.? If it is on your schematic already, delete it from the schematic.
?
Add the opamp2 symbol to your schematic.? Edit the name next to it, from "opamp2", to the name you use for your "wrapper" subcircuit (the one that "wraps around" the actual AD797).? I used "MyAD797" in the example I showed previously.? Also get the netlist of that "wrapper" subcircuit into your simulation - either paste it directly onto the schematic (as a SPICE Directive), or include it as an .INCluded file.
?
Andy
? |
Hello Andy , I am trying to implement the method you reccomended.
I have added the OPAMP2 symbol and made the include command for the ad797.cir file.
then I tried to added the spice directive script? for a wrapper but I got and error. It says U1:22 uknown circuit node.
Where did I go wrong?
Ltspice files and error massage are attached in the ZIP.?
.SUBCKT MyAD797 In+ In- V+ V- Out
X? In+ In- V+ V- Out Decomp? AD797
.LIB AD797.cir
.ENDS MyAD797
?
?
/g/LTspice/files/Temp/22_02_25.zip
|
john23,
?
Apparently, LTspice incorrectly processes the AD797 model file.? I don't understand why it did that, but here is how to fix it.
?
Change from this:
to this:
?
By the way, you uploaded the wrong schematic.? The schematic you simulated is not the one you uploaded.
?
Andy
?
?
? |
On Sun, Feb 23, 2025 at 12:42 PM, john23 wrote:
You did not follow what I said to do.
?
What was the point of creating a subcircuit named "MyAD797", if you did not even bother to use that subcircuit?
?
The subcircuit you created (as a "wrapper" around ADI's AD797 model) is named "MyAD797".? Therefore, change the name next to the opamp2 symbol, to that exact name.? You want your opamp2 symbol to call the MyAD797 subcircuit that you created.
?
I wrote that already in message 158621, did I not?? Carefully read those instructions again, and follow what I wrote.
?
Also, get rid of the command ".include ad797.cir" that you added to your schematic which should not be there.
?
Andy
? |
On Sun, Feb 23, 2025 at 02:24 PM, john23 wrote:
That works too. ?
I was trying to make it work without modifying the original AD797 SPICE model.? Sometimes, IC manufacturers get really picky about altering their SPICE models, and I wanted to avoid that.? It does indeed make your simulation function - although the schematic looks awful when opened in LTspice, because it scales to fit the text.
?
When you downloaded the AD797 SPICE model, you agreed that you "may modify this SPICE Model to suit Your specific applications,", so apparently they do not mind you modifying it this way for your own use.? But you are prohibited from making this change to the model and then distributing a copy of the modified model to anyone else.? The change you made alters the function of the model.? That is prohibited by the License Agreement that you agreed to when you downloaded it from Analog Devices.
?
Also, remember that you did alter it, and if you come back to your simulation some 10 years from now, remember that it is a modified SPICE model.? It helps to add a Comment note to the schematic, saying that it's been altered.? 10 years from now, if you tried to update the AD797 model it contains, it won't work unless you modify it again.? That was another reason why I preferred to put a "wrapper" subcircuit around the original model instead of modifying it.
?
Andy
? |
On Mon, Feb 24, 2025 at 05:44 AM, john23 wrote:
It just does!? The 5 listed pins connect to the MyAD797.? The 6th pin does not; it remains internal. ?
This is how subcircuits work.? The .SUBCKT command defines the name of the subcircuit and its external pins.? The contents of the subcircuit typically contain many more nodes than the few that are called out as pins on the .SUBCKT command.
?
It is not unusual for a subcircuit to have dozens or hundreds of nodes, but only a few of them are listed on the .SUBCKT command.? All the ones that are not listed on the .SUBCKT command are internal to the subcircuit and are effectively not seen by the external circuit when you call or use the subcircuit with its X-element instance.
?
Look at any op-amp's subcircuit and you will see what I mean.? Take the AD797's subcircuit.? It has internal nodenames 1, 2, 98, 31, 44, 47, 9, 22, 5, 4, ... and I could go on and on for several more.? But its .SUBCKT command lists only these six: 1, 2, 99, 50, 38, and 14.? The rest of the nodes are internal to its subcircuit.
?
Please read up about how .SUBCKTs work in SPICE.? LTspice's Help description is rather inadequate for that, I am afraid, and assumes that the reader has a basic understanding about SPICE subcircuits.
?
Andy
? |
to navigate to use esc to dismiss