Source code coming soon. The GitHub repository is private for now and opens to everyone very soon.
BetterSPICE Beta 0.8.0 Join the beta Download soon
Part VII  Files and integrationReferenceContentsIndex
49

Importing KiCad and EasyEDA Pro

File›Import KiCad / EasyEDA / LTspice… (Ctrl+I), or Import in the toolbar, reads a schematic from another tool and opens it as a new circuit in its own tab.

Importing KiCad and EasyEDA Pro
ToolFiles
KiCad 6 to 10.kicad_sch, .kicad_pro, or a .zip of the project
EasyEDA Pro.epro, .epro2, or a local .eprj
LTspice.asc

An LTspice schematic comes in with its parts, wiring, symbols and SPICE models. Each part gets the model LTspice itself would use: the .model lines on the schematic, the files it includes and LTspice's standard libraries. Symbols come from the .asy files next to the schematic, or from an installed LTspice. A value such as 200 is 200 ohm, as in LTspice. LTspice hierarchical blocks and digital gates come in as boxes.

LTspice's astable multivibrator example after the import, with probes on the two collectors, in Split view after a Simulate run.
Figure 49.1LTspice's astable multivibrator example after the import, with probes on the two collectors, in Split view after a Simulate run.
cautionHierarchical KiCad designs. Choose the project .zip. A .kicad_sch or .kicad_pro chosen on its own cannot bring its sub-sheet files with it. LTspice models are also in the library.

49.1What the importer does

  1. Reads every symbol, wire, label, power flag, junction and sheet.
  2. Matches each symbol to a BetterSPICE device by its library name, value and reference, with a rule for each kind of part: resistors, capacitors, inductors, diodes, transistors, op-amps, regulators, connectors and more.
  3. Maps the symbol's pins to the device's pins and checks that every net still has the same pins as in the source.
  4. Keeps parts it can't match as boxes with their pins, so the drawing is complete.
  5. Adds a DC source for each supply rail named like a voltage (for example +3V3) that nothing drives, so the board can run.
  6. Where a part names a vendor model in the project, keeps it for Simulate and fits the live model from the catalogue model of the same name.

A bare resistor value from KiCad or EasyEDA, such as 500, is 500 Ω. The three-digit marking code (104 = 100 nF) is read on capacitors only. An .epro that holds an entry over 256 MB is refused at once with a short message, before anything is unpacked.

49.2The Import report

The Import report after a KiCad import.
Figure 49.2The Import report after a KiCad import.

While the importer runs, a message says "Importing <file>…", and a second import waits for it. The report opens after the import. It has a summary sentence, number tiles and sections. Rows that name a part are links: a click selects the part, zooms to it (no further than a fit, 1.3×) and closes the report. Parts that were not recognised have an Assign model… button. File›Import report… reopens the report of an imported tab.

The Import report
ItemMeaning
Format, Grid in mmThe source tool and its grid.
Components, Recognised, Not recognised, SkippedHow many symbols, how many became simulated devices, how many stayed boxes, and how many have no electrical meaning (logos, mounting holes).
Recognised shareRecognised as a percentage of the parts that could be.
Nets in the source / in the circuit, Pins checkedThe net check: every net must keep the same pins.
Joined with ~ labels, Nets mergedNets joined by name, as the source tool did.
Not recognised (placed as boxes)Shown first. Each part with its symbol and the reason.
ErrorsShown first, red: problems that stopped part of the import, counted in the summary line, such as "0 warnings, 1 error".
WarningsAmber: importer diagnostics with their codes and fixes, and I_MODEL_FIT where live values came from a catalogue model.
RecognisedEach part: reference, symbol → device type and variant, value, model, confidence, pin map and the rule that matched it.
Skipped, Added supplies, SheetsWhat was left out, which sources were added, and the sheet structure.
noteBoards without supplies or models. An imported board draws completely, but ICs without a model leave their nets undetermined, and a board with no source runs at 0 V. A circuit with no source raises W_NO_SOURCE and the message "No supply in the imported circuit: add a DC source." Assign models to the ICs that matter and add a source.
Try it
Import a KiCad project
  1. Zip the KiCad project folder.
  2. Press Ctrl+I and choose the zip.
  3. Read the Not recognised section. Assign a model to each IC that matters (Ctrl+M).
  4. Add a DC source if the report didn't add one, and press Ctrl+R.

You should seeThe board runs. Hover any net to read its voltage, and probe the rails to check them.

Command line: bspice import board.kicad_sch --out board.bsc --report report.json, with --flat for one flat sheet and --no-supplies to add no sources (The command line (bspice)).