ECE 210 Cadence Circuit Simulation Tool Fundamentals Cadence is a company that makes electronics design software. The particular program you will be using in this class is a circuit editor and simulation tool known by several names around the department, including Capture, PSpice, Schematics, and Cadence. You will be using this program in other electrical engineering classes and you may even use it after you graduate. Accessing Cadence To access Cadence tools from the start menu, select Programs > (Engg Apps for computers in Fiedler Library) > Cadence SPB 16.01 > Design Entry CIS A ‘Cadence Product Choices’ dialog box will pop up. Select Allegro PCB Design CIS XL and set it as the default if you wish. Figure 1 Selecting ‘OK’ opens the main Cadence window. Figure 2 Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) Open a new project by clicking File > New > Project. Choose Analog or Mixed A/D for project type (“Schematic” won’t do simulations). Give the project a name and place the project in a location that’s easy to find. Figure 3 A ‘Create PSpice Project’ dialog will pop up. This part is self explanatory. Create a blank project unless you want to use elements from an old project in a new project. For this first tutorial, select “Create a blank project”. Figure 4 Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) Figure 5 Creating a blank project opens the schematic editor. Before building your circuit, you can add the parts libraries by selecting Place > Part and then Add Library. This can make searching for components easier. Select all of the files in the PSpice folder and click ‘Open’. Alternatively, you can skip this and just use Place > Part, but this will require you to look through the many separate libraries when trying to locate a part in the Place > Part window. Figure 6 Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) Placing Parts After adding the libraries, you should have a long list of parts available to construct your circuit. Place parts by typing the part name into the text box highlighted in Figure 5. The most basic parts are shown in Figure 7 with their corresponding part names. For example, place a DC voltage source by typing ‘vdc’ into the text box, hit enter, and place the part wherever you want it. Figure 7 The parts in Figure 7 are shown in their default state. Change a component value by doubleclicking on the value. Part labels for nearly all parts can be changed by double-clicking on the label (i.e. V1 can be changed to Vs). Sources Sources require certain values to be set before they will simulate. Here’s a rundown of how to set up your sources. DC Voltage (VDC) and Current (IDC) Sources: The DC voltage and current sources are the most straightforward. However, remember that they have default values of zero. This becomes a problem when the user tries to power an amplifier with 0 V. Make sure to change your sources to the correct values or your simulations results will be incorrect. Changing the label of a source to 5 V doesn’t change the value of the source to 5 V (yes, this has happened). AC Voltage Source (VSIN): Notice that there are two AC voltage sources. VSIN is used for time domain (transient) simulations. You must give this source an amplitude (VAMPL), a frequency (FREQ), and an offset voltage (VOFF). Unless you want an offset voltage, set this value to 0. AC Voltage Source (VAC): The second AC voltage source is VAC. This source is used for frequency domain (AC sweep) simulations. This source comes ready to simulate. Pulse Voltage Source (VPULSE): This is another time-domain source that should only be used for time domain analysis. This source can be used in three different ways: 1) supply a single pulse to a circuit, 2) supply a delayed DC voltage, and 3) supply a square wave. VPULSE has several parameters that you must set before simulating. VPULSE can take on two voltage levels: V1 and V2. Delay the time that the supply is activated by setting a delay time (TD). Set the rise time (TR) and fall time (TF). As their names imply, these are the times it takes to jump from one voltage level to the other. Set the time the pulse is at V2 with pulse width (PW) and, finally, set the period of the waveform (PER). Making the pulse width half of the period will create a square wave with a 50% duty cycle. To create a 1 kHz square wave that varies between 0 and 5 V, set V1 = 0, V2 = 5, TD = 0, TR = 0, TF = 0, PW = 0.5m, PER = 1m. Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) Ground All circuits need a ground in order to simulate. For whatever reason, there are several different grounds available. The only one you should use is the ground labeled with a zero. Its part name is ‘0’ and it is found in the toolbar on the right-side of the Allegro Design Entry CIS window. You don’t have to run wires all over the screen to connect to a single ground. You can place any number of grounds in your schematic and they will all be connected to each other (provided you’re using the ground from the right-hand toolbar for each instance). Connectors Connectors offer a convenient way to connect two nodes without using a wire as shown in Figure 8. This helps when you want to avoid crossing wires and makes circuits look much nicer. Connect connectors together by giving them the same name. Connectors come in a variety of shapes. Ultimately, the Figure 8 shape doesn’t matter, if two connectors have the same name, they are connected. Although any connector will work, it’s best if you follow some convention. For this class, use VCC_BAR for power connections and VCC for signal connections (inputs, outputs, etc.). Other Construction Notes Here are a few other tips that help during the circuit construction process. All prefixes (m, k, n, etc.) are the same except micro and mega. Type ‘u’ for micro and ‘mega’ for mega. Cadence is case insensitive and interprets ‘M’ as milli. Rotate a part by selecting it and pressing ‘r’. Mirror a part horizontally by selecting it and pressing ‘h’. Mirror a part vertically by selecting it and pressing ‘v’. Connect parts using wires. Access wire mode either by pressing ‘w’ or by clicking on the wire button in the side menu. You should be able to make connections by dragging one component to another. If this isn’t working, go to Options > Preferences > Miscellaneous. Check the box labeled ‘Allow component move with connectivity changes’. In the same menu, you can uncheck the ‘Clear UNDO/REDO Data on Save’ if you want Cadence to remember your past moves (and avoid the annoying warning). To remove the dotted grid, go to Options > Preferences > Grid Display and uncheck ‘Displayed’ under the ‘Schematic Page Grid’ section. Do this before placing schematics into a text document. Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) The ‘V’ and ‘I’ buttons to the right of the marker buttons display DC voltages and currents at various points throughout the circuit. Simulation To simulate, create a new simulation profile by clicking on the first of the simulation buttons shown in Figure 5. A ‘New Simulation’ window will pop up. Figure 9 Give the simulation a name and click create to access the ‘Simulation Settings’ menu. Once here, choose the analysis type from the drop-down menu. Choose from Time Domain (Transient), DC sweep, AC sweep/Noise, and Bias Point simulations. Time Domain (Transient) Simulations: Use this simulation type to see how the circuit behaves over time (voltage vs. time, etc.). Of the five sources above, use VSIN and VPULSE when performing time domain analysis (DC voltage and current doesn’t change much over time). Figure 10: Time Domain Simulation Settings Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) ‘Run to time’ specifies the range of time Cadence simulates your circuit. The frequency of VSIN is the best indicator of how long to simulate the circuit. If the frequency of VSIN is 1 kHz, set TSTOP between 2 and 4 ms. If you want to look only at the steady state data and don’t care about the circuit’s transient response, use the ‘Start saving data after’ feature. This is useful when working with a circuit with a large time constant. Otherwise, the default of 0 is sufficient. It’s optional to specify a maximum step size. However, failing to specify one may result in waveforms that appear boxy because Cadence is plotting too few points. In general, make this number 100 to 1000 times less than your range, depending on the resolution you want. The smaller the number, the more precise your waveforms will be, but at a cost of longer simulation times. AC Sweep Simulations: Use this simulation type to perform frequency domain (transfer function) analysis (gain and phase vs. frequency). The VAC source must be used to perform this simulation. Figure 11: AC Sweep Simulation Settings Only concern yourself with what is inside the ‘AC Sweep Type’ box. Unless otherwise specified, use a logarithmic scale using decades. Specify a starting frequency, an ending frequency, and the number of points per decade. One hundred points per decade should be enough. A starting frequency of zero will not work for a logarithmic scale. Click OK when you’re satisfied with the simulation settings. You can edit your simulation settings by clicking on the second of the simulation buttons shown in Figure 5. Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) At this point, you’re almost ready to simulate. Before you do, add markers, which tell Cadence which simulation results to display. A few marker buttons are shown in Figure 5. For time domain simulations, place a Voltage/Level Marker (V marker) at the output and, if you wish, at the input. Unlike the Voltage Differential Marker(s), the Voltage/Level Marker measures voltage with respect to ground. The simulation will then plot the output and input voltages with respect to time. For AC sweep simulations, use dB Magnitude of Voltage (VDB) and Phase of Voltage (VP) markers from the advanced markers menu and place them on the circuit’s output. The simulation will then plot the gain in decibels and the phase in degrees with respect to frequency. Access advanced markers by selecting PSpice > Markers > Advanced. After placing markers, simulate your circuit by pressing the ‘Run PSpice’ button located third in the line of simulation buttons. The simulation window will open, showing the simulation results. Figure 12: Simulation Window (black backdrop removed through the magic of Paint) There are a wide variety of modifications you can perform once you’re in the simulation window. Double click on either axis to access the ‘Axis Settings’ window. Right click on the traces to modify their properties. Figure 12 shows the traces with different colors and thicknesses than they first appear in the simulation window. Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK) Use the ‘Toggle cursor’ button to take more accurate measurements on the graph. Left click controls one cursor while right click controls another. Use this feature to find the difference between two points on the graph. Edit traces by double clicking on the trace names in the lower left corner of the simulation window. You can also add traces from the Trace menu. The first brings up a ‘Modify Trace’ window and the second brings up an ‘Add Traces’ window. Both look the same. Figure 13: Add Traces Window From here, you can create (or modify) a trace to your liking. This menu is useful for quickly changing the traces to the measurements you need without going back to the schematic, placing a marker, and re-simulating. For example, a voltage trace can be changed to a decibel voltage trace by simply replacing V with VDB. You can then change the decibel voltage trace to a phase trace by changing VDB to VP. You can even add traces together, a feature that becomes useful when plotting the overall response of a crossover network. Created by Ryan Eatinger for Kansas State University; Special thanks to Dr. Ruth Miller and Tim Sobering; Updated on 3/30/09 (Version 2.1 – minor edits by WBK)