* Z:\home\khalils\Downloads\files\data\raw_asc\516feca7e196_USB_sense_WCA.asc
* Generated by LTspice 26.0.1 for Windows.
* .tran 5m startup
* https://electronics.stackexchange.com/questions/546121/placement-of-mosfets-in-switchable-voltage-divider-for-voltage-measurements
***********************************************************
*
* 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
*
***********************************************************
*
*
+ 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
R1 E 0 {WC1(1k,0.05,3)}
V4 THERSHOLD 0 2.475
V3 STEPPING 0 {STEPPING}
V1 S 0 12
V2 PSU_en 0 5
D1 0 Vin_mon BZX84-C3V3
M2 D G S S BSS84
R6 Vin_mon 0 {WC1(6k8,0.01,1)}
R5 S G {WC1(3k3,0.01,2)}
C1 Vin_mon 0 10n
R3 PSU_en B {WC1(22k,0.01,5)}
R4 B 0 {WC1(10k,0.05,4)}
R2 D Vin_mon {WC1(3k3,0.01,0)}
Q1 G B E 0 BC847B_WCA
.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
.dc V1 0 7 0.1
.MODEL BZX84-C3V3 D
.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 63 1
.model BC847A_WCA NPN(IS=9.677E-15 NF=0.9922 ISE=5.44E-15 NE=2 BF={WC2(110,180,220,0)} IKF=0.14 VAF=143.8 NR=0.9935 ISC=5.236E-12 NC=1.53 BR=7.004 IKR=0.06 VAR=31.15 RB=10 IRB=5.00E-06 RBM=4 RE=0.78 RC=0.656 XTB=0 EG=1.11 XTI=3 CJE=1.443E-11 VJE=0.733 MJE=0.3514 TF=6.04E-10 XTF=8.94 VTF=3.78 ITF=0.2711 PTF=0 CJC=3.287E-12 VJC=0.5444 MJC=0.3954 XCJC=0.6193 TR=0.00000011 CJS=0 VJS=0.75 MJS=0.333 FC=0.789 Vceo=45 Icrating=100m mfg=NXP)
.model BC847B_WCA NPN(IS=1.822E-14 NF=0.9932 ISE=2.894E-16 NE=1.4 BF={WC2(290,200,450,0)} IKF=0.109 VAF=82 NR=0.9931 ISC=9.982E-12 NC=1.763 BR=8.29 IKR=0.09 VAR=17.9 RB=10 IRB=5.00E-06 RBM=5 RE=0.649 RC=0.7014 XTB=0 EG=1.11 XTI=3 CJE=1.244E-11 VJE=0.7579 MJE=0.3656 TF=4.908E-10 XTF=9.51 VTF=2.927 ITF=0.3131 PTF=0 CJC=3.347E-12 VJC=0.5463 MJC=0.391 XCJC=0.6193 TR=9.00E-08 CJS=0 VJS=0.75 MJS=0.333 FC=0.979 Vceo=45 Icrating=100m mfg=NXP)
.model BC847C_WCA NPN(IS=2.375E-14 NF=0.9925 ISE=5.16E-16 NE=1.3 BF={WC2(420,520,800,0)} IKF=0.09 VAF=49.77 NR=0.9931 ISC=7.064E-12 NC=1.78 BR=10.04 IKR=0.132 VAR=16 RB=10 IRB=5.00E-06 RBM=5 RE=0.653 RC=0.78 XTB=0 EG=1.11 XTI=3 CJE=1.132E-11 VJE=0.7685 MJE=0.3733 TF=4.258E-10 XTF=6.319 VTF=6.4 ITF=0.1845 PTF=0 CJC=3.379E-12 VJC=0.5444 MJC=0.3968 XCJC=0.6193 TR=0.000000095 CJS=0 VJS=0.75 MJS=0.333 FC=0.999 Vceo=45 Icrating=100m mfg=NXP)
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 7904 1344
WIRE 368 96 240 96
WIRE 624 96 368 96
WIRE 240 112 240 96
WIRE 368 128 368 96
WIRE -992 160 -1056 160
WIRE -736 160 -784 160
WIRE -1056 192 -1056 160
WIRE -784 192 -784 160
WIRE 240 208 240 192
WIRE 624 224 624 96
WIRE 368 240 368 208
WIRE 560 240 368 240
WIRE 576 240 560 240
WIRE -1056 304 -1056 272
WIRE -784 304 -784 272
WIRE 624 336 624 320
WIRE 736 336 624 336
WIRE 624 352 624 336
WIRE 368 368 368 240
WIRE -224 416 -384 416
WIRE 16 416 -144 416
WIRE 288 416 16 416
WIRE 304 416 288 416
WIRE -384 448 -384 416
WIRE 16 448 16 416
WIRE 624 464 624 432
WIRE 752 464 624 464
WIRE 1056 464 752 464
WIRE 1168 464 1056 464
WIRE 368 480 368 464
WIRE 752 480 752 464
WIRE 368 496 368 480
WIRE 624 496 624 464
WIRE 1056 496 1056 464
WIRE -384 544 -384 528
WIRE 16 544 16 528
WIRE 624 576 624 560
WIRE 752 576 752 560
WIRE 1056 576 1056 560
WIRE 368 592 368 576
IOPIN -992 160 Out
IOPIN -736 160 Out
SYMBOL voltage -1056 176 R0
SYMATTR InstName V3
SYMATTR Value {STEPPING}
SYMBOL voltage -784 176 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V4
SYMATTR Value 2.475
SYMBOL voltage -384 432 R0
WINDOW 3 21 91 Left 2
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR Value 5
SYMATTR InstName V2
SYMBOL voltage 240 96 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL res 608 336 R0
SYMATTR InstName R2
SYMATTR Value {WC1(3k3,0.01,0)}
SYMBOL res 352 480 R0
SYMATTR InstName R1
SYMATTR Value {WC1(1k,0.05,3)}
SYMBOL res 736 464 R0
SYMATTR InstName R6
SYMATTR Value {WC1(6k8,0.01,1)}
SYMBOL res 352 112 R0
SYMATTR InstName R5
SYMATTR Value {WC1(3k3,0.01,2)}
SYMBOL cap 608 496 R0
SYMATTR InstName C1
SYMATTR Value 10n
SYMBOL npn 304 368 R0
SYMATTR InstName Q1
SYMATTR Value BC847B_WCA
SYMBOL res 0 432 R0
WINDOW 3 34 74 Left 2
SYMATTR Value {WC1(10k,0.05,4)}
SYMATTR InstName R4
SYMBOL pmos 576 320 M180
SYMATTR InstName M2
SYMATTR Value BSS84
SYMBOL zener 1072 560 R180
WINDOW 0 -34 61 Left 2
WINDOW 3 -153 -8 Left 2
SYMATTR InstName D1
SYMATTR Value BZX84-C3V3
SYMBOL res -240 432 R270
WINDOW 0 -36 58 VTop 2
WINDOW 3 65 77 VBottom 2
SYMATTR InstName R3
SYMATTR Value {WC1(22k,0.01,5)}
FLAG 16 544 0
FLAG 368 592 0
FLAG -384 544 0
FLAG 240 208 0
FLAG 1168 464 Vin_mon
FLAG 752 576 0
FLAG 1056 576 0
FLAG 624 576 0
FLAG -384 416 PSU_en
FLAG 240 96 Vin
FLAG 288 416 B
FLAG 560 240 G
FLAG 368 480 E
FLAG 736 336 D
FLAG 624 96 S
FLAG -1056 304 0
FLAG -992 160 STEPPING
FLAG -736 160 THERSHOLD
FLAG -784 304 0
TEXT -272 256 Left 2 !.dc V1 0 7 0.1
TEXT -272 296 Left 2 ;.tran 5m startup
TEXT -1016 632 Left 2 ;https://electronics.stackexchange.com/questions/546121/placement-of-mosfets-in-switchable-voltage-divider-for-voltage-measurements
TEXT 1912 -416 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 63 1
TEXT 1912 -512 Left 2 !.model BC847A_WCA NPN(IS=9.677E-15 NF=0.9922 ISE=5.44E-15 NE=2 BF={WC2(110,180,220,0)} IKF=0.14 VAF=143.8 NR=0.9935 ISC=5.236E-12 NC=1.53 BR=7.004 IKR=0.06 VAR=31.15 RB=10 IRB=5.00E-06 RBM=4 RE=0.78 RC=0.656 XTB=0 EG=1.11 XTI=3 CJE=1.443E-11 VJE=0.733 MJE=0.3514 TF=6.04E-10 XTF=8.94 VTF=3.78 ITF=0.2711 PTF=0 CJC=3.287E-12 VJC=0.5444 MJC=0.3954 XCJC=0.6193 TR=0.00000011 CJS=0 VJS=0.75 MJS=0.333 FC=0.789 Vceo=45 Icrating=100m mfg=NXP)\n.model BC847B_WCA NPN(IS=1.822E-14 NF=0.9932 ISE=2.894E-16 NE=1.4 BF={WC2(290,200,450,0)} IKF=0.109 VAF=82 NR=0.9931 ISC=9.982E-12 NC=1.763 BR=8.29 IKR=0.09 VAR=17.9 RB=10 IRB=5.00E-06 RBM=5 RE=0.649 RC=0.7014 XTB=0 EG=1.11 XTI=3 CJE=1.244E-11 VJE=0.7579 MJE=0.3656 TF=4.908E-10 XTF=9.51 VTF=2.927 ITF=0.3131 PTF=0 CJC=3.347E-12 VJC=0.5463 MJC=0.391 XCJC=0.6193 TR=9.00E-08 CJS=0 VJS=0.75 MJS=0.333 FC=0.979 Vceo=45 Icrating=100m mfg=NXP)\n.model BC847C_WCA NPN(IS=2.375E-14 NF=0.9925 ISE=5.16E-16 NE=1.3 BF={WC2(420,520,800,0)} IKF=0.09 VAF=49.77 NR=0.9931 ISC=7.064E-12 NC=1.78 BR=10.04 IKR=0.132 VAR=16 RB=10 IRB=5.00E-06 RBM=5 RE=0.653 RC=0.78 XTB=0 EG=1.11 XTI=3 CJE=1.132E-11 VJE=0.7685 MJE=0.3733 TF=4.258E-10 XTF=6.319 VTF=6.4 ITF=0.1845 PTF=0 CJC=3.379E-12 VJC=0.5444 MJC=0.3968 XCJC=0.6193 TR=0.000000095 CJS=0 VJS=0.75 MJS=0.333 FC=0.999 Vceo=45 Icrating=100m mfg=NXP)