introduction to unix and spice - doe.carleton.catjs/1908spice2013.pdf · introduction spice excel...

37
INTRODUCTION Spice Excel Wednesday, 13 March, 13

Upload: others

Post on 09-Nov-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

INTRODUCTION

Spice Excel

Wednesday, 13 March, 13

Page 2: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

SPICE

Simulation Program with Integrated Circuit Emphasis

Wednesday, 13 March, 13

Page 3: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

SPICE is a program which can be used to simulate analog electronic circuits

Wednesday, 13 March, 13

Page 4: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output

with relation to frequency

v_in v_outcircuit

Wednesday, 13 March, 13

Page 5: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output

with relation to frequency

Wednesday, 13 March, 13

Page 6: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output

with relation to frequency

Wednesday, 13 March, 13

Page 7: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output

with relation to frequency

Wednesday, 13 March, 13

Page 8: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output

with relation to frequency

Wednesday, 13 March, 13

Page 9: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Analog filter circuits have a parameter called a ‘Transfer Function’ which maps input to output

with relation to frequency

Wednesday, 13 March, 13

Page 10: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

Wednesday, 13 March, 13

Page 11: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

Wednesday, 13 March, 13

Page 12: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

Wednesday, 13 March, 13

Page 13: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

Wednesday, 13 March, 13

Page 14: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

Wednesday, 13 March, 13

Page 15: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

Wednesday, 13 March, 13

Page 16: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

* Basic DC circuitV1 1 0 20R1 3 1 4kR2 3 2 10kV2 2 0 -10R3 3 0 8k.OP.END

Wednesday, 13 March, 13

Page 17: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

A netlist is a text version of the circuit which describes the components and values for the

computer to interpret and solve

* Series_RLC CircuitV1 1 0 SIN(0 5 1k) AC 1R1 2 1 50L1 2 3 100mHC1 3 0 1uF.AC DEC 100 1 10k.END

Wednesday, 13 March, 13

Page 18: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Spice is a software program that simulates electronic circuits and outputs the circuits’ basic characteristics such as:

–Voltage–Current–Resistance

at any location in the circuit

HSpice is a version used in Unix

PSpice is a version used in Windows

T-Spice simpler tool meant for smaller circuitsOptiSPICE is the best because it was written by your professor.

WHAT IS SPICE?

Text

Wednesday, 13 March, 13

Page 19: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• Create an Spice input file that describes the circuit

• Run Spice

• Inspect the output

WORKFLOW

Wednesday, 13 March, 13

Page 20: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

R_R1 1 0 100

C_C1 1 2 0.01592u

V_V1 2 0 dc 0.0 ac 1.0 sin(0.0 1.0 1.0 0 0)

node value

- A netlist describes the circuit to the program- Node 0 is always GROUND

name

THE NETLIST

Wednesday, 13 March, 13

Page 21: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

-The title must be the first line in the netlist (in order to recognize the options command)- R1 = 100Ω (Ohms)- C1 = 0.01592uF (micro Farads) with initial condition of 0- V1 = sine wave with 1Hz frequency, 0 to 1V magnitude- Print ac voltage at node 1- Want 100 frequency points from 0.001 to 1e+06

Title “my filter circuit”.options ingold=2R_R1 1 0 100C_C1 1 2 0.01592u IC=0V_V1 2 0 dc 0.0 ac 1.0 sin(0.0 1.0 1.0 0 0).print ac V(1).ac LIN 100 0.001 1e+06.op.END

THE INPUT FILE

Wednesday, 13 March, 13

Page 22: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

•All Programs ->Tanner EDA -> T-Spice...RUN T-SPICE

Wednesday, 13 March, 13

Page 23: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

VIEWING OUTPUT

Wednesday, 13 March, 13

Page 24: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

TRANSFER FUNCTION• Magnitude Plot - DB vs Hz (log

scale)

• Phase Plot - Degrees vs Hz

Together these plots show the transfer function of the circuit at different frequencies

Wednesday, 13 March, 13

Page 25: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• 3-terminals: Collector, Base, and Emitter

• Common Emitter Amplifier

• input = base with respect to the emitter

• output = collector with respect to the emitter

