CHAPTER 1
Getting Started
1
Chapter Outline 1.1 Starting Capture 1 1.2 Creating a PSpice Project 2 1.3 Symbols and Parts 7 1.3.1 Symbols 7 1.3.2 Parts 8 1.3.3 Placing PSpice Parts 10 1.4 Design Templates 13 1.5 Summary 13
1.5.1 Saved Designs 15 1.5.2 Opening Designs Created in Earlier Versions of OrCAD 15 1.6 Exercises 15 Exercise 1 15 Exercise 2 18 1.7 Extra Library Work 20
Those of you who are familiar with setting up projects and drawing schematics in Capture may want to skip this chapter, as it has been written for those of you who have little or no experience of using Capture. This chapter will describe how to start Capture and how to set up the project type and libraries for PSpice simulation. At the end of each chapter there are some exercises to do and as you go through the book, each chapter will build upon the exercises from previous chapters.
1.1 STARTING CAPTURE Circuit diagrams for PSpice simulation are drawn in either Capture or Capture CIS schematic editor. The CIS option, which stands for Component Information System, allows you to select and place components from a component database instead of selecting and placing components from a library. For this book, it does not matter whether the circuits are drawn in Capture or Capture CIS. If you have the OrCAD software installed, launch Capture or Capture CIS, by clicking on: Start > Program Files > OrCAD xx.x > Capture
or Start > Program Files > OrCAD xx.x > Capture CIS Analog Design and Simulation using OrCAD Capture and PSpice. DOI: 10.1016/B978-0-08-097095-0.00001-5 Copyright Ó 2012 Elsevier Ltd. All rights reserved.
2
Analog Design and Simulation using OrCAD Capture and PSpice
where xx.x is the version number, e.g. 10.5, 11.0, 15.5, 15.7, 16.0, 16.2, 16.3, 16.5 and 16.6. For example: Start > All Programs > Cadence > OrCAD 16.6 Lite > OrCAD Capture CIS Lite Start > All Programs > Cadence > Release 16.5 > Capture
If you have the Cadence software installed, the tools are installed under the Allegro platform name. In this case, only Capture CIS is available and is branded as Design Entry CIS: Start > Program Files > Allegro SPB xx.x > Design Entry CIS
1.2 CREATING A PSPICE PROJECT New designs started in Capture will automatically create a project file (.opj) which will reference associated project files such as the schematics, libraries and output report files. Before the circuit diagram is drawn, the project type and libraries required for the project need to be set up. First of all a new project is created by selecting from the top toolbar: File > New > Project
In the New Project window (Figure 1.1), you enter the name of the project and then you have a choice of one of four project types: Analog or Mixed A/D is used for PSpice simulations. PC Board Wizard is used for schematic to PCB projects. FIGURE 1.1 Creating a new project.
Getting Started CHAPTER 1 Programmable Logic Wizard is used for LD and FPGA designs. Schematic is used for schematic and wiring diagrams. When you select a Project type, the Tip for New s gives a brief explanation of the project type. For PSpice projects, select Analog or Mixed A/D. This will activate the PSpice menu on the top toolbar in Capture. It is recommended that a new directory location (folder) is created for each new project. This can be done by clicking on the Browse. button shown in Figure 1.1, which opens up the Select Directory window shown in Figure 1.2. FIGURE 1.2 Creating a project folder location.
By selecting the Create Dir. button, the Create Directory window (Figure 1.3) appears, which allows you to name the directory (folder). FIGURE 1.3 Creating the project folder.
The created folder, PSpice Exercises in this example, will appear in the Select Directory window. However, you must highlight and select the folder by clicking twice with the left mouse button, which will show the ’open’ yellow icon as shown in Figure 1.4. A further subdirectory or folder can be created by clicking on the Create Dir. in the Select Directory window button and following the same procedure above.
3
4
Analog Design and Simulation using OrCAD Capture and PSpice
The project folder location will then appear in the Location box of the New Project window (see Figure 1.1). FIGURE 1.4 The project folder has been selected.
An alternative method of creating the project folder is to type in the folder location directly into the Location box in the New Project window in Figure 1.1 and Capture will automatically create the folder.
NOTE It is a common mistake to create a project folder and not select the folder. Make sure you double click on the created folder name in the Select Directory window (Figure 1.4).
The next window to appear is the Create PSpice Project window, which sets up the project for PSpice simulation (Figure 1.5). The pull-down menu option allows you to select preconfigured Capture-PSpice libraries for the project. The most commonly used option for new projects is Simple.opj, which adds the following five default libraries to the project: Analog.olb Breakout.olb Source.olb Sourcstm.olb Special.olb
Getting Started CHAPTER 1
FIGURE 1.5 Create PSpice Project.
These libraries contain the most commonly used parts for PSpice projects and are recommended for new projects. There is also an option to create updated versions of an existing project, i.e. to create a newer version 2 based upon the original version 1 project. In the Create PSpice Project Window (Figure 1.5), select the function Create based upon an existing project and then Browse to select an existing project. This will copy the existing project and all its associated files into the new project. This is similar to using the File > Save As function. If the Create a blank project option is selected, then no Capture-PSpice libraries are added to the project. The libraries can be added later. This will be demonstrated in one of the exercises at the end of this chapter. When a new project is created, a Project Manager window is created (Figure 1.6) which shows the absolute path to the libraries. that these are Capture symbol libraries which define the graphics for the parts. They are not the PSpice model libraries. The Capture libraries are installed by default and can be found, depending on the OrCAD or Cadence software version you are using, for example, at: <software install path> OrCad > OrCAD_10.5 > tools > capture > library > pspice
or <software install path> Cadence > SPB_16.3 > tools > capture > library > pspice
5
6
Analog Design and Simulation using OrCAD Capture and PSpice Normally the <software install path> is the C: drive.
FIGURE 1.6 Project Manager showing the Capture parts libraries and their location.
TIP If the Project Manager window is not displayed, select from the top toolbar, Window > <project name>.opj file (Figure 1.7). Here the project name is resistors. Note the project name file extension .opj.
FIGURE 1.7 Displaying the Project manager window.
Alternatively, click on the Project manager icon
or
.
Getting Started CHAPTER 1
1.3 SYMBOLS AND PARTS 1.3.1 Symbols Before drawing a schematic diagram, it is useful to know the difference between a part and a symbol. Symbols differ from parts in that they are not placed from the Place Part menu in Capture. You have to select the symbol from the Place menu (Figure 1.8).
FIGURE 1.8 Place menu.
The Place menu also shows the corresponding shortcut keys. For example, to place a Power symbol, press F and the Place Power menu appears as shown in Figure 1.9. FIGURE 1.9 Place Power menu.
Wires connected to symbols take on the name of the symbol. For example, to define a wire to be connected to zero volts, you place a ’0’ symbol. To define a þ5 V connection you can use a VCC_CIRCLE symbol and rename it þ5 V. All wires connected to the þ5 V symbol will take on a net name of þ5 V. A net is a wire connection. There are many different symbols you can use to define the power and grounds connections and you can rename them accordingly.
7
8
Analog Design and Simulation using OrCAD Capture and PSpice
In the Place Power menu in Figure 1.9, a VCC_CIRCLE symbol has been selected and its name has been changed to þ5 V. Any wires (nets) connected to þ5 V will take on the net name þ5 V. Other symbols include hierarchical ports and off-page connectors which allow signals to be connected together throughout the design. These will be discussed in Chapter 20. There are two symbol libraries, source and capsym. Capsym contains all the analog ground and power symbols, while source, which also contains the analog 0V symbol, contains the digital $D_HI and $D_LO symbols, which are used to set a digital level of ’hi’ or ’lo’ on a wire or pin of a digital device.
1.3.2 Parts To place a part, select Place > Part. Figure 1.10a shows the Place Part menu for version 16.0 and Figure 1.10b shows the Place Part menu for version 16.3. Although the two menus look different they have the same functionality in that they display the list of libraries available and the parts available in the libraries; and they both provide a part search function. In Figure 1.10a, only the analog library has been highlighted and so only those parts for that library are shown in the Part List. FIGURE 1.10 Place part menu: (a) version 16.0; (b) version 16.3.
Getting Started CHAPTER 1
FIGURE 1.10 (Continued)
In Figure 1.10b, all the libraries have been highlighted and so you see the name of the part and which library it comes from. If you place the cursor over any part in the Part List, a tool tip rectangular bar appears showing the absolute path to the library part.
9
10
Analog Design and Simulation using OrCAD Capture and PSpice
NOTE Batteries, voltage sources and current sources are found in the source library from the Place Part menu (Place > Part) and are not to be confused with the power symbols (VCC_circle, 0V, etc.) from the capsym library (Place > Power or Place > Ground), which are effectively used to ’invisibly’ connect wires with the same net name together.
FIGURE 1.11 The source library for Place Power.
In the Place Power or Place Ground window (Figure 1.11) there is a source library which contains only the digital HI, digital LO and ground 0 V symbols. To recap, symbols are placed from the Place menu and parts are placed from the Place > Part menu. Also note that both Part libraries and Symbol libraries have an .olb extension and are the Capture graphical parts.
1.3.3 Placing PSpice Parts In release 16.6, there is a new feature which allows you to quickly place generic PSpice parts rather than search for vendor specific semiconductor device numbers. Parts are placed from the top tool bar Place menu as shown in Figure 1.12. Note that the ive parts are from the analog library except the Potentiometer which is from the breakout library. Figure 1.13 shows the selection of PSpice Discrete parts which are from the Breakout library. These are generic semiconductor parts with default names and parameters which can be customised using the PSpice Model Editor but the demo Lite version only allows you to edit diodes.
Getting Started CHAPTER 1
FIGURE 1.12 Placing a ive PSpice part.
FIGURE 1.13 Placing a discrete PSpice part.
NOTE If you know the actual semiconductor device number, then it may be best to find and use that known semiconductor device from the PSpice libraries. The generic parts are useful if you are new to electronics and you just want to get a circuit up and running quickly. Customising semiconductor parts from the Breakout library is mainly used for more advanced circuits where specific semiconductor characteristics are required.
11
12
Analog Design and Simulation using OrCAD Capture and PSpice
TIP The eval library which is available in both full and demo Lite software releases, contains general purpose standard analogue and digital semiconductors.
Figure 1.14 shows the selection of sources which are available. The voltage and current sources are from the source library whereas the controlled sources are from the analog library.
FIGURE 1.14 Placing a source PSpice part.
Figure 1.15 shows the selection of digital devices, if you have the full 16.6 software release, the gates and flip-flops are found in the dig_prim library and the ADC, DAC and Memory devices are from the Breakout library.
FIGURE 1.15 Placing a digital PSpice part.
At the time of writing, the digital gates and flip-flops are not currently available in the OrCAD Lite 16.6 version. They will be added in a later release. The ADC, DAC and Memory devices are from the Breakout library.
NOTE If you are using the demo 16.6 OrCAD Lite version, be careful not to use the gates and flip-flops from the gate and latch libraries. These devices do not have PSpice models and therefore cannot be stimulated.
Getting Started CHAPTER 1
1.4 DESIGN TEMPLATES From version 16.3 onwards, Design Templates have been added, which are complete electronic circuits and topologies including simulation profiles for analog, digital, mixed and switched mode power supplies. You can select any of these templates from the pull-down menu in the Create PSpice Project window when you create a new project (Figure 1.16).
FIGURE 1.16 Available design templates.
Figure 1.17 shows the Design Template for a Single Switch Forward Converter which includes the schematic and explanatory text.
1.5 SUMMARY Figure 1.18 shows the Project Manager created for a PSpice project and the checks that can be made to ensure that a PSpice project has been set up correctly. One common mistake is not selecting and highlighting the project folder that is created (see Figure 1.4). Another common mistake when creating a project is that the wrong project type has been created; for example you see PCB instead of Analog or Mixed A/D in the Project Manager title. One way around this is to create a new project (of the
13
14
Analog Design and Simulation using OrCAD Capture and PSpice
Single Switch Forward Converter Topology
K K1 K_Linear COUPLING = 1
L3
D4
Vout Vin 100Vdc
500u
MUR150
v
L1 500uH
Vs2
250uH L2
D5 MUR150
v
C4 50u
R_Load2 15
M3 IRFZ34
R1 33 V1 = -1 V2 = 8 TD = 0 TR = 1n TF = 1n PW - 25u PER = 100u
0
When the switch is on, diode D4 becomes forward biased and D5 reverse biased. Current through the inductor L3 increases. When the switch is turned off, inductor current circulates through the diode D5 and therefore causes inductor current to decrease linearly.
V5
0
0
FIGURE 1.17 Design template for a single switch forward converter topology.
Check project location (Fig. 1.2, 1.3)
Check Project manager title for Analog or Mixed A/D and added libraries (Fig. 1.1)
Selected Libraries. For example simple.opj (Fig.1.5)
FIGURE 1.18 Project Manager setup for a PSpice project.
correct type) and copy and paste the .dsn file from the previous Project Manager into the new Project Manager. From version 16.3 onwards, you can change the project type by highlighting Design Resources in the Project Manager and rmb > Change Project Type (Figure 1.19).
Getting Started CHAPTER 1
FIGURE 1.19 Changing project type.
1.5.1 Saved Designs In version 16.6, pages that are not saved in the design are now marked with an asterisk. Figure 1.20 shows that Page 2 in the RC schematic has not been saved and hence the schematic rc folder and design file, rc.dsn are also shown as not having been saved. FIGURE 1.20 Unsaved pages are marked with an asterisk.
1.5.2 Opening Designs Created in Earlier Versions of OrCAD In 16.6, you can open designs created in earlier versions of OrCAD without having to update the design. The designs will only be updated to 16.6 if you save the design.
1.6 EXERCISES Exercise 1 You will create a new PSpice project as discussed in Section 1.2 and name it resistors. The project will be created in a folder called, for example, C:\PSpice\resistors and will be configured with the simple five default libraries.
15
16
Analog Design and Simulation using OrCAD Capture and PSpice 1. Select File > New > Project. Enter resistors for the Name and select Analog or
Mixed A/D. In Location, enter C:\PSpice exercises\resistors or you can use your own folder location. Check your entries with Figure 1.21 and then click on OK. FIGURE 1.21 Creating a new PSpice project called resistors.
NOTE You can also use the Browse button to create and name the project folder.
2. In the Create PSpice Project window, select simple.opj as shown in
Figure 1.22 and click on OK. FIGURE 1.22 Selecting the simple.opj project template.
3. The Project Manager window will appear as shown in Figure 1.23. 4. Expand resistors.dsn by double clicking on it to open the SCHEMATIC1
folder (Figure 1.24). 5. Double click on SCHEMATIC1 to open PAGE1 and double click on PAGE1 to
open up the schematic page (Figure 1.25).
Getting Started CHAPTER 1
FIGURE 1.23 Project Manager window.
FIGURE 1.24 Schematic1 folder.
FIGURE 1.25 Page1 folder.
6. When you first open the schematic page, you will see some preplaced text and
two voltage sources preplaced. Delete the sources and text by drawing a box around the sources and text and pressing the delete key.
17
18
Analog Design and Simulation using OrCAD Capture and PSpice
Exercise 2 Draw the resistor network shown in Figure 1.26.
R1
FIGURE 1.26 Simple resistor circuit.
in
V1
out 10R
+ 10V
R2 10R
-
0
1. To place a resistor, select Place > Part and select an R from the analog.olb
2. 3. 4. 5.
library. Double click on the R and the resistor will attach to the cursor. In previous versions, click on OK and the Place Part menu disappears. From release 16.0 onwards, when you double click on a part or click on the Place Part , the menu will remain open. When you place the first resistor in the schematic, another resistor will be attached to the cursor; click rmb > Rotate or press R on the keyboard and place the second resistor. To exit place part mode, rmb > End Mode or press escape. Whenever a part is selected, there is an rmb context menu for place part options. P is the hotkey to place a part or you can select the Place Part icons, depending on which software release you have or . For R1 and R2, double click on the default resistor value of 1k and change its value to 10 R. Place the voltage source, which can be found in the source library. Change its voltage to 10 V. To place a ground symbol, Place > Ground (or press G) or click on the icon or and select the 0 V symbol from the capsym.olb library (Figure 1.27). To draw a wire, Place > Wire (or select the wire icon or or press W). You can always zoom in by pressing the ’I’ key on the keyboard, or ’O’ for zoom out.
NOTE To exit wire mode, press escape (Esc) on the keyboard or press W on the keyboard, which toggles wire mode on and off. If you make a mistake you can always select the . undo icon
Getting Started CHAPTER 1
FIGURE 1.27 Placing a 0 V ground symbol.
NOTE There are new features available from version 16.3 onwards to automatically connect wires to two or more points and a feature to automatically connect wires to a bus, which is described in Chapter 18 on Digital Simulation. To automatically draw a wire, select . Click on the first Place > Auto Wire > Two Points (Figure 1.28) or click on the icon wire point and then click on the second wire point.
FIGURE 1.28 Auto Wire allows for the automatic connection of wires and busses.
6. Capture automatically labels each wire connection, also known as
a node, with a node number, which by default is not displayed on the schematic. However, you can assign your own labels to wire nodes, which will give meaning to a node, i.e. input or output, and is useful when you want to analyze different nodes in a circuit. These labels are known as net aliases and are placed on a wire by highlighting a wire and then selecting Place > Net Alias (or selecting the net alias icon or or pressing N). 7. Save the project by selecting File > Save.
NOTE Parts can be pushed together such that when you move the parts away, wires are automatically drawn. Select Options > Preferences > Miscellaneous > Wire Drag and check Allow component move with connectivity changes on (Figure 1.29). This also allows parts to be moved onto a wire and to be connected.
19
20
Analog Design and Simulation using OrCAD Capture and PSpice
FIGURE 1.29 Enable Wire Drag to automatically connect wires to parts.
1.7 EXTRA LIBRARY WORK 1. Select Place Part to open the Place Part window and Add Library by clicking
on the icon (Figure 1.30). In previous versions, just click on Add Library. (see Figure 1.10a). FIGURE 1.30 Adding a library.
2. The Browse File window (Figure 1.31) will open. Make sure you are in
[install path] tools > capture > library > pspice and select the ana_swit.olb library and click on Open.
Getting Started CHAPTER 1
FIGURE 1.31 Browse library files.
3. Close Place Part. Has the library been added to the library list in the Project
Manager? Expand the Library folder. 4. In the Project Manager select the Library folder and rmb > Add File
(Figure 1.32). The Browse File window will open as in Step 2. Make sure you are in [install path] tools > capture > library > pspice and select the 1_shot.olb library and click on Open. FIGURE 1.32 Adding a library to the Project Manager.
5. Select Place Part. Has the 1_shot.olb library been added to the list of
Libraries? 6. In Place Part select all the libraries and click on Remove Library. Note which
libraries are now available. As you create new projects, any libraries added to previous projects in Place Part will be added to the list of available libraries. However, these libraries are not added to the Project Manager. Only libraries added via the Library folder in the Project Manager will be added to the configured list of Project libraries and these can only be deleted via the Project Manager. From version 16.2 onwards, when you select Place Part, the menu appears on the right-hand side of the schematic and reduces the available size of the schematic page. However, at the top right of the Place Part menu, there is
21
22
Analog Design and Simulation using OrCAD Capture and PSpice
a thumbtack icon (Figure 1.33) which gives you the option to effectively hide the Place Part menu. When you select the thumbtack icon, the Place Part menu disappears and the words Place Part appear (Figure 1.34). The menu reappears when you move the mouse inside the Place Part window box and retracts when you move the mouse back to the left. FIGURE 1.33 Hiding the Place Part menu.
FIGURE 1.34 Place Part menu contracted.
Thumbtack
Menu contracts and will only open again when the mouse pointer is moved inside the box.