(Solved) ngspice/SPICE - Where do I find a list of pin/source sequences?

That devices often do not correspond to the ngspice pin sequence is well known, and also flagged in KiCAD.
But where do I find a list of the input sequences that ngspice needs as default?
I’m talking about a list like:
BJT: CBE
FET: DGS
LED: AK
and so on.

I’ve searched high and low on the web, but have found nothing. Perhaps (probably) my search terms were wrong, but does anyone have a pointer for me?

Thanks.

They are described in the Ngspice User’s Manual under circuit elements (or device instances), chapter 2. PSpice (OrCad), LTspice, etc., have their own schematic symbols usually follow the same conventions while KiCad follows IPC, which notably means the diode symbol is reversed. For subcircuits, it’s basically arbitrary but mostly follows what LTspice (free) or OrCAD ($) do.

It looks like the prices of IPC-2612 and IPC-2612-1 have been reduced to about ⅓ of the previous $300 each (still very restrictive DRM, though): https://shop.ipc.org

Thanks, but a 714-page manual is not what I was looking for. And IPC-2612 does not seem to relate to ngspice/SPICE at all.
I’ll probably have to build my own list moving along.

Well, 2.1.3 alluded to above has a summary table. Don’t know what’s so hard with clicking some links and go back…

Maybe start small with the chapter Circuit Elements and Models of the SPICE 3f4 manual then (NC NB NE would be your CBE, N+ N- your AK)?

If you want to do it a harder way, you could look at existing KiCad symbols. For example, install (and add as described there) my Generic Symbol Library with the Plugin and Content Manager. Then Edit → Pin Table… shows the assignments for a symbol (don’t forget the alternate node sequence Spice_Node_Sequence in File → Symbol Properties… for the diodes).

Thanks for your reply.
The connection betwen symbols, models and alternate sequences is completely clear to me.
The disconnect is not knowing what ngspice expects as pin sequence. For instance what input does it expect for an SCR? N+, G, N-? No one knows.
Or for a Triac? MT+, MT-, G? Again a mystery.
If you tell me that such parts can only be modelled with a .SUBCKT simulation file, I’m OK with that, But I’m missing the overview completely.

The manual @franzee linked to contains this information although it’s perhaps not obvious.

Go to the summary table Franzee linked, then click on the device you’re curious about. The device description gives the expected pin order.

Here’s an example for BJT.

  1. Go to the table in 2.1.3 Franzee referenced
  2. Click on BJT link (chapter 8)
  3. Read device description for BJT:

General form:
QXXXXXXX nc nb ne <ns> <tj> mname <area=val>...

nc nb ne <ns> means collector, base, emitter, optional substrate.

Completely known to me. Please read my previous post carefully.
Thanks,

Yes, that’s generally the case, unless there is an extension (like, for example, the A device for the potentiometer in my library mentioned above).

I was explaining how to find out what ngspice expects. If it’s not in that list in the manual, then you probably have to use a subcircuit model.

Thanks for finally a clear answer.
So the basic semiconductor models (.MODEL) are restricted to:
Diode,
BJT,
JFET,
MESFET,
MOSFET,
according the chapters: 7, 8, 9, 10, 11 (2.1.3 is not helpful in this respect). For all other active devices I should use a .SUBCKT model.

Nice to know, and the first time I see a definite answer on this.

Thank You all, I think I got it now. I’ll mark as solved.

Right, plus the included XSPICE code models (chapter 27, but most all are documented in chapter 12) in analog.cm, digital.cm, spice2poly.cm, table.cm, xtradev.cm, xtraevt.cm.

???

See chapter 12 for documenting the code models (more than 100 pages).

1 Like

Oops, only the one I used isn’t documented (potentiometer) – fixed it above…

Potentiometer description will be available in the ngspice-38 version of the manual (hopefully next week).

1 Like

Thanks, it looks like it will be fully supported in KiCad 7 (courtesy of @mwielgus: 0399d08a, 6c752680, …).