1 references: g. w. roberts, a. sedra, spice, © oxford university press, 2/e, 1977 tutorial on...

12
1 References: G. W. Roberts, A. Sedra , SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Upload: estella-barker

Post on 17-Dec-2015

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

1

References:

G. W. Roberts, A. Sedra , SPICE, © Oxford University Press, 2/e, 1977

Tutorial on PSPICE

Page 2: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Introduction

SPICE = Simulation Program with Integrated Circuits Emphasis SPICE underlying engine solves numerically the various

continuous time differential equations describing the circuit How to use SPICE ? We have to write an input file, also called

“deck”.

Deck OutputSPICEEngine

ASCII ASCIIProgram

Page 3: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

The SPICE deck

The input file must contain:

1. Title statement: always on the first line of the input file2. .END statement: always on the last line of the input file3. Circuit statements: lines that contains the description of a circuit element4. Control statements: lines that contains an analysis request or

measurements nodes or model parameters5. Comment statements: lines starting with an asterisk (*)

The order of the SPICE lines is not important except for the title line and the .END line SPICE is case insensitive and words can be separated by any number of spaces Components must be uniquely labeled Every node of the circuit is designated by a number. The ground node is labeled 0.

Page 4: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Example of an input file

Low Pass Filter

** Circuit Description Vin 1 0 PWL(0s, 0V, 1ms, 0V, + 1.0001ms, 1V) R1 1 2 1kohm C1 2 0 1uF

* Analysis Request .OP .TRAN 0.1ms 5ms

.end

Title

Positive Terminal

(n+)

Negative Terminal(n-)

.ENDcommand

The + sign means that

the previousstatement iscontinued on

this line.

Page 5: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Dimensions and scale-factors

Page 6: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Common circuit elementsFirst letter Element

C capacitor

D diode

R resistor

L inductor

Q bipolar transistor

M MOS Field Effect transistor

I independent current source

V independent voltage source

E voltage-controlled voltage source

F current-controlled current source

G voltage-controlled current source

H current-controlled voltage source

Page 7: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Independent Sources

Page 8: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Analysis and output requests

Besides the circuit description we need to:

Specify the type of analysis for our simulation Choose the circuit variables that we want to display

Page 9: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Analysis Requests

Operating point .OP

DC sweep .DC source_name start_value stop_value step_value

AC frequency response .AC DEC points_per_decade freq_start freq_stop

.AC OCT points_per_octave freq_start freq_stop

.AC LIN total_points freq_start freq_stop

Transient response .TRAN printing_time_step time_stop [time_start, max_time_step]

Page 10: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Output Requests

Page 11: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Sub circuits

The definition in SPICE for a subcircuit is as follow:.SUBCKT subcircuit_name list_of_nodes Circuit Description.ENDS

To incorporate the sub circuit into the main design

use the following statement, which starts with the

letter “X”:Xname node_connections subcircuit_name

Page 12: 1 References: G. W. Roberts, A. Sedra, SPICE, © Oxford University Press, 2/e, 1977 Tutorial on PSPICE

Example using a sub circuit