|
From: BERTRAND J. <joe...@sy...> - 2022-01-06 15:30:36
|
Hello and Happy new year.
I'm trying to use a LTspice model (74HCT86) in a simple ngspice
simulation and this simulation aborts with a lot of error like :
Undefined number [vcc2]
Original line no.: 0, new internal line no.: 384:
Formula() error.
vt1=0.29; vcc3=vcc2; speed3=speed2; tripdt3=tripdt2;
cval=0.55e-12*4/({vcc3}-0.5)*{speed3}; gain=(1/{vcc3});
How can I translate this model into ngspice ?
.title KiCad schematic
.include "/home/bertrand/cvs/electronique/spicelib/74hct.lib"
.include "/home/bertrand/cvs/electronique/spicelib/bat46.lib"
XU1 Net-_C1-Pad1_ /5V /V1 /5V 0 74HCT86
XU2 Net-_C2-Pad2_ 0 /V2 /5V 0 74HCT86
R3 /V1 0 10k
C1 Net-_C1-Pad1_ 0 10p
R4 /V2 0 10k
V2 /5V 0 5V
C3 0 Net-_C2-Pad2_ C
C2 0 Net-_C2-Pad2_ 10p
V1 /Vin 0 PULSE(0 5 0 5n 5n 5u 10u 0)
R1 /Vin Net-_C1-Pad1_ 10k
XD1 /Vin Net-_C1-Pad1_ BAT46
XD2 Net-_C2-Pad2_ /Vin BAT46
R2 /Vin Net-_C2-Pad2_ 10k
.options method=gear reltol=1m minbreak=200ps
.control
tran 10n 10m
run
write results.raw
quit
.endc74hct.lib
.save V(/Vin) V(/V1) V(/V2)
.end
BAT465 model is a standard diode model and 74hct.lib contains:
.SUBCKT 74HCT86 A B Y VCC VGND vcc1={vcc} speed1={speed} tripdt1={tripdt}
.param td1=1e-9*(17-3-3)*4.0/({vcc1}-0.5)*{speed1}
*
XIN1 A Ai VCC VGND 74HCT_IN_1 vcc2={vcc1} speed2={speed1}
tripdt2={tripdt1}
XIN2 B Bi VCC VGND 74HCT_IN_1 vcc2={vcc1} speed2={speed1}
tripdt2={tripdt1}
*
A1 Ai Bi 0 0 0 0 Yi 0 XOR tripdt={tripdt1} td={td1}
*
XOUT Yi Y VCC VGND 74HCT_OUT_1X vcc2={vcc1} speed2={speed1}
tripdt2={tripdt1}
.ends
Help will be welcome.
Best regards,
JB
|