Sunteți pe pagina 1din 16

IL2218Analogelectronics,advancedcourse

Documentversion3.1

20100111/BengtM.

IntroductiontoPSpice
This introduction is valid for OrCad PSpice ver 9.2 lite edition. The lite edition or student edition of the software is limited to designs with max 64 nodes and max 10 transistors.

InstallationofOrCadPSpicever9.2liteedition
Follow the installation guideline, choose Capture and PSpice, Layout is optional, this software could also be used to draw the layout of printed circuit bords.

Additional information how to handle the software could be found in online manuals or in the Learning Capture lessons in Capture help menu.

Startanewdesignproject
Start the schematic drawing program Capture. Select File / New Project be sure to choose Analog or Mixed A/D. Browse to the location where you want to save your project and give the project a name

1(16)

A schematic capture window should open now.

To the left is the project manager window. If the schematic window do not open, double-click on PAGE1 in the project manager window.

Starttomakeaschematicdrawing
In the schematic window choose Place / Part. The first time you run the program you have to add PSpice libraries. Select Add Library and select all libraries in the PSpice library folder. Be sure to use the symbols in .\OrcadLite\Capture\Library\PSpice. Other symbol libraries might have symbols not intended for PSpice simulation. (Those symbols are used for layout and design of printed circuit boards.)

2(16)

In this example we will be drawing and simulating this design

Use these commands to draw the schematic Place / Part MbreakN MbreakP 0 NMOS transistor, library BREAKOUT PMOS transistor Library Source, you might have to add this library from PSpice folder to find the ground symbol with the name 0, in SPICE there has to be one node with the name 0 as an electrical reference. DC voltage source, library Source DC current source

Place / Ground

Place / Part

VDC IDC

Place / Wire Place / Net Alias

connect components with wires add name to nets in your design and it will be easier to find signals or connecting nets without actually drawing wires (VDD and VSS). Nets with the same name are connected

Start drawing by placing MbreakN

Double-click on the symbol to start the Property Editor. Chose Filter by: Orcad PSpice, select the row, right-click and choose Pivot if you want a vertical column. Give value 0.5um and 50um to length (L) and width (W) of the transistor. Mark W and press Display... select name and value, to make it visible in schematic. Do the same with L. ( 0.5u means 0.5 m )

3(16)

Suppose we want to examine the current to voltage characteristics of this transistor. We connect DC voltages to gate-source and drain-source, here they are renamed to VGS and VDS. Also name the nets G and D (guess why!) to make it easier to reference to them later.

To be able to simulate this: change MbreakN to nMOS (property Implementation). nMOS is the name we give the MOS model. Setup simulation: PSpice / New Simulation Profile

Next we need a SPICE model for the transistor and to connect the model to the actual transistor. MOS_models should be in a plain text file and look something like this
* PSpice Model Razavi Table 2.1 *$ .model nMOS NMOS + LEVEL=1 VTO=0.7 GAMMA=0.45 + NSUB=9E+14 LD=0.08E-6 UO=350 + TOX=9E-9 PB=0.9 CJ=0.56E-3 + MJ=0.45 MJSW=0.2 CGDO=0.3E-9 *$ .model pMOS PMOS + LEVEL=1 VTO=-0.8 + NSUB=5E+14 LD=0.09E-6 + TOX=9E-9 PB=0.9 + MJ=0.5 MJSW=0.3 *$

PHI=0.9 LAMBDA=0.1 CJSW=0.35E-11 JS=1.0E-8

GAMMA=0.4 UO=100 CJ=0.94E-3 CGDO=0.3E-9

PHI=0.8 LAMBDA=0.2 CJSW=0.32E-11 JS=0.5E-8

Name this model file Table_2_1.lib (or any other name you like) and copy it to the folder where your design is located (or any other folder you prefer). This model is from Table 2.1 in Razavi, Design of Analog CMOS Integrated Circuits.

4(16)

In the tab Libraries in the simulation profile, browse to the model file and add it to the design.

The model file Table_2_1.lib is now added to design. You can check the model of the transistor in your schematic by selecting the transistor, right click and choose Edit PSpice Model

