# Introduction to Electronics/Lecture SPICE

* EE90 Edit/View
* Electronic Engineering
* EE Introduction to Electronics
* Lecture, Test Equipment
* Lecture, Smart test equipment
* Lecture, Mounting Techniques
* Lecture, Soldering
* Lecture, Schematics
* Lecture, SPICE
* Mid-term Exam
* Final Exam

## INFO

For this lecture LTspice 4 will be used. It is a freely avalable spice applcation that rivles most high end commercial SPICE programs in ease of use and speed of simulation(circut dependant).

## Setting up LTspice 4 from Linear Technology

You can download LTspice 4 from Linear Technology at Download LTspice IV. Default install path is C:\Program Files\LTC\SwCADIII or C:\Program Files\LTC\SwCADIV. You may also for your own convenance install it to C:\LTC\SwCADIV as you will need to access the folder frequently.
LTspice IV will install and run under wine in linux with no speed penalty, this may be more desired over windows as certan linux configurations can better deal with high memory ussage and high cpu ussage applcations.

## File structure

* SwCADIV
** examples
*** educational: contains many electronics circuts demonstrating electronic principals and other systems
*** jigs: contains working test circuts of many LT switching power supply regulators
*** SMPS: contains working example circuts of many LT switching power supply regulators
**** boost
**** buck
**** cuk
**** flyback
**** inverting
**** sepic
**** zeta
*** Wurth: Würth Elektronik modal use examples
** lib
*** cmp: standard component modal lists plain text 1 line per modal
**** standard.bead
**** standard.bjt: bi junction transistor modals
**** standard.cap: capaictor modals
**** standard.dio: diode modals si, zenner, Schottky, varactor, LED
**** standard.ind: inductor modals
**** standard.jft: JFET (Junction Feald Effect Transistor) modals
**** standard.mos: MOSFET (Metal Oxide Semiconductor Feald Effect Transistor) modals
**** standard.res: Resistor modals
*** sub: subroutines or complex modals for devices
*** sym: Schmatic Symbols that are linked to standar componet modals or subrotine modals

## Getting spice files

No matter what spice program you use, the most important feature is the ablity to easily add new spice modals to it. No spice simulator will have all models you will ever need, its a certanty you must add to the existing libary. In fact plan to add 1 or more models to every circut you design regardless of what spice app you choose.

### Fairchild

Fairchild makes their models available via email address. You will need a ISP or Commercial email address or a address with a custom domain name(i.e. me@mycompany.com, me@nebraskannet.com or free domain me@mysite.servegame.com). I have found address from places like Gmail and HotMail wont work.
FDC610PZ product page a part used in EE 230 SMPS fundamentals At the bottom of the page we see a chart that lists the electrical and thermal simulation models available. Choose Electrical. Enter your email address and submit. Installing
* Most Fairchild models are to detailed and complex to work in the standard.mos, standard.jft or standard.bjt.
* Once you have received the file download it to SwCADIV/lib/sub make sure the file ending is .sub or .lib
* Open the file with notepad (associate .lib and .sub with your text editor of choice you will need this)
* at the top you should see a .SUBCKT command
This is the subckt name and the pins in order thay need to be to work with the symbol. This works as node2 pin1 node 1 pin 2 node3 pin3. The number specified is the node the pins are always in numerical order.
* Make a new folder fet so the path is SwCADIV/lib/sym/fet and open the folder
* You should be at SwCADIV/lib/sym/fet go back to SwCADIV/lib/sym and copy nmos.asy to SwCADIV/lib/sym/fet
* Rename SwCADIV/lib/sym/fet/nmos.asy to SwCADIV/lib/sym/fet/FDC610PZ.asy
* Open the file in notepad you will see these lines in the file
* change this to
* SpiceModel tells ltspice to use this subcircut so we don't need to do a .include FDC610PZ.lib in ower spice circuit
* Value2 and Value specify how the name looks on the schmatic and what the name is in the subcircut file
* prefix M makes the part id in the schematic M ie M1 M2 M3
* Description is shown when right clicking on the part in the schmatic and in the choose part window I prefer to include info such as Vds$_{max}$, Rds$_{on}$, Ads$_{max}$, Vgs$_{max}$.
* the part shuld now be ready to use
4 pin mosfets or temp pin
* normaly you will see .SUBCKT FDC610PZ 2 1 3
* but if you see .SUBCKT FDC610PZ 2 1 3 4 it is a 4 pin or temprature model device
4 pin mosfets are done exactly the same as the above 3 pin mosfets with this execption.
* at the end of the .ASY or symbol file add
* when using this part tie this 4th pin to a voltage source of 1v per degree celcius you wish to simulate for normally 25v or 25c.

### ON Semiconductor

ON Semiconductor makes spice models available freely for download at the product page.
For this guide we will use a Schottky diode MBRA160T3. To get the model under "Technical Information" go to "Simulation Models (4)" you will want SPICE3 model or .sp3, sp2 or lib should work as well.
* The original spice model is copyright ON semiconductor & Symmetry Design Systems.
* Fake data has been listed here which will work to effectively show how to preform this operation.
* Use the real data from the manufactures website when doing these steps.
inside this file we find
This code will need some cleanup to make it work with LTspice 4.
* Open in notepad SwCADIV/lib/cmp/standard.dio it is a text file
* go to the last line and make a new line.
* copy the real spice model from the spice file from ON to the bottom
* LTspice prefers each model to take up one line in this file so you will need to edit the file like this. the "+" is a line continuation and it should be removed.
* add parenthesis
* add LTspice specific information you can review the other models in the standard.dio to see the other options.
** Iave=1 maximum average forward current from datasheet
** Vpk=60 maximum reverse voltage before boom from datasheet
** mfg=Onsemi
** type=Schottky
* This file is listed as it will be shown by default, unsorted in the menu. If you prefer you may move the lines around so certain parts are at the top by default.
Back to: Topic:Electronic Engineering