Sep 18, 2008 - (schematic capture) and simulate it using PSpice. PCB Editor is used to design printed circuit boards. The output is. Create a directory for the new project if you have not done this already. Potdiv.dsn, which is the current design, by clicking on the + signs. Place hierarchical block. SUE Screen Layout. On the very top of the window the title bar should say: SUE: noname S (spice) ' noname' means that you have not specified the file (schematic) you wish to edit.The 'S' means that you are editing a 'Schematic', as opposed to an ICON.The (spice) means that you are currently in SPICE simulation mode.
$begingroup$LTSpice Hierachy block can not be found if it is not in current working directory.
I am using this tutorial to create sub-circuits in LTSpice:
Everything is fine except that the sub-circuit that I make can not be used globally. Every time that I have a new design I must copy my sub-circuits to the directory that my top-level design resides.
I even moved my sub-circuit (both .asc and .asy files) into a folder under
E:Program Files (x86)LTCLTspiceIVlibsym
but LTSpice can not find it. I suspect there must be a directive such that includes a folder into the global search path (or top-level search path) but I can't locate the option.I appreciate if you tell me how to make LTSpice sub-circuits available globally?
Update:
This is my inverter_035_1.asc:
And this is my inverter_035_1.asy:
Both files reside in a sub-folder under E:Program Files (x86)LTCLTspiceIVlibsym
Ehsan
EhsanEhsan
$endgroup$2 Answers
$begingroup$First, make yourself a user directory under 'sym':
Before adding anything (I already did, but we will get to that).
Start LTSpice, start a new schematic and then select add component:
I get this view with my parts directory shown:
Close LTSpice for now.
For an opamp (which is what I did here), copy the OPAMP2.sym file from the symOpamps directory to your directory and rename it with the name you want (which is what I did in the first picture).
Now get the subcircuit file and save it in the libsub directory:
Now open the asy file in your user directory in a text editor:
Here is part of the file:
If there are no SYMATTR lines, then add them:
Add any SYMATTR lines immediately before the PIN and PINATTR statements.
I changed the SYMATTR values to give a correct display name (Value), the Description field for what LTSpice shows in the selector window and the SpiceModel to the model I added in the sub folder.
Here it is:
I then place it:
Right click on the part and you get this:
This can now be used in any schematic.
I went through this when I added the Wurth magnetics library a while back.
The keys are:
- Put the subcircuit in the sub folder
- Put the symbol file in a directory of your choosing
- Make sure the SYMMATR statements point at the subcircuit properly, and edit the name and description to get an accurate representation of what it is.
Note that the subcircuit must be complete in its own right.
In your case, you are trying to create a hierarchical block; there is an excellent description at the link.
As links die, here is the procedure:
Make the schematic you desire to use as a hierarchical block and save it with a name
Now label all nets that must have external visibility and save again.
Create a new symbol. The pins on this symbol must have the same name as the labels you attached.
Save this symbol as (the names must be the same for the schematic and symbol).
If your schematic has external models or subcircuits, use the .include directive using full path names in the schematic before saving (so they do not have to be in a working directory).
You should now be able to instantiate your hierarchical block.
Peter SmithPeter Smith15.9k11 gold badge1414 silver badges4242 bronze badges
$endgroup$$begingroup$Alright, I found a workaround by myself that works!
1) Design your circuit in LTSpice and name all nets that will be connect to outside world. Save the circuit in .asc format in a subfolder under E:Program Files (x86)LTCLTspiceIVlibsym. Like this:
2) Before leaving the schematic editor go to View - SPICE Netlist. Copy and paste the netlist into a lib file, let's say 'mysubcir.lib'. Add a line above the pasted netlist to define a subcircuit like this:
mysubcir.lib:
3) Go to File - New Symbol and design your symbol. Put the pins with same net names in your schematic, in this case we have four pins: 'in out VGD GND'. And then save the .asy file in the same folder that you saved .asc file. Like this:
Now your new subcircuit is available globally. You only need to add '.lib mysubcir.lib' to your top schematic.
The only problem with this approach is that whenever you update the .asc file then you have to export the netlist and copy/paste it again into the .lib file. Any other solution that avoids this double rework is very welcome.
EhsanEhsan
$endgroup$