* Z:\tmp\asc_mix_bvbm4pog\mix_194.asc
* Generated by LTspice 26.0.1 for Windows.
Vi N003 0 PULSE(0 5 0 50us 50us 0 100us)
VCC N001 0 5
Rb N004 N003 1K
Rc N002 N001 1K
Q1 N002 N004 0 0 2N2222
V1 Vin 0 12
V2 PSU_en 0 PULSE(0 5 1m 10u 10u 3m)
R3 PSU_en G {WC1(1k,0.05,0)}
R4 G 0 {WC1(100k,0.05,1)}
D1 0 Vin_mon BZX84-C3V3
R2 Vin N005 {WC1(3k3,0.05,2)}
R6 N005 0 {WC1(6k8,0.01,3)}
V3 STEPPING 0 {STEPPING}
V4 THERSHOLD 0 2.475
R1 Vin_mon 0 1Meg
M1 N005 G Vin_mon Vin_mon NMOS
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.model NPN NPN
.model PNP PNP
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.bjt
.model NMOS NMOS
.model PMOS PMOS
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.mos
.tran 400us
* .dc V1 0 7 0.1
***********************************************************
*
* BZX84-C3V3
*
* Nexperia
*
* Voltage regulator diodes
* VFmax = 0,9V @ IF = 10mA
* IRmax = 5A @ VR = 1V
* VZmax = 3,5V @ IZ = 5mA
* IZSM = 6A @ tp = 100s
*
*
*
* Package pinning does not match Spice model pinning.
* Package: SOT23
*
* Package Pin 1: Anode
* Package Pin 2: Not Connected
* Package Pin 3: Cathode
*
*
* Extraction date (week/year): #
* Simulator: PSPICE
*
***********************************************************
*
.MODEL BZX84-C3V3 D
+ IS = 7.035E-16
+ N = 0.9809
+ BV = 3.3
+ IBV = 0.005
+ RS = 0.3487
+ CJO = 3.162E-10
+ VJ = 0.6687
+ M = 0.3164
+ FC = 0.5
.ENDS
*
.FUNC MOD(a,b) {a-FLOOR(a/b)*b}
.FUNC BIT(x) {if(MOD(STEPPING,2**(X+1))>=2**x,1,0)}
.FUNC EVA1 (nom, tol, param_num) {if(STEPPING == -1, nom, nom*(1-tol)+2*nom*tol*BIT(param_num))}
.FUNC EVA2 (nom, min, max, param_num) {if(STEPPING == -1, nom, IF(BIT(param_num),max,min))}
.FUNC WC1 (nom, tol, param_num) EVA1(nom, tol, param_num)
.FUNC WC2 (nom, min, max, param_num) EVA2(nom, min, max, param_num)
.step param STEPPING -1 15 1
**********
.SUBCKT BSS169_L1 drain gate source PARAMS: dVth=0 dRdson=0 dgfs=0 dC=0
.PARAM Rs=0.074 Rg=10 Ls=3n Ld=1n Lg=3n
.PARAM Inn=0.05 Unn=0 Rmax=12
.PARAM act=0.25
X1 d1 g s Tj K_100_d_var PARAMS: a={act} dVth={dVth} dR={dRdson} Inn={Inn} Unn={Unn}
+Rmax={Rmax} dgfs={dgfs} Rs={Rs} dC={dC} heat=0
Rg g1 g {Rg}
Lg gate g1 {Lg*if(dgfs==99,0,1)}
Gs s1 s VALUE={V(s1,s)/(Rs*(1+(limit(V(Tj),-200,999)-25)*4m))}
Rsa s1 s 1Meg
Ls source s1 {Ls*if(dgfs==99,0,1)}
Ld drain d1 {Ld*if(dgfs==99,0,1)}
E1 Tj w VALUE={TEMP}
R1 w 0 1u
.ENDS
*$
**********
**************************************************************************************
.SUBCKT K_100_d_var dd g s Tj PARAMS: a=1 dVth=0 dR=0 dgfs=0 Inn=1 Unn=1 Rmax=1
+gmin=1 Rs=1 Rp=1 dC=0 heat=1
.PARAM Vth0=-1.8 beta4c=0.303 ph0=20 ph1=0.026 Ubr=150
.PARAM Rd=0.6 nmu=2.6 Rf=0.2 rpa=0.02925 lnIsj=-24.6
.PARAM Rdi=0.073
.PARAM Tref=298 T0=273 auth=3m c=0.82 mu_bet=0.4
.PARAM f_bet=-2 ndi=1.2 UTnbr=207m lnBr=-23 kbq=85.8u
.PARAM Wcml={beta4c*4*c}
.PARAM aubr={0.93m*UBr}
.PARAM dvgs={0.1-0.06*Vth0}
.PARAM f1=118p f2=118p f3=207p f4=330p f5=217p
.PARAM U0=0.5 nd=0.42 nc=0.5 g1=4 bb=-10.8
.PARAM sl=30p remp=0p ta=60n td=20n
.PARAM Vmin=-2.9 Vmax=-1.8 dCmax=0.35
.PARAM Vth={Vth0+(Vmax-Vth0)*limit(dVth,0,1)-(Vmin-Vth0)*limit(dVth,-1,0)}
.PARAM p0={Wcml*a*((1-f_bet)*(T0/Tref)**mu_bet+f_bet) }
.PARAM Rlim={(Rmax-Rs-(Unn-Vth0-Inn*Rs-SQRT((Unn-Vth0-Inn*Rs)**2-4*c*Inn/p0))/(2*c*Inn))/(1+rpa*(Inn/a)**2)}
.PARAM dRd={Rd/a+if(dVth==0,limit(dR,0,1)*max(Rlim-Rd/a,0),0)}
.PARAM bet={Wcml}
.PARAM dC1={1+dCmax*limit(dC,0,1)}
.PARAM Cox={f1*a*dC1}
.PARAM Cds0={f2*a*dC1}
.PARAM Cgs0={f3*a*dC1}
.PARAM Cox1={f5*a*dC1}
.PARAM Crand={remp*SQRT(a)}
.PARAM dRdi={Rdi/a}
.FUNC U1(Uds,T) {(SQRT(1+4*(0.4+(T-T0-25)*2m)*abs(Uds))-1)/2/(0.4+(T-T0-25)*2m)}
.FUNC I2(p,Uee,z1,pp) {if(Uee>pp,(Uee-c*z1)*z1,p*(pp-p)/c*exp((Uee-pp-(min(0,Uee))**2)/p))}
.FUNC Ig(Uds,T,p,Uee) {bet*((1-f_bet)*(T0/T)**mu_bet+f_bet)*I2(p,Uee,min(Uds,Uee/(2*c)),min(2*p,p+c*Uds))}
.FUNC Iges(Uds,Ugs,T)
+{a*(sgn(Uds)*Ig(U1(Uds,T),T,1/(ph0-ph1*T),Ugs-Vth+auth*(T-Tref))+exp(min(lnBr+(abs(Uds)-UBr-aubr*(T-Tref))/UTnbr,25)))}
.FUNC Isjt(Tj) {exp(min(lnIsj+(Tj/Tref-1)*1.12/(ndi*kbq*Tj),9))*(Tj/Tref)**1.5}
.FUNC Idiode(Usd,Tj,Iss) {exp(min(log(Iss)+Usd/(ndi*kbq*Tj),9))-Iss}
.FUNC Idiod(Usd,Tj) {a*Idiode(Usd,Tj,Isjt(Tj))}
.FUNC QCdg(x,z) {if(f4>f5,(f5**2-(f4-z*sl)**2)/(2*sl)+f5*min(x,(f4-f5)/sl),f4*z-sl*z**2/2-f5*max((f4-f5)/sl-x,0))}
E_Edg d ox VALUE {V(d,g)-(min(V(d,g),-bb)+1/(g1*(1-nc))*((1/(1+g1*max(V(d,g)+bb,0)))**(nc-1)-1))}
C_Cdg ox g {Cox}
E_Edg1 d ox1 VALUE {V(d,g)-QCdg(V(d,g),limit(V(d,g),(f4-f5)/sl,f4/sl))/f5}
C_Cdg1 ox1 g {Cox1}
C_Cdg2 d g {Crand}
E_Eds d edep VALUE {(V(d2,s)-I(V_sense3)/Cds0)}
C_Cds edep s {Cds0}
C_Cds2 d2 s {Cds0/500}
C_Cgs g s {Cgs0}
G_chan d s VALUE={Iges(V(d,s),V(g,s),T0+limit(V(Tj),-200,350))}
E_RMos d1 d VALUE={I(V_sense)*(Rf*dRd+(1-Rf)*dRd*((limit(V(Tj),-200,999)+T0)/Tref)**nmu)*(1+rpa*(I(V_sense)/a)**2)}
V_sense dd d1 0
G_diode s d2 VALUE={Idiod(V(s,d2),T0+limit(V(Tj),-200,499))}
R_Rdio d2 d3 {dRdi}
V_sense2 d1 d3 0
L_L001 a c {td/(ta+td)}
R_R001 a b {1/ta}
V_sense3 c f 0
R_sense3 f 0 1
E_E001 b 0 VALUE {I(V_sense2)}
E_E002 e 0 VALUE {1Meg*Cds0*(1/(1-nd)*U0**nd*(limit(U0+V(d2,s),U0/2,2*UBr))**(1-nd)+2**nd*min(V(d2,s)+U0/2,0))}
R_R002 e c 1Meg
R1 g s 1G
Rd01 d s 500Meg
Rd02 d2 s 500Meg
Rd03 d1 d 10k
G_TH 0 Tj VALUE = {heat*LIMIT(I(V_sense)*V(dd,s),0,100k)}
.ENDS
*$
*****************************************************************************************************
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2560 1712
WIRE 544 -128 368 -128
WIRE 368 -32 368 -48
WIRE 368 -32 336 -32
WIRE 336 128 336 -32
WIRE 544 128 544 -128
WIRE 112 176 -16 176
WIRE 272 176 192 176
WIRE -16 272 -16 176
WIRE -16 496 -16 352
WIRE 336 496 336 224
WIRE 336 496 -16 496
WIRE 544 496 544 208
WIRE 544 496 336 496
WIRE 336 528 336 496
WIRE 1008 48 944 48
WIRE 1264 48 1216 48
WIRE 944 80 944 48
WIRE 1216 80 1216 48
WIRE 944 176 944 160
WIRE 1216 192 1216 160
WIRE 1440 816 1088 816
WIRE 1088 832 1088 816
WIRE 1440 880 1440 816
WIRE 1088 928 1088 912
WIRE 1440 1024 1440 960
WIRE 1856 1024 1440 1024
WIRE 2032 1024 1952 1024
WIRE 2144 1024 2032 1024
WIRE 2256 1024 2144 1024
WIRE 1440 1056 1440 1024
WIRE 2032 1072 2032 1024
WIRE 2144 1072 2144 1024
WIRE 1440 1168 1440 1136
WIRE 2032 1168 2032 1152
WIRE 2144 1168 2144 1136
WIRE 1376 1296 1264 1296
WIRE 1584 1296 1456 1296
WIRE 1808 1296 1584 1296
WIRE 1936 1296 1936 1072
WIRE 1936 1296 1808 1296
WIRE 1264 1328 1264 1296
WIRE 1584 1328 1584 1296
WIRE 1264 1424 1264 1408
WIRE 1584 1424 1584 1408
SYMBOL voltage -16 256 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName Vi
SYMATTR Value PULSE(0 5 0 50us 50us 0 100us)
SYMBOL voltage 544 112 R0
SYMATTR InstName VCC
SYMATTR Value 5
SYMBOL res 208 160 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName Rb
SYMATTR Value 1K
SYMBOL res 384 -32 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName Rc
SYMATTR Value 1K
SYMBOL npn 272 128 R0
SYMATTR InstName Q1
SYMATTR Value 2N2222
SYMBOL voltage 1088 816 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL voltage 1264 1312 R0
WINDOW 3 21 91 Left 2
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value PULSE(0 5 1m 10u 10u 3m)
SYMATTR InstName V2
SYMBOL res 1360 1312 R270
WINDOW 0 -36 58 VTop 2
WINDOW 3 65 77 VBottom 2
SYMATTR InstName R3
SYMATTR Value {WC1(1k,0.05,0)}
SYMBOL res 1568 1312 R0
WINDOW 3 34 74 Left 2
SYMATTR Value {WC1(100k,0.05,1)}
SYMATTR InstName R4
SYMBOL zener 2160 1136 R180
WINDOW 0 -40 40 Left 2
WINDOW 3 -155 15 Left 2
SYMATTR InstName D1
SYMATTR Value BZX84-C3V3
SYMBOL res 1424 864 R0
SYMATTR InstName R2
SYMATTR Value {WC1(3k3,0.05,2)}
SYMBOL res 1424 1040 R0
SYMATTR InstName R6
SYMATTR Value {WC1(6k8,0.01,3)}
SYMBOL voltage 944 64 R0
SYMATTR InstName V3
SYMATTR Value {STEPPING}
SYMBOL voltage 1216 64 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V4
SYMATTR Value 2.475
SYMBOL res 2016 1056 R0
SYMATTR InstName R1
SYMATTR Value 1Meg
SYMBOL nmos 1856 1072 R270
SYMATTR InstName M1
FLAG 336 528 0
FLAG 1584 1424 0
FLAG 1264 1424 0
FLAG 1088 928 0
FLAG 2256 1024 Vin_mon
FLAG 2144 1168 0
FLAG 1440 1168 0
FLAG 1264 1296 PSU_en
FLAG 1088 816 Vin
FLAG 944 176 0
FLAG 1008 48 STEPPING
FLAG 1264 48 THERSHOLD
FLAG 1216 192 0
FLAG 1808 1296 G
FLAG 2032 1168 0
TEXT -50 552 Left 2 !.tran 400us
TEXT -544 288 Left 2 ;.dc V1 0 7 0.1
TEXT 2304 -360 Left 2 !***********************************************************\n*\n* BZX84-C3V3\n*\n* Nexperia\n*\n* Voltage regulator diodes\n* VFmax = 0,9V    @ IF = 10mA\n* IRmax = 5µA     @ VR = 1V\n* VZmax = 3,5V    @ IZ = 5mA\n* IZSM  = 6A      @ tp = 100µs\n*\n*\n*\n* Package pinning does not match Spice model pinning.\n* Package: SOT23\n*\n* Package Pin 1: Anode\n* Package Pin 2: Not Connected\n* Package Pin 3: Cathode\n*\n*\n* Extraction date (week/year): #\n* Simulator: PSPICE\n*\n***********************************************************\n*\n.MODEL BZX84-C3V3 D\n+ IS = 7.035E-16\n+ N = 0.9809\n+ BV = 3.3\n+ IBV = 0.005\n+ RS = 0.3487\n+ CJO = 3.162E-10\n+ VJ = 0.6687\n+ M = 0.3164\n+ FC = 0.5\n.ENDS\n*
TEXT -776 -280 Left 2 !.FUNC MOD(a,b) {a-FLOOR(a/b)*b}\n.FUNC BIT(x) {if(MOD(STEPPING,2**(X+1))>=2**x,1,0)}\n.FUNC EVA1 (nom, tol, param_num) {if(STEPPING == -1, nom, nom*(1-tol)+2*nom*tol*BIT(param_num))}\n.FUNC EVA2 (nom, min, max, param_num) {if(STEPPING == -1, nom, IF(BIT(param_num),max,min))}\n.FUNC WC1 (nom, tol, param_num) EVA1(nom, tol, param_num)\n.FUNC WC2 (nom, min, max, param_num) EVA2(nom, min, max, param_num)
TEXT -776 -112 Left 2 !.step param STEPPING -1 15 1
TEXT 1280 -360 Left 2 !**********\n \n.SUBCKT BSS169_L1 drain gate source PARAMS: dVth=0 dRdson=0 dgfs=0 dC=0\n \n.PARAM Rs=0.074     Rg=10        Ls=3n        Ld=1n        Lg=3n\n.PARAM Inn=0.05     Unn=0        Rmax=12\n.PARAM act=0.25\n \nX1  d1 g s Tj K_100_d_var PARAMS: a={act} dVth={dVth} dR={dRdson} Inn={Inn} Unn={Unn} \n                                        +Rmax={Rmax} dgfs={dgfs} Rs={Rs} dC={dC} heat=0\nRg    g1     g    {Rg}   \nLg    gate   g1   {Lg*if(dgfs==99,0,1)}\nGs    s1     s    VALUE={V(s1,s)/(Rs*(1+(limit(V(Tj),-200,999)-25)*4m))}\nRsa   s1     s    1Meg\nLs    source s1   {Ls*if(dgfs==99,0,1)}\nLd    drain  d1   {Ld*if(dgfs==99,0,1)}\n \nE1    Tj     w      VALUE={TEMP}\nR1    w      0      1u\n \n.ENDS\n*$\n \n**********
TEXT 3232 -360 Left 2 !**************************************************************************************\n \n\n.SUBCKT K_100_d_var dd g s Tj PARAMS: a=1 dVth=0 dR=0 dgfs=0 Inn=1 Unn=1 Rmax=1\n+gmin=1 Rs=1 Rp=1 dC=0 heat=1\n \n.PARAM  Vth0=-1.8      beta4c=0.303   ph0=20         ph1=0.026      Ubr=150\n.PARAM  Rd=0.6         nmu=2.6        Rf=0.2         rpa=0.02925    lnIsj=-24.6\n.PARAM  Rdi=0.073\n \n.PARAM  Tref=298     T0=273      auth=3m      c=0.82       mu_bet=0.4\n.PARAM  f_bet=-2     ndi=1.2     UTnbr=207m   lnBr=-23     kbq=85.8u\n.PARAM  Wcml={beta4c*4*c}        \n.PARAM  aubr={0.93m*UBr}\n.PARAM  dvgs={0.1-0.06*Vth0}\n \n.PARAM  f1=118p        f2=118p        f3=207p        f4=330p        f5=217p\n.PARAM  U0=0.5         nd=0.42        nc=0.5         g1=4           bb=-10.8\n.PARAM  sl=30p         remp=0p        ta=60n         td=20n\n \n.PARAM  Vmin=-2.9      Vmax=-1.8      dCmax=0.35\n.PARAM  Vth={Vth0+(Vmax-Vth0)*limit(dVth,0,1)-(Vmin-Vth0)*limit(dVth,-1,0)}\n.PARAM  p0={Wcml*a*((1-f_bet)*(T0/Tref)**mu_bet+f_bet)    }\n.PARAM  Rlim={(Rmax-Rs-(Unn-Vth0-Inn*Rs-SQRT((Unn-Vth0-Inn*Rs)**2-4*c*Inn/p0))/(2*c*Inn))/(1+rpa*(Inn/a)**2)} \n.PARAM  dRd={Rd/a+if(dVth==0,limit(dR,0,1)*max(Rlim-Rd/a,0),0)} \n.PARAM  bet={Wcml}\n \n.PARAM  dC1={1+dCmax*limit(dC,0,1)} \n.PARAM  Cox={f1*a*dC1}\n.PARAM  Cds0={f2*a*dC1}\n.PARAM  Cgs0={f3*a*dC1}\n.PARAM  Cox1={f5*a*dC1}\n.PARAM  Crand={remp*SQRT(a)}\n.PARAM  dRdi={Rdi/a}\n \n.FUNC U1(Uds,T)       {(SQRT(1+4*(0.4+(T-T0-25)*2m)*abs(Uds))-1)/2/(0.4+(T-T0-25)*2m)}\n.FUNC I2(p,Uee,z1,pp) {if(Uee>pp,(Uee-c*z1)*z1,p*(pp-p)/c*exp((Uee-pp-(min(0,Uee))**2)/p))}\n.FUNC Ig(Uds,T,p,Uee) {bet*((1-f_bet)*(T0/T)**mu_bet+f_bet)*I2(p,Uee,min(Uds,Uee/(2*c)),min(2*p,p+c*Uds))}\n.FUNC Iges(Uds,Ugs,T) \n +{a*(sgn(Uds)*Ig(U1(Uds,T),T,1/(ph0-ph1*T),Ugs-Vth+auth*(T-Tref))+exp(min(lnBr+(abs(Uds)-UBr-aubr*(T-Tref))/UTnbr,25)))}\n \n.FUNC Isjt(Tj)           {exp(min(lnIsj+(Tj/Tref-1)*1.12/(ndi*kbq*Tj),9))*(Tj/Tref)**1.5}\n.FUNC Idiode(Usd,Tj,Iss) {exp(min(log(Iss)+Usd/(ndi*kbq*Tj),9))-Iss}\n.FUNC Idiod(Usd,Tj)      {a*Idiode(Usd,Tj,Isjt(Tj))}\n \n.FUNC QCdg(x,z)  {if(f4>f5,(f5**2-(f4-z*sl)**2)/(2*sl)+f5*min(x,(f4-f5)/sl),f4*z-sl*z**2/2-f5*max((f4-f5)/sl-x,0))}\n \nE_Edg     d   ox  VALUE {V(d,g)-(min(V(d,g),-bb)+1/(g1*(1-nc))*((1/(1+g1*max(V(d,g)+bb,0)))**(nc-1)-1))}\nC_Cdg     ox  g   {Cox}\nE_Edg1    d   ox1 VALUE {V(d,g)-QCdg(V(d,g),limit(V(d,g),(f4-f5)/sl,f4/sl))/f5}\nC_Cdg1    ox1 g   {Cox1}\nC_Cdg2    d   g   {Crand}\n \nE_Eds     d edep  VALUE {(V(d2,s)-I(V_sense3)/Cds0)}\nC_Cds  edep    s  {Cds0}\nC_Cds2   d2    s  {Cds0/500}\n \nC_Cgs     g    s  {Cgs0}\n \nG_chan    d    s  VALUE={Iges(V(d,s),V(g,s),T0+limit(V(Tj),-200,350))}\nE_RMos   d1    d  VALUE={I(V_sense)*(Rf*dRd+(1-Rf)*dRd*((limit(V(Tj),-200,999)+T0)/Tref)**nmu)*(1+rpa*(I(V_sense)/a)**2)}\nV_sense  dd   d1  0\nG_diode   s   d2  VALUE={Idiod(V(s,d2),T0+limit(V(Tj),-200,499))}\nR_Rdio   d2   d3  {dRdi}\nV_sense2 d1   d3  0\n \nL_L001    a    c  {td/(ta+td)}\nR_R001    a    b  {1/ta}\nV_sense3  c    f  0\nR_sense3  f    0  1\nE_E001    b    0  VALUE {I(V_sense2)}\nE_E002    e    0  VALUE {1Meg*Cds0*(1/(1-nd)*U0**nd*(limit(U0+V(d2,s),U0/2,2*UBr))**(1-nd)+2**nd*min(V(d2,s)+U0/2,0))}\nR_R002    e    c  1Meg\n \nR1        g    s  1G\nRd01      d    s  500Meg\nRd02     d2    s  500Meg\nRd03     d1    d  10k\n \nG_TH      0    Tj  VALUE = {heat*LIMIT(I(V_sense)*V(dd,s),0,100k)}\n \n.ENDS\n*$\n \n*****************************************************************************************************