Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE...

24
Introduction to SPICE Simulator of Electronic devices

Transcript of Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE...

Page 1: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Introduction to SPICE

Simulator of Electronic devices

Page 2: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Main steps:

DownloadInstalationOpen OrCAD capture CIS LiteCreate a circuit. Place parts.Design a Simulation ProfileRun PSpice F11View simulation results F12

Page 3: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

DownloadOrcad 16.5 Demo software

Capture & PSpice only

http://www.cadence.com/products/orcad/pages/downloads.aspx

Page 4: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

You will receive an email with a link where you download a compressed file:

16.5_OrCAD_Lite_Capture&PSpice_Products.zip

Decompress and install.

Running PSpice the first time:

Cadence-> Orcad 16.5 Lite -> OrCADCapture CIS Lite

Project -> New

Analog or mixed A/D. Name………….

Create a blank project

Installation

Open PSpice

Page 5: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

File options

Project (practica01.dsn):

-Pages (PAGE1, PAGE2,...)

-Simulation profiles (name01, name02,...)

Page 6: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

A new page can be created. The pages inside the same schematics have the same simulation profile. If you edit this profile in one page it is automatically modified in the rest of pages.When you run spice, the results of all pages are represented together in the same figure if markers are placed in them.You can eliminate markers you do not want to see.You can create different simulation profiles and select them when you like

NEW PAGES

Page 7: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

If you need to use and keep different simulation profiles in different circuits you would rather create a new schematics

Create schematic +mouse right button -e -> make root. If you do not make root you will see this message:

Page 8: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Edition options(Edit, Draw, View).Place->Part (or p) Adds a new element to the circuit Rotate Rotates a selected elementMirror Reflects the component as in a mirrorPlace->Wire (or w) Connects elements with wiresPlace->Text (or t) Adds text to the circuitZoom in/out (I/O) Zooms in/out

Page 9: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Creating a circuit.Place component: (Place -> Part) or (P)

Add library: (Alt+A) or click on this icon

Select all The libraries below do not work.Only those in “pspice” directory do.

Page 10: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Placing componentsMost common components: Place->Part (p)R, C, L Resistor, capacitor, inductorGround Use 0/CAPSYM symbol to place a dc ground.VDC/SOURCE DC source.VSRC General purpose voltage source (DC-AC-Pulse)Vsin Sine voltage source: amplitude (VAMPL), frequency

(FREQ) and offset (VOFF)Vpulse Square voltage source: minimum (V1), maximum

(V2), pulse width (PW), period (PER), fall time (TF), rise time (TR) y delay time (TD)

d1n4002 DiodeQ2n2222 Bipolar Transistor (npn)MbreakN, MbreakP Enhancement MOSFET n- (p-) channelua741 Operational amplifier 741

Markers:Mark Voltage/Level Mark Voltage Differential Mark Current into Pin Mark Power dissipation“V” icon: Enable bias voltage display

Page 11: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

-Write name of part or select it from the list + enter

-Capacitor: C/ANALOG

Resistor: R/ANALOG

Inductor: L/ANALOG

Diode: Dbreak/BREAKOUT, PDIODE/EVALP

Bipolar Junction Transistor: Q2N…../EVAL, PBJN/EVALP

MOSFET: MBREAKN/BREAKOUT, MBREAKN/BREAKOUT

Page 12: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

VDC/SOURCE VAC/SOURCE VEXP/SOURCE

VSRC/SOURCE VSIN/SOURCE VPULSE/SOURCE

Page 13: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

• Voltage controlled voltage source : E• Current controlled voltage source: H• Voltage controlled current source : G• Current controlled current source: F

Dependent sources

Output of source depends on some other variable. There are four types depending on the controlling variable and output of the source.

Page 14: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

SCALE FACTORS IN PSPICESYMBOL EXPONENT VALUEF (f) 1e-15 10-15

P (p) 1e-12 10-12

N (n) 1e-9 10-9

U (u) 1e-6 10-6

M (m) 1e-3 10-3

K (k) 1e3 103

MEG (meg) 1e6 106

G (g) 1e9 109

T (t) 1e12 1012

Important: Pspice DOES NOT DISTINGHISH between uppercase or lowercase letters.1M is always mili- (1E-3 = 1e-3), never mega- (1E6 = 1e6).

Page 15: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Design.

Simulation.

Results.

Page 16: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Simple circuits. Basic analysis.Bias point

It generates output file.

Page 17: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

DC sweep

Page 18: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

AC sweep

0 constant; 0; 0 open circuit

; short circuit

dVi Cdt

dVV idt

dV idt

ω

ω

=

→ ⇒ ≈ → →

→∞ ⇒ →∞ →∞

Page 19: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Time domain (transient)

Page 20: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Parametric analysis

Page 21: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Results

Schematics Trace → Add Trace (INSERT): Adds a new curve on the current figure: Vo,Vin, 20*log(Vo/Vin), dBPlot → Axis settings: Data range (auto/user defined), axis scale (linear/log)Plot → Add Plot to window: representation of more than one figure in the same window.Plot → Delete Plot.Plot → Label → Text, Line, Poly-Line, Arrow, Box, Circle, Ellipse.View → Zoom, Output File, Toolbars, Alternate Display,…

Page 22: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Use of worksheet to represent results and to compare Spice, theory and lab results.Select curve in Schematics and Ctrl+C

Page 23: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Place Hierarchical Blocks

1.- Place -> Hierarchical Block. 2.- Fill: Reference…….Write a name you want.3.- Click, Primitive -> No (in order to modify it).4.- Implementation type -> Schematic view5.- Implementation name: write a name you want6.- Ok7.- Mark a rectangle with the mouse on the screen.8.- Place Hierarchical pin. Name (“in” or “out”), Type (”input” or “output”)9.- To copy Hierarchical Blocks you must copy the block and the contents separatedly. Is is preferable to create a part in a new library

Page 24: Introduction to SPICE - UGRtejada/Componentes/ftp/Tema03SPICE.pdf · Introduction to SPICE Simulator of Electronic devices. Main steps: Download Instalation Open OrCAD capture CIS

Creating a part in a library.1.- In project window, click on project name.2.- Clik: Tools -> Generate Part.Netlist/source file: name of the project we are working onNetlist/source file type: Capture Schematic/DesignPart name: give a name for the part. Ex.: DiodePrimitive: NoDestination part library: /COMPONENTES.olbSource Schematic name: Schematic name that includes the hierarchical blockCreate New Part: It must be active3. Ok.- Accept Pin confirmation window: Ok->save-The library and part are generated and loaded in the “output” file. -Opcional: the icon of the design can be changed by drawing new lines or inserting text. Click right button in your mouse -> Edit part.-The part of this library can be placed in a circuit as usual: Place->part or write simply “p”.