• Most commonly used configuration for transistor-based amplifiers as it produces the highest voltage, current, and power gain.

Input Voltage

Output Voltage

BIPOLAR JUNCTION

Wednesday, 13 March, 13

Page 26: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

BJT

Wednesday, 13 March, 13

Page 27: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

0

1.3

2.5

3.8

5.0

0E+00 1E-08 2E-08 3E-08 4E-08

Voltage at Collector and Base of a BJT using HSpice

Volta

ge [V

]

Time [s]

BaseCollector

OUTPUT FROM HSPICE

Wednesday, 13 March, 13

Page 28: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

SOME USEFUL NETLIST STATEMENTS• Analysis Types:

• Operating Point (.OC) - Voltage at each node and current from voltage sources

• AC Analysis (.AC) - Small signal model output at different frequencies

• Transient (.TRAN) - Circuit output as time passes

• Scale factors:

T : E+12G : E+9

MEG : E+6

K : E+3M : E-3U: E-3

N: E-9P: E-12F: E-15

Wednesday, 13 March, 13

Page 29: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• Components:

SOME USEFUL NETLIST STATEMENTS

Netlist Name Component Type ExampleRname Resistor Rname N+ N- Value

Cname Capacitor Cname N+ N- Value <IC=Initial Condition>

Lname Inductor Lname N+ N- Value <IC=Initial Condition>

Vname Voltage Source Voltage source: Vname N+ N- <DC=> DCValue

Iname Current Source Current source: Iname N+ N- <DC=> DCValue

Qname Bipolar Transistor Qname C B E BJT_modelName

Mname MOSFET Mname ND NG NS <NB> ModName <L=VAL> <W=VAL>

Sweep Distributions:- DEC : Log distributions of points- LIN: Linear distribution of points

Wednesday, 13 March, 13

Page 30: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

TIPS IN EXCEL

Wednesday, 13 March, 13

Page 31: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• In the menu, choose Format CellsTime [s] Vout [V]0.E+00 0.0001.E-10 -0.0082.E-10 -0.0073.E-10 0.0344.E-10 0.1405.E-10 0.3226.E-10 0.5887.E-10 0.9348.E-10 1.3559.E-10 1.8391.E-09 2.373

Scientific Notation: 0 decimals

Number: 3 decimals

FORMAT CELLS

Wednesday, 13 March, 13

Page 32: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

Excel can split text from one column into multiple columns using the command “Text to Columns”

Wednesday, 13 March, 13

Page 33: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• $ is used with cell coordinates, signifies leaving that coordinate constant

• Example: rearrange v=d/t to give d=v*t

The code

$

Wednesday, 13 March, 13

Page 34: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• Other: transpose, add…

• Example: Make a row of data negative

• Copy cell with -1 value, highlight cells that you want to become negative of the current values, Edit Paste Special Multiply

Positive“not yet

Negative” 0.400 0.400 -1-0.008 -0.008 -0.007 -0.007

Positive Negative0.400 -0.400-0.008 0.008-0.007 0.007

PASTE SPECIAL

Wednesday, 13 March, 13

Page 35: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• Right-click on a data point, choose Add Trendline using type: Linear, options: display equation on chart and R squared value.

0

2.8

5.5

8.3

11.0

0 2.50 5.00 7.50 10.00

y = 1.0022x + 0.3231R² = 1

w_p

[um

]

w_n [um]

BEST FIT LINE

Wednesday, 13 March, 13

Page 36: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

• must have the Analysis Toolpak (go to Tools Add-ins, and install).

• tools - data analysis - regression - x and y ranges - click residuals

SUMMARY OUTPUT

Regression StatisticsRegression Statistics

Multiple R 0.999997109R Square 0.999994218

Adjusted R Square 0.999991328Standard Error 1182.326494

Observations 4

End

STATISTICS

Wednesday, 13 March, 13

Page 37: Introduction to Unix and SPICE - doe.carleton.catjs/1908Spice2013.pdf · INTRODUCTION Spice Excel Wednesday, 13 March, 13. SPICE Simulation Program with Integrated Circuit Emphasis

NOW TO APPLY YOUR KNOWLEDGE!

Wednesday, 13 March, 13