Upload
constance-dean
View
215
Download
0
Embed Size (px)
Citation preview
Spice
Enrico Santi
Types of Analysis
• Bias point (always performed)
• .TRAN transient analysis
• .AC AC analysis (on linearized system)
• .FOUR Fourier analysis
• .DC DC sweep analysis
File Types
Input
• .CIR text file with circuit description
Output
• .OUT Spice text output (contains error messages and bias point info)
• .DAT Data file (used by Probe to plot)
Format of .CIR Files
Title
Circuit description
Analysis description
Output description (.PROBE)
End-of-file statement (.END)
Part Library
• Part library contains collection of subcircuits representing OPAMPS, IC chips, etc.
• Parts can be used to build circuits (node mapping)
Part Library and Subcircuit Syntax
.LIB eval.lib * include library eval.lib
Xname [nodes] SUBNAME * call statement
File eval.lib contains subcircuits:
.SUBCKT SUBNAME [nodes] circuit description.ENDS SUBNAME
Defining Model Parameters: the .MODEL statement
• Used to define model parameters
• Syntax for an NPN transistor with forward beta of 300Q1 1 2 3 QNAME.MODEL QNAME NPN (BF = 300) 1
3
2
Examples
• RC circuit (time domain and frequency domain)
• Astable circuit using 555 (use of library and subcircuits)
• Transistor current source (use of .MODEL statement to define component parameters)
Example: Highpass Filter
VG
C1
R1
+
-
+-
0
21
159K
10nF
RC highpass filter
VG 1 0 DC 10V AC 1
R1 2 0 159KC1 1 2 10NF IC=-5V
.TRAN 6us 6MS
.AC DEC 100 1HZ 10KHZ
.PROBE
.END
555 Astable