Lessons and the learning game

SPICE simulation

An advanced course on what a circuit simulator really does, taught on the SPICE engine Mokxi runs underneath, ending in a preamp verified before it is built.

What the course covers

SPICE simulation is seven lessons, one chapter each, with a quiz after every chapter:

  1. Netlists: nodes, ground as node 0, one line per part, SPICE's 0 V ammeter, and the same divider as a canvas and as a deck.
  2. Operating point: every node of a transistor stage at once, moving it, Shift+O, and where power-on differs from .op.
  3. Transient: an RC fed a square wave, read in multiples of tau, and the same run as a .tran deck.
  4. AC sweep: an RC low-pass proved point by point with a scope, and the Bode plot from the Analysis sheet.
  5. Parameter sweeps: 60 mV per decade on a transistor, and a Zener's knee found by sweeping its supply.
  6. Models from datasheets: hFE, Vce(sat) at its test condition, an op-amp's gain-bandwidth product, and the .model card.
  7. Boss: verify before you build: a microphone preamp predicted on paper, verified on the meters and scope, then changed to a new spec.

How it checks your work

Every automatic check reads an instrument on the running canvas: a multimeter, the oscilloscope or a part's own reading. The Analysis sheet and the SPICE deck runner are not visible to a lesson check, so the few steps that use them are ticked by hand, each paired with a canvas step that checks the same number.

What the simulation is and is not

  • Mokxi is a SPICE engine checked against ngspice 42, and its deck runner reads standard netlists. The canvas op-amp is a single-pole macromodel, not a transistor-level one.
  • Mokxi's operating point is the circuit as it powers on: capacitors start discharged, where SPICE's .op treats them as open.
  • The deck runner leaves out BSIM MOSFETs, XSPICE, and the .four, .sens, .pz and .disto analyses.

DC circuit analysis for the hand methods a simulator automates, and Discrete transistor design for the circuits worth simulating.