Adding libraries in PSpice and Modifying Part Parameters jh 4/99 ******************************************************** How to add a part library Your msim.ini file specifies what libraries are available when you use the part browser. For example, the msim.ini file for ece500 has the following libraries: [PART LIBS] LIB1=abm [.slb] LIB2=analog [.slb] LIB3=breakout [.slb] LIB4=connect [.slb,.plb] LIB5=eval [.slb] LIB6=port [.slb] LIB7=source [.slb] LIB8=special [.slb] Let's say you want to add the diode library. 1. Locate the path to the library. The fastest way is probably to work from the unix prompt and use ls to look through the directory structure. The libraries supplied by MicroSim with PSpice are located under: /cad/pspice/lib other OGI specific libraries are located under: /cad/pspice.ogi/ogilib /cad/pspice.ogi/triquint /cad/pspice.ogi/maxim Under /cad/pspice/lib we find: diode.ind diode.lib diode.plb diode.slb We at least need the .lib and .ind files to exist. You can also look for part libraries from within psched. You can browse for libraries within the Library Settings window (see below on how to get there). 2. Start psched and click on Options, Editor Configuration. An Editor Configuration window will appear. Click on Library Settings; a Library Settings window will appear. 3. In the Library Settings window look at the Library Path box. It must include the directory that contains the new part library. In this example, diode.lib is in the directory /cad/pspice/lib which happens to be listed in the Library Path box. 4. In the "Library Name" field type: diode Don't add the .lib extension. Don't press the enter key. Now click on Add* and click on OK; the Library Settings window will close. Now click on OK in the Editor Configuration window. That window will close and now you can select parts from the diode library. The effect of all this is to add the following to your msim.ini file: LIB9=diode [.slb] which you can do manually if you prefer by editing msim.ini with with a text editor such as vi. Be careful to not skip library numbers or put the numbers out of order if you try this shortcut. Double quotes around the library name appear to be optional. You can also manually edit the library path. It is the "LIBPATH" statement usually on the second line of your msim.ini file. ******************************************************** Modifying Part Parameters Sometimes it is useful to change a parameter (area, capacitance, etc.) for a part you are simulating. ******************************************************** How to change part parameters The simple method is to double click on the part on the schematic. A attribute edit box will appear. It lists the attributes for the part. If the attribute is marked with an asterisk it can't be edited from this box. Otherwise you can edit it for this part. If it is marked with an asterisk you need to use the model editor to change the value of the parameter. ******************************************************** How to use the model editor For example, assume D2 on your schematic is a D1N4148. 1. Left-click on D2 on the schematic to select it. The part will become red. 2. Select Edit, Model. An "Edit Model" box will appear. A new model name is automatically generated, in this case, it will be D1N4148-X. Select "Edit Instance Model..." since you want to edit some parameters of this particular part (this instance of the part). 3. A "Model Editor" window will appear with the new model name. The "Save To" box selects the library where the newly edited model (D1N4148-X) will be placed. By default the library will have the same name as your schematic. If you want to use the new model in other schematics, select another library name (perhaps my.lib) in your home directory or other working area. The new library file will be created if it doesn't already exist. It will be included in your list of libraries for this schematic. See below for how to include it for all schematics. Don't hit the enter key yet or the window will exit without making any changes! 4. Move the mouse to the list of parameters and select and edit the value you want to change. For example, you could change: Bv=100 to Bv=10 to modify the breakdown voltage. 5. Click on OK. The Model Editor window will disappear Now if you double-click on the part you should see that it has the new model name (D1N4148-X). If you want to use this new model for another part on the page, select the other part (for example, D7). Select Edit, Model and click on "Change Model Reference...". ******************************************************** To use the new library in other schematics: 1. Select Analysis, Library & Include Files ... 2. For file name enter the full path of the new library. For example: /ogi/class/myname/mylib 3. Click on "Add Library* ". This puts the library name in your msim.ini file so the each time you run PSpice it will be included. ******************************************************** Generic Parts: Dbreak, Nbreak, etc. The PSpice "breakout" library (breakout.slb) is a collection of generic parts which are provided as parts which have parameters which you can modify. I assume that these parts use the default values of the model parameters. Chapter 2 of the MicroSim PSpice A/D manual lists the model parameters. Part description need model editor to modify Dbreak diode yes, except for area QbreakN npn bipolar yes, except for area QbreakP pnp bipolar yes, except for area MbreakN N channel mosfet no MbreakP P channel mosfet no MbreakN3 3 lead N channel mosfet no MbreakP3 3 lead P channel mosfet no For the mosfets you can double click on the part and edit all the attributes (length, width, etc.). For the bipolars only the area can be changed this way; for the other parameters you need to use the model editor (described above).