Ngspice and the Vcc param

@holger Herr Holger, I am not sure I understand how your example from Simulation with XSPICE code models works, for example the NAND3_2_DFF schematic. I see you used a .param vcc=2 parameter to set up the amplitude for V1 and V2. But somehow this parameter is passed automatically to all XPICE circuits, in a non-explicit way.

The problem arises if I replace the amplitude of V1 with y1=0 y2=5 td=2n tr=2n tf=2n tw=50n per=100n, the amplitude of V1 with: y1=0 y2=5 td=0.8u tr=2n tf=2n tw=1.4u per=1 (instead of using the vcc param I use a direct voltage value for y2) and I delete the .param vcc=2

All of a sudden all XPICE circuits are working now at 3.3 V logic, instead of the expected 1 V logic. Is there in KiCad a hidden default parameter .param vcc and that non existing param vcc is now automatically set to 3.3 V and passed to all circuits? Or ngspice has a hidden vcc param that defaults to 3.3 V and is used all over by ngspice?

Mit freundlichen Grüßen,
Adi

Please have a look at chapter
8.6 Automatic insertion of bridging devices
of the ngspice manual.

Thanks, that would clarify where the 3.3 V is coming from, and the vcc parameter. One more detail I would like to clarify. The logic levels are internally 1 V, or are now by default set to 3.3 V? Or this matter is a bit like the Schrödinger cat, internally are 1 V and the moment you look at them in a circuit are automatically collapsing to 3.3 V?

The internal logic levels do not have any voltage representation. Please have a look at the ngspice manual chapter 8.5.1 Digital Node Type for their definition.

1 V is generated only for plotting purposes, vcc with default 3.3 V is used by the (automatically inserted) digital-to-analog bridge for the output on the analogue side…