EE304B Electronic Circuits
LTSpice Tutorial
Professor: Wanyeong Jung
School of Electrical Engineering
Korea Advanced Institute of Science and Technology (KAIST)
1
Introduction
1. What is LTSpice?
2. Netlist
3. Installing LTSpice
2
SPICE
▪ SPICE = Simulation Program with Integrated Circuit Emphasis
• General-purpose circuit simulation program for nonlinear DC, nonlinear AC, and linear AC
analysis.
• Can interpret the circuit produced by Nodal-modified circuit analysis and a combination of
theoretical and experimental equations such as device model.
• Industry standard to verify circuit operation at the transistor level before committing to
manufacturing IC (Integrated Circuit).
▪ Several commercial versions of SPICE
• Hspice – Synopsys
• Pspice – Cadence
• Spectre – Cadence
• LTspice – Analog Devices
3
LTspice
▪ Free license SPICE tool from Linear Technology
• Developed in 1998 by Mike Engelhardt.
• Now it is part of Analog Devices (Linear Technology was acquired by Analog Devices at 2017).
• Includes a collection of SPICE simulation models for Analog Devices’ products
▪ More information about LTspice:
• [Link]
• [Link]
4
Schematic & Netlist
▪ Schematic is the graphical drawing of the circuit (visual diagram)
▪ Netlist is a description of the connectivity of an electronic circuit.
• List of electronic components and the
connectivity information.
▪ Example of a schematic (right) and a
netlist (left) of series RC circuit. N001 N002
0 (GND)
Netlist Schematic
5
Installation
▪ Download the file from ANALOG DEVICES
• [Link]
• For Windows,
• Intel, AMD CPU: x64 (top)
• Qualcomm CPU: ARM64 (bottom)
• For MacOS:
• MacOS
6
Drawing Schematics
1. Placing Components
2. Editing Components
3. Naming Nodes
7
Drawing Schematics
▪ To start, make a new schematic (File → New Schematic)
• Keyboard shortcut: Ctrl+N
8
Drawing Schematics
▪ Create instances
• Method 1: Edit → Select an instance to place
• Method 2: Use shortcut buttons on top
• Method 3: Use keyboard shortcuts 1
2
▪ Useful keyboard shortcuts
• P: Component • M: Move
• V: Voltage Source • S: Stretch
• G: Ground • Ctrl+R: Rotate
• W: Wire • Ctrl+E: Mirror
• R: Resistor • Ctrl+C: Duplicate
• L: Inductor • sDel: Delete
• C: Capacitor
• D: Diode
9
Drawing Schematics
▪ Edit instances
• Right click the component to edit parameter.
• “Advanced” allows detailed setup.
• Right click the name (V1) to edit name.
• Right clicking the value (V) to edit value.
10
Drawing Schematics
▪ Naming nodes
• Step 1: Click “Net Name” (or Edit → Net Name, keyboard shortcut ‘N’)
• Step 2: Set the name (e.g., VOUT)
• Step 3: Place it on the node to name.
1
11
Running Simulations
1. DC Operating Point 4. Transient Simulation
2. DC Sweep 5. Small Signal AC
3. Parameter Sweep
12
Running Simulations
1. DC Operating Point
• Computes the DC operating point.
2. DC Sweep
• Changes a DC voltage or current source step by step.
3. Parameter Sweep
• Changes any circuit parameter (resistance, capacitance, etc) and re-runs the simulation.
4. Transient Simulation
• Shows how voltages and currents change over time.
5. Small Signal AC
• Compute the small signal AC behavior of the circuit linearized about its DC operating point.
13
1. DC Operating Point
▪ Computes the DC operating point of each node.
• Ex) What is the voltage of VOUT?
• Ex) What is the current of R1?
14
1. DC Operating Point
▪ Step 1: Click “Configure Analysis”
▪ Step 2: Navigate to “DC opt pnt”, press OK.
▪ Step 3: Place the text “.op” in the schematic.
1
15
1. DC Operating Point
▪ Step 4: Press “Run”:
▪ Step 5: Observe the voltage and current
of each operating point.
16
2. DC Sweep
▪ Get DC operation point while changing DC voltage or current source step by step.
▪ Goal: See how VOUT changes when V1 linear sweeps from 0V to 20V with 1V interval.
17
2. DC Sweep
▪ Step 1: Click “Configure Analysis” and navigate to “DC sweep” tab.
▪ Step 2: Fill in necessary values, then press OK.
▪ Step 3: Place the text on schematic
Name of instance to sweep
Sweep type
2 Start, Stop value
Increment
18
2. DC Sweep
▪ Step 4: Click “Run”:
▪ Step 5: Measure the point to observe, and a sweep plot will appear.
• As V1 linearly increases from 0V to 20V,
VOUT increases linearly from 0V to 12V.
4
19
3. Parameter Sweep
▪ Changes any circuit parameter (resistance, capacitance, etc) and re-runs the simulation.
▪ Goal: we want to how Vout changes as R2 resistance changes linearly from 25mΩ to 150mΩ.
20
3. Parameter Sweep
▪ Step 1: Right click the resistor to sweep (R2), and set it as ‘{R}’ to indicate the target parameter list.
▪ Step 2: Click SPICE directive (or Edit → Spice Directive, Keyboard Shortcut: “.”)
▪ Step 3: Write the simulation code
• Ex) linear sweep of R2 from 25mΩ to 100mΩ,
with 10mΩ interval, write: 2
.step param R 25m 150m 10m
▪ Step 4: Simulate the whole circuit
(e.g., DC operation)
21
3. Parameter Sweep
▪ Step 5: Click “Run”:
▪ Step 6: Click on the point to see the results.
▪ As expected, we can see the relationship
between R2 and VOUT. 5
• VOUT=VIN * R1/(R1+R2).
VOUT
R2 resistance
22
4. Transient Simulation
▪ Shows how voltages and currents change over time.
▪ Goal: See the time domain of VOUT in series RC circuit with AC voltage source.
23
4. Transient Simulation
▪ Step 1: Click “Configure Analysis”, navigate to “Transient” tab.
▪ Step 2: Set timing values accordingly
▪ Step 3: Click OK and place the text on schematic.
When the simulation stops
2 When to save the data
Maximum interval between
internal calculation points in
a transient simulation
24
4. Transient Simulation
▪ Step 4: Click “Run”:
▪ Step 5: Click the node VOUT to see its voltage in time domain.
25
5. Small Signal AC
▪ Compute the small signal AC behavior of the circuit linearized about its DC operating point.
▪ Goal: See the frequency response (Bode plot) of small signal AC at VOUT.
26
5. Small Signal AC
▪ Step 1: Right click the voltage source, then click “Advanced”.
▪ Step 2: Set functions as “none” (DC) and set values for DC and small signal AC. Then press OK.
2
1
27
5. Small Signal AC
▪ Step 3: Click “Configure Analysis”
▪ Step 4: Navigate to “AC Analysis” tab and set values accordingly. Then click OK.
Select “Decade” to obtain Bode plot
28
5. Small Signal AC
▪ Step 5: Click “Run”:
▪ Step 6: Click the node to perform analysis. Bode plot will be shown in a separate window.
29