LTspice-Circuit hierarchy(blocked)

In this article, we will explain how to hierarchize(block) the circuit drawn by LTspice's schematic editor.

When circuits are large and complex, some circuits can be hierarchized(blocked) to improve the readability of the schematic.

In addition, block circuits created hierarchically can be used in multiple applications within the same schematic or in other schematics.

TOC

What is circuit hierarchy(blocked)?

In this article, we will try to hierarchize(block) the amplification part surrounded by the red frame of the "Inverting Amplifier Circuit" created in the following article.

LTspice XVII Circuit hierarchy(blocked)

It is hierarchized as follows, and the block circuit below the hierarchy is included in the schematic above the hierarchy.

LTspice XVII Circuit hierarchy(blocked)

We have prepared a schematic of "op amp inverting circuit", so if you want to hierarchize(block) the circuit immediately, please download it by clicking the link below.

Create block circuit

1
LTspice XVII Delete circuits

Open the schematic(sample-circuit-lt1028.asc) of the "op amp inverting circuit" and delete all circuits except red frame.

2
LTspice XVII Label Net

Click "Label Net" on the toolbar and wire the label to each terminal as above. This completes the block circuit.

3
LTspice XVII Save As

Click "File"-"Save As" on the menu bar to save.

4
LTspice XVII Save inverting-amp-block.asc

It does not matter what storage location or name. In this article, it was saved as "inverting-amp-block.asc" in "C:\Users\USER\Documents\LTspiceXVII".

Create symbol

1
LTspice XVII Open this Sheet's Symbol

Click "Hierachy-Open this Sheet's Symbol" to automatically create a schematic symbol for the block circuit.

2
LTspice XVII Automatically generate one

"Couldn't find this sheet's symbol. Shall I try to automatically generate one?"
Is displayed, click “Yes”.

3
LTspice XVII Symbols created automatically

As mentioned above, schematic symbols are created automatically.

4
LTspice XVII inverting-amp-block.asy automatically saved

Also, it is saved with the same name in the same folder as the schematic. In this case, it is saved as "inverting-amp-block.asy" in "C:\Users\USER\Documents\LTspiceXVII".

5
LTspice XVII Change pin arrangement

However, since it is difficult to wire with this pin arrangement, change the pin arrangement.

See the following articles for more information, including moving pin locations.

After placing the pins, save them by "Save" on the toolbar.

How to use block circuit

1
LTspice XVII Delete circuit

Open the schematic(sample-circuit-lt1028.asc) of the "Inverting Amplifier Circuit" and delete all circuits in red frame.

2
LTspice XVII Component

Click "Component" on the toolbar.

3
LTspice XVII Select inverting-amp-block

Change the Top Directory to "LTspiceXVII" and select "inverting-amp-block".

4
LTspice XVII Place inverting-amp-block

As above, place "inverting-amp-block" and wire each part, label and GND respectively.

5
LTspice XVII Save As

Click "File"-"Save As" on the menu bar to save.

6
LTspice XVII Save sample-circuit-lt1028.asc

It does not matter what storage location or name. In this article, it was saved as "sample-circuit-lt1028-block.asc" in "C:\Users\USER\Documents\LTspiceXVII".

This completes the hierarchization(blocking) of the circuit. The block circuit placed can be used as a "2x inverting amplifier".

Parameter passing between hierarchies

The circuit has been hierarchized(blocked), but it is difficult to use it in other circuits because the gain of "2-fold inverting amplifier" is fixed.

So, let's make it easy to set the gain in the circuit above the hierarchy by passing parameters between hierarchies.

1
LTspice XVII Navigate/

Right-click of the mouse on the block circuit to open the "Navigate / Edit Schematic Block" screen.

2
LTspice XVII Open Schematic

Click "Open Schematic".

3
LTspice XVII Resistance {gain*100}

A schematic of the block circuit is displayed. Right click of the mouse R2 and change "Resistance[Ω]" to "{gain*100}".

4
LTspice XVII gain=2

Return to the circuit above the hierarchy, right-click of the mouse on the block circuit and open the "Navigate / Edit Schematic Block" screen.

By inputting "gain" to PARAMS, you can freely set the block circuit gain. For example, if "gain = 2", the amplification factor will be doubled.

5
LTspice XVII Save

Now that parameter passing between hierarchies is complete, save the block circuit.

6
LTspice XVII Save

Similarly, save the circuit above the hierarchy.

You can download the hierarchized(blocked) schematic from the link below.

Let's share this post !
TOC