Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

A Method of Editing LTS Opamp Symbol Files (.asy), et al.

Status
Not open for further replies.

MRCecil

Member
Purpose: To make incompatable .asy files compatable with non-standard convention (netlist order) and to eliminate need for include directive.

Opening .asy and .sub files:

Symbol files;
1. Open Windows Explorer or other tool and navigate to
LTC/LTSpice IV/sym/opamps;
2. Right click on desired symbol and dialog box will open;
3. Move cursor to "Open with" and select Notepad;
4. Symbol (XXXX.asy) is ready for editing;
5. Edit file as required with EXACT naming in all lines as in the .sub file in the .SUBCKT line discussed below;
6. To save edited file, click on "File" and select "Save As";
7. Save as XXXX.asy, ALL FILES, ANSI in desired directory/folder;
8. Do not save as .txt file or with text editor that will add attributes;

Subcircuit files;
1. Open LTS and open a schematic;
2. Type in include directive for imported sub circuit component;
3. Place cursor over .inc statement, right click on it & dialog box pops up;
4. Place cursor over "Open" button and click;
5. The .sub text file appears…Note first non-comment line of file (.SUBCKT XXXX)
6. This line establishes the netlist order called by the symbol file and should be in this order (standard order for LTS 5 pin opamp):

First position – non-inverting input
Second position – inverting input
Third position – positive supply
Forth position – negative supply
Fifth position – output

7. This information may be needed for additional edits to symbol file since there is no set standard for netlist order as I read in the LTS Help file;

Those methods above are one way of viewing/editing what the files contain. The following is how to edit the Symbol file to enable it to be opened just as a resident LT opamp file.

This is what a symbol file in an include directive using the opamp2 model looks like for an LM324, et al.

Version 4
SymbolType CELL
LINE Normal -32 32 32 64
LINE Normal -32 96 32 64
LINE Normal -32 32 -32 96
LINE Normal -28 48 -20 48
LINE Normal -28 80 -20 80
LINE Normal -24 84 -24 76
LINE Normal 0 32 0 48
LINE Normal 0 96 0 80
LINE Normal 4 44 12 44
LINE Normal 8 40 8 48
LINE Normal 4 84 12 84
WINDOW 0 16 32 Left 0
WINDOW 3 16 96 Left 0
SYMATTR Value LM324
SYMATTR Prefix X
SYMATTR Description Basic Operational Amplifier symbol for use with subcircuits in the file ./lib/sub/LTC.lib. You must give the value a name and include this file.
PIN -32 80 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 1
PIN -32 48 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN 0 32 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 3
PIN 0 96 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 32 64 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5

The lines of interest, if the netlist order is correct, are the SYMATTR descriptors…these:

SYMATTR Value LM324
SYMATTR Prefix X
SYMATTR Description Basic Operational Amplifier symbol for use with subcircuits in the file ./lib/sub/LTC.lib. You must give the value a name and include this file.

Note there are only three lines, with the last giving a warning to use the include directive. To open the file as any other LT file, it needs to be edited in the following manner:

SYMATTR Value LM324
SYMATTR Prefix X
SYMATTR SpiceModel LM324.sub
SYMATTR Value2 LM324
SYMATTR Description LM324 Low Power Quad Operational Amplifier

Note that two lines are added as follows:
Line 1 declares the device…no change;
Line 2 indicates prefix not visible…no change;
Line 3 is added to point to the .sub file;
Line 4 is added to add the second value;
Line 5 is edited to describe the device in the symbol dialog box;

Be sure to use the same device naming throughout with the .sub and .asy file. It will throw-up at run time if you name a device LM324/AN in the .sub file and LM324 in the .asy file. Look at the .sub file (opening described above) to make sure of the device name and to check on the netlist order to be sure of the name and the netlist order.

If the netlist order differs from the LT standard outlined above, one can edit the .asy file by cutting and pasting the three lines associated for each netlist node, pin location, pin name and pin order, in the sequence required by the .sub .SUBCKT line (see opening Subcircuit files above). This can be done automagically using the Auto Generate feature, but then one must also create the opamp "cell" from the default "block" for the drawn outline on the schematic...a pain!

That about does it. A lot of words for a very simple and quick operation, but it is what it is and takes what it takes. I hope this is useful to other LTS users. Feedback is welcome.

Cheers,
Merv
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top