It is possible to change model parameters with this editor.

5(16)

Simulation
Now the design is ready to be simulated! PSpice / Run or the Play button. A new window appears (Probe Window) where simulation results can be plotted. Trace / Add Trace... and select I(D)

This plot will be generated in the probe window.


8.0mA

6.0mA

4.0mA

2.0mA

0A 0V ID(M1) V_VGS 0.2V 0.4V 0.6V 0.8V 1.0V 1.2V 1.4V 1.6V

The plot could be cut and paste to your word processor by using Window / Copy to Clipboard . Use this instead of taking a screen shot to avoid the black background. It saves toner or black ink when you are printing your reports!

6(16)

You can make the program plotting this result immediately after simulation if you add a Current marker at the drain pin of the transistor. (PSpice / Markers / Current Into Pin)

As a next step, lets make a nested DC sweep. PSpice / New Simulation Profile and name it DC-nested-sweep Give values for Primary sweep: VDS 0V to 3V with 0.01V step (this is one curve) Secondary sweep: VGS 0V to 1.5V with 0.1V step (one curve for each VGS-value)

Result in Probe Window:


10mA

8mA

6mA

4mA

2mA

0A 0V ID(M1) V_VDS 0.5V 1.0V 1.5V 2.0V 2.5V 3.0V

7(16)

Simulating a simple amplifier Now lets make a simple amplifier with this transistor. From the ID-VGS-plot we select a bias voltage VGS= 1.2 V corresponding to a drain current ID= 2.84 mA. Suppose we want to design an amplifier with supply voltage VDD = 3 V and bias point VGS= 1.2 V, VDS= 1.5 V and ID= 2.84 mA We just need to add an external drain resistance RD= 528 . ( RD = Before we do this, lets check the Project manager window We have this far created two simulation profiles. We could easily switch between which one to choose as active profile. With the mouse, select, right-click and choose Make Active. We now want to make a new schematic drawing without destroying the old one. Let us manage this in the project window. First, rename the current schematic to a better name describing what kind of schematic it is. Select SCHEMATIC1, right-click and rename it to Transistor The select .\problem_x.dsn, right-click and create a new schematic with the name Amplifier Then in the same way, create a new schematic page.

VDD VDS 3 1.5 = = 528 ) 2.84m ID

Now the project window looks like this. Transistor is still the root schematic in your design. Make Amplifier the root design (select, right-click ...) Usually you are urged to save the design before it could be the root design. Then, from the /Transistor/PAGE1 select the drawing in your schematic and copy and paste it into the Amplifier PAGE1 Now you can use this schematic drawing as a base to create a new one.

8(16)

Now, make a drawing of this amplifier (at PAGE1 in schematic Amplifier):

BiaspointsimulationcalculatesDCcurrentsandvoltagesinthenet
Create a new simulation profile with the name Bias-point, mark Output File Options and Calculate small signal gain (TF.) from input net Vin to output voltage V(Out). Sometimes when you create new simulation profiles you could inherit and copy it from an existing profile, but in this case it is easier to create a new one.

Run a simulation. This simulation calculates the DC voltage and currents in the net. From bias point information a small signal linear model is created and the small signal transfer function is calculated. After the simulation the DC voltages, current or power can be shown in the schematic. This could be toggled ON or OFF with buttons .

9(16)

If you take a peek into the output file PSpice / View Output File you can find this information:
**** SMALL-SIGNAL CHARACTERISTICS V(OUT)/V_Vin = -5.305E+00 INPUT RESISTANCE AT V_Vin = 1.000E+20 4.671E+02

OUTPUT RESISTANCE AT V(OUT) =

and information about DC voltage and currents for the transistor and the small signal parameters in the bias point
**** MOSFETS

NAME MODEL ID VGS VDS VBS VTH VDSAT Lin0/Sat1 if ir TAU GM GDS GMB CBD CBS CGSOV CGDOV CGBOV CGS CGD CGB

