Hi i am trying to simulate the soft latch presented in EEVblog #262. Here is my schematic:
The switch is uses following model mostly scraped from elsewhere on this forum but modified a bit:
.SUBCKT MyButton_NO 1 2
S1 1 2 n001 0 MySW_NO
* Initial value, pulsed value, delay time, rise time, fall time, width, total*
V1 n001 0 pulse(0 10 1.5 0.02 0.05 0.5 2)
.model MySW_NO sw vt=1 vh=0.2 ron=1 roff=1000MEG
The models for the BJT is taken from and MOSFET is taken from helpful kicad spice library on github. But for clarity the models are:
.model 2N3904 NPN(IS=1E-14 VAF=100 Bf=300 IKF=0.4 XTB=1.5 BR=4 CJC=4E-12 CJE=8E-12 RB=20 RC=0.1 RE=0.1 TR=250E-9 TF=350E-12 ITF=1 VTF=2 XTF=3 Vceo=40 Icrating=200m mfg=Philips)
with alternate sequence of
3 2 1 should be
2 1 3
and for brevity the MOSFET definition can be found here. I’m using alternate sequence of
3 1 2
Now this does not seem to work i am possibly
- Not understanding the way alternate sequence is used.
- For some reason when i test parts of the model i need to pull low down with a very high resistor to get the button to work. Whats up with that.
Any ideas whats wrong?
Reading the spice source appears that my pins are correct. And indeed i need to add a load on output. Still I m a bit puzzled since it starts up only once and the simulation starts with very negative values.