Build parts and choose models
12.1Choose the model a part uses
Give a placed part a manufacturer's model, so Simulate runs the real part.
- Double-click the part, or select it and press Ctrl+M.You should seeThe model dialog on the Library tab, listing models that fit this kind of part.
- Type the part number in the search box. Filter by maker or format with the chips.
- Click a row to see its maker, pins, status and the Live view line on the right.
- Click Assign.You should seeA message confirms it. The inspector header names the model.
ResultAssign is one undo step. It sets the model, the pin map and the live values, and the file Simulate loads.
| If you see | Do this |
|---|---|
| "its N pins (…) do not match this op-amp" | Place the model from the library instead, so it brings its own pins. |
| "encrypted: Simulate cannot run it" | Choose another model of the part, or install PSpice for TI if it's a TI model. |
See alsoLibrary tab, Tutorial 3: A regulator with a vendor model.
12.2Get a model from datasheet numbers
Build a working model from a few datasheet numbers when the library has none. Resistors and capacitors need none: type their value.
- Select the part and press Ctrl+Shift+M.You should seeThe Quick model tab: datasheet fields on the left, fitted parameters on the right.
- Type the values from the datasheet, for example for a MOSFET V_GS(th)
1.8, R_DS(on)8mat V_GS4.5.You should seeThe fitted parameters update as you type. - Click Apply.
- Optional: click Save as .bspart to keep it as a part file.
ResultThe part now behaves as the datasheet says at the test point. A part that had a vendor model is renamed model (fitted) and no longer loads the vendor file.
See alsoQuick model tab.
12.3Run a program on a microcontroller
Write a short program for a microcontroller and watch its pins drive the circuit around it.
Before you startA circuit with a supply, and an LED with a resistor to wire to the chip.
- Place the generic MCU (type
microcontrollerin the library search) and wire VDD and GND. - Select it, click Code in the inspector and pick a Template…, for example Blink.You should seeThe chip grows a pin for every
pinandbusline. - Wire the new pins to the circuit and press Ctrl+R. Edit the program in the code box and click away to apply it.
- Open Diagnostics (Alt+6) if the status line under the code shows a warning, and add what it says: a pull-up, a series resistor.
ResultThe program runs in simulated time and drives the pins like real ones. Probe a pin to see it on the scope.
| If you see | Do this |
|---|---|
| A red line in the code box | The status line says what to write instead, for example a unit after wait. |
W_MCU_PIN or W_MCU_BUS | A floating input, an overloaded pin or a missing I²C pull-up. Warnings you may see lists each fix. |
See alsoProgramming the MCU, Templates and examples.
12.4Make a part from a datasheet
Turn a datasheet into a part file with min, typ and max values, pins and an optional symbol and SPICE model.
- Press Ctrl+Shift+N and choose a template, for example Power · LDO regulator IC. Or type a part number in step 1, for example
TL431: when the library knows it, a line says TL431 is a Voltage reference in the library, and Start from it fills the template, the part number, the maker and the description. - Type the part number and the manufacturer (already filled if you started from a part number).
- Fill in the electrical values with their datasheet pages. Fields marked * are required for simulation.
- Pick the package (SOT-23-5, SOIC-8, ...), name the pins as the datasheet does and click Auto-assign functions, then check each device pin has a package pin. Optionally draw a symbol, import a KiCad one or pick one from My parts.
- On step 7, press Run the test circuit to compare the model with your values, and attach the vendor SPICE file if there's one.
- On step 8, click Save to My parts.You should seeThe part appears in My parts at the top of the library.
ResultA .bspart file. The live model uses the typical values. Progress is saved as you type, so you can close the wizard and come back.
| If you see | Do this |
|---|---|
| A red check in Checks | Click it to jump to its step. The field itself says what is wrong. |
| Save to My parts is greyed | A check still fails. Download draft saves the file as it is. |
| Change a saved part | Press Edit part on it in My parts. |
See alsoTutorial 4: Make a part with the Part Wizard, Part Wizard, Part templates reference.
12.5Add a datasheet graph to a part
Put a graph from a datasheet into a part file, and fit the model to it where the model can use it.
Before you startThe Part Wizard open on step 6, Curves.
- Find the editor for the graph, for example Output capacitance vs drain voltage.
- If the datasheet has a table, copy two columns and press Ctrl+V on the grid.You should seeThe rows appear in the grid with the units converted.
- If you only have the graph, paste a screenshot (Win+Shift+S, then Ctrl+V) or drop the image file on the area, and click Digitize an image.
- Click two known ticks on the x axis and type their values, say whether the axis is linear or logarithmic, then do the same for y.
- Click along the curve, or pick the curve's colour and press Trace the colour. Remove strays with Undo last, then press Use N points.
- Press Fit to the model, check the dashed curve and the error, and press Apply to the model.
ResultThe curve is saved with the part and marked read by eye if you digitized it. The fitted parameters appear on step 7.
| If you see | Do this |
|---|---|
| A unit error under the grid | The unit does not fit the axis. Type the value in the unit the axis shows, or let the header carry it. |
| A warning that the model is far from the points | The model's equation does not describe this part well, for example a square law against a power MOSFET at high current. Keep the curve and leave the fit out. |
See alsoStep 6: Curves.
12.6Draw or edit a symbol
Draw a schematic symbol with the pins where you want them.
- Press Ctrl+Alt+B, or Edit symbol on a row in My parts.
- To begin from an existing symbol, use the Start from card: type a name and pick a library symbol, or click Import .kicad_sym… to read a KiCad symbol library (the other symbols of the file are offered in the same search as kicad: NAME). Its body, pins and drawing are copied in, in one undo step. Or start empty:
- In Pin list, type one pin per line as
number name function, for example1 VIN in. - Click Auto-place pins.You should seeThe pins laid out as an IC box: supplies on top, grounds at the bottom, inputs left, outputs right.
- Fix anything the Audit card lists. Saving is off while it shows errors.
- Click Save to My parts.
ResultA .bssym file in My parts, or the symbol inside the part you were editing.
See alsoSymbol editor and My parts.
12.7Run a model that is encrypted
Simulate a Texas Instruments model that only PSpice can read.
Before you startThe desktop app and PSpice for TI, installed free from ti.com.
- Place or assign the model. Its library row says "Cadence-encrypted, verified in PSpice".
- Probe at most four signals: PSpice for TI keeps no more.
- Close any PSpice window of your own.
- Press F5.You should seeThe progress line says in PSpice (encrypted vendor models). The result appears like any other run.
ResultThe whole circuit ran in PSpice, hidden. The live simulation uses parameters fitted in PSpice, so it's approximate.
| If you see | Do this |
|---|---|
| A message that names PSpice for TI | It's not installed, or BSPICE_PSPICE points elsewhere. |
E_MODEL: needs PSpice for some parts and ngspice for others | Replace the parts on one side. |
See alsoPSpice for encrypted models.
12.8Replace a model that does not run
Get a working model for a part whose model fails.
- Read the diagnostic (Alt+6). It names the part and the file.
- Double-click the part and search its part number.
- Choose a row with a green or amber dot, from another library if needed, and click Assign.
- If nothing fits, build one with Quick model (Ctrl+Shift+M).
ResultModels that fail in every engine aren't in the library at all. Where a working model of the same part exists, placing the broken one places that instead, with a message.
See alsoRetired models, Models and the library.