Following advice from Holger, I attempted a simple model for a dual push-pull comparator as follows:
****************************************************************************
****
**** Dual push pull comparator Spice macromodel subckt
***
*** VP=+in, VM = -in, VCCP = positive power, VCCN = negative power, VS = output
.SUBCKT DUAL_PUSH_PULL_COMP VP1 VP2 VM1 VM2 VCCP VCCN VS1 VS2
XICOMP1 VP1 VM1 VCCP VCCN VS1 COMPARATOR
XICOMP2 VP2 VM2 VCCP VCCN VS2 COMPARATOR
.ENDS
.SUBCKT COMPARATOR INP INN VHIGH VLOW OUT
ECOMP OUT 0 V = PWL(V(INP, INN), -10mV, VLOW, -1mV, VLOW, 1mV, VHIGH, 10mV, VHIGH)
.ENDS
running the simulation in Kicad 9.0.0 results in:
Note: Codel model file loading path is C:\Users\jjmcu\OneDrive\Activator_Kicad\Project7
Background thread stopped with timeout = 0
Note: Compatibility modes selected: ps lt a
Circuit: KiCad schematic
Netlist line no. 12:
Undefined parameter [pwl]
Netlist line no. 12:
Expression err: pwl(v(inp, inn), -10mv, vlow, -1mv, vlow, 1mv, vhigh, 10mv, vhigh)}
Netlist line no. 12:
Cannot compute substitute
Netlist line no. 12:
Undefined parameter [pwl]
Netlist line no. 12:
Expression err: pwl(v(inp, inn), -10mv, vlow, -1mv, vlow, 1mv, vhigh, 10mv, vhigh)}
Netlist line no. 12:
Cannot compute substitute
Please check your input netlist.
Error: ngspice.dll cannot recover and awaits to be reset or detached
Warning: can’t find the initialization file spinit.
** ngspice-44 shared library
Does this mean that PWL is not recognised? Or did I make another mistake?
Thanks a lot,
Jan