M_M1 nMOS 2.84E-03 1.20E+00 1.50E+00 0.00E+00 7.00E-01 5.00E-01 -1.00E+00 -1.00E+00 -1.00E+00 -1.00E+00 1.14E-02 2.47E-04 2.69E-03 0.00E+00 0.00E+00 0.00E+00 1.50E-14 0.00E+00 4.35E-14 0.00E+00 0.00E+00

Biaspoint(quiscentpoint) DrainDCcurrent GatetosourceDCvoltage DraintosourceDCvoltage BodytosourceDCvoltage Thresholdvoltage VDSsaturationvoltage=VGSVTH=1.20.7

Smallsignalparameters Transconductancefromgatevoltagetodraincurrent OutputconductanceGDS,outputresistancero=1/GDS Transconductancefrombodyvoltagetodraincurrent

The small signal voltage gain for this amplifier is


1 Av = g m ( ro // RD ) = 1.14 10 2 // 528 = 5.3 4 2.47 10

in agreement with simulated

V(OUT)/V_Vin = -5.305E+00

In output file you also find information about MOS model parameters. A comment on some values that may confuse you: nMOS NMOS LEVEL 1 L 100.000000E-06 W 100.000000E-06 10(16)

ThesevaluesofLandWinoutputfileisdefaultvalues.Inourcase thesearenotguilty.LandWisspecifiedinschematicdrawing

ACanalysissmallsignallinearmodelcalculations
In AC analysis a linear small signal model, valid for the transistor in the bias point, is used to calculate the frequency response of the circuit. Different sources are used for different kind of analysis. Change the VDC source to VAC and specify the DC-voltage and small signal voltage for all sources used to generate signals for AC analysis.

Set up a new simulation profile. Do not change the old one, maybe you want to switch back to it later. I call this one Frequency sweep. If you mark Include detailed bias point information.... you get the information about bias point DC voltages, current and small signal parameters for the transistor in the output file (same as on previous page).

Check in the output file that you have the correct bias point
NAME MODEL ID VGS VDS VBS M_M1 nMOS 2.84E-03 1.20E+00 1.50E+00 0.00E+00

This simulation runs from 100 Hz to 100 MHz. Note that you have to write MEG for M (106). For historical reasons SPICE does not distinguish between upper and lower case letters. Marking Logarithmic makes the calculated frequencies to be distributed at equidistance in a logarithmic scale.

11(16)

Run the simulation! If you want to plot the gain in Probe window: Add / Trace and V(Out)/V(In)
5.30471

5.30470

5.30469

5.30468

5.30467

5.30466

5.30465 100Hz V(OUT)/ V(IN)

1.0KHz

10KHz

100KHz Frequency

1.0MHz

10MHz

100MHz

As expected the gain amplitude is 5.3. The gain goes down slightly at high frequencies. In this case all capacitances are not included in the transistor model so the simulation is not correct at high frequencies.

Always be suspicious and check if the output seems to be right!


In Probe window it is possible to do different kind of calculations based on simulated results. There are also different functions available in Probe. For more information, refer to the Analyzing waveforms chapter of the PSpice Users Guide, or the PSpice online help. DB() P()
14.49324

deciBel calculation phase calculation, 180 degrees at low frequencies in our simple inverting amplifier

14.49320

14.49316

SEL>> 14.49312 DB(V(OUT)/ V(IN)) 180.0d

179.9d

179.8d

179.7d 100Hz 1.0KHz P(V(OUT)/ V(IN))

10KHz

100KHz Frequency

1.0MHz

10MHz

100MHz

12(16)

Capacitancesdependentonareaofdrainandsource
If the transistor capacitances at the reverse biased PN-junctions from drain and source to the transistor body (substrate) should be present in the simulation model we have to specify the area and perimeter of drain and source. This is done by giving values to the attributes AD and AS PD and PS drain and source area in m2 drain and source perimeter in m

Assume that the geometry of the transistor is as in figure 2.32a in book and E= 1.5 m. In our simualtion example W= 50 m. AD = AS = WE = 501.510-12 m2 = 7510-12 m2 PD = PS = 2(W+E) = 2(50+1.5)10-6 m = 103 m

RD 528

Out 3Vdc M1 In VOFF = 1.2V VAMPL = 1mV FREQ = 1000Hz AC = 1mV DC = 1.2V L = 0.5u W = 50u AD = 75p AS = 75p PD = 103u PS = 103u

VDD

Vin

nMOS

From output file


CBD CBS CGSOV CGDOV CGBOV CGS CGD CGB
15.0

2.73E-14 4.24E-14 0.00E+00 1.50E-14 0.00E+00 4.35E-14 0.00E+00 0.00E+00

Somethingtothinkabout: Whyaresomeofthecapacitanceszero?

12.5

SEL>> 10.0 DB(V(OUT)/ V(IN)) 180d 160d

120d 100d 10KHz 100KHz P(V(OUT)/ V(IN))

1.0MHz

10MHz Frequency

100MHz

1.0GHz

10GHz

13(16)

Transientanalysiscalculatesvoltagesandcurrentsasafunctionoftime
In transient analysis the voltages and currents are calculated using large signal models of the transistor, i.e. the transistor equations. The analysis calculates voltages and currents in the circuit as a function of time. Now replace the AC voltage source VAC to voltage source VSIN from library source! This specifies a sinusoidal input voltage.

VSIN could also be used for AC-analysis (AC=) and DC analysis (DC=). Those attributes is not visible as default, but by now you now how to make it visible. Once again, create a new simulation profile. I have named it Time sweep this time.

If maximum step is not specified, it will be the end time divided by 50 (TSTOP/50). The calculation step is dynamically adjusted to get high accuracy in calculation. Maximum step size is the time step used to save data from simulation. Sometimes, if maximum step size is not specified, the plotted curve is not so smooth. To change the maximum step size to a smaller value will save more data and make the plotted curve smoother.

14(16)

Input voltage
1.2010V

1.2005V

1.2000V

1.1995V

1.1990V 0s V(IN) Time 1ms 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms

Output voltage
1.510V

1.505V

1.500V

1.495V 0s V(OUT) Time 1ms 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms

Using markers to read the peak-to-peak value of output voltage gives 10.6 mV. Input voltage peak-topeak value is 2 mV.
Av = Vout 10.6m = = 5.3 2m Vin

The output voltage is in opposite phase compared to the input voltage.

Av= -5.3

If we increase the amplitude of the input voltage to peak value 0.5 V (VAMPL=0.5V) we can see that the output is heavily distorted and clipping of output voltage occurs.
3.0V

2.5V

2.0V

1.5V

1.0V

0.5V

0V 0s V(OUT) Time 1ms 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms

15(16)

Types of simulations Transient analysis Bias point DC sweep calculates currents and voltages as a function of time. This analysis use large signal models, i.e. transistor transfer equations. calculates DC operating point calculates DC values when one of the DC sources is changing its values. Sweep could be nested, that means that one DC sweep could include sweep of another source. calculates small signals as a function of frequency. This analysis use a linear small signal model.

AC analysis

Note that different sources are specified for DC, transient and AC analysis. Sources used for transient analysis like VSIN could be used also for DC and AC analysis if the corresponding attributes is given values. Some hints: SPICE makes no distinction between capital and lower case letters, use MEG for meg, M means milli. Values and prefix should be typed without spaces. For example: 10u not 10 u

DC voltages (or current) can be shown in schematic, press button V in Capture schematic window. Voltage level markers (or current) could be used in Capture to show voltage immediately after simulation in output display. Sometimes you could get an error message ERROR -- Node xxx is floating, e.g. if you have two capacitors in series the program cannot solve for the DC voltage at the connection point. You can trick the program to calculate DC voltage if you put a large resistor like 1 G to ground or in parallel to one capacitor. Inoutputdisplay(Probewindow): A common problem is that when you change the circuit and resimulate it you want the same trace expression as in last plot after a new simulation. You dont need to type in the same expression, just restore the expression Windows / Display Control... LAST SESSION Restore

CopytoWordorotherwordprocessorprogram: In capture, just select the circuit you want to copy and use cut and paste to Word. In output window (Probe windows) Window / Copy to Clipbord and paste the picture in Word.

16(16)

S-ar putea să vă placă și