* Z:\home\khalils\Downloads\files\data\raw_asc\cbd08f8418dd_mosfet-drive-startup-and-simulation.asc
* Generated by LTspice 26.0.1 for Windows.
VUSB_5V 5V 0 5
VPico_3.3V 3.3V 0 3.3
Q1 N009 N015 0 0 2N2222
R1 N015 NPN_enable 2k
M1 N003 N009 0 0 IRFZ44N
ROutput 5V N003 25
R3 5V N009 20k
C1 N009 0 47n
Q2 NPN_enable PICO_output_pin 3.3V 0 PNP
Q3 N010 N016 0 0 2N2222
R2 N016 NPN_enable 2k
M2 N004 N010 0 0 IRFZ44N
ROutput1 5V N004 25
R5 5V N010 20k
C2 N010 0 47n
Q4 N011 N017 0 0 2N2222
R6 N017 NPN_enable 2k
M3 N005 N011 0 0 IRFZ44N
ROutput2 5V N005 25
R7 5V N011 20k
C3 N011 0 47n
Q5 N012 N018 0 0 2N2222
R8 N018 NPN_enable 2k
M4 N006 N012 0 0 IRFZ44N
ROutput3 5V N006 25
R9 5V N012 20k
C4 N012 0 47n
Q6 N013 N019 0 0 2N2222
R10 N019 NPN_enable 2k
M5 N007 N013 0 0 IRFZ44N
ROutput4 5V N007 25
R11 5V N013 20k
C5 N013 0 47n
Q7 N014 N020 0 0 2N2222
R12 N020 NPN_enable 2k
M6 N008 N014 0 0 IRFZ44N
ROutput5 5V N008 25
R13 5V N014 20k
C6 N014 0 47n
B1 N001 0 V=delay(V(3.3V), 500m)
V1 N002 0 PULSE(0 3.3 0.5 20n 20n 1 2)
R4 NPN_enable N002 15k
R14 PICO_output_pin N001 15k
.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 10 startup
* 0. Simulate PICO startup behaviour and toggling power MOSFET on/off
* 1. The PNP is used to turn on all NPN transistors while the PICO is initializing the micropython\ncode, thus keeping the MOSFETs off, preventing power flickering during startup
* 1. Emulate the PICO ready pin behavior
* Pico Port 1
* Pico Port 2
* Pico Port 3
* Pico Port 4
* Pico Port 5
* Pico Port 6
* 2. Emulate PICO pins turning on/off
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 4552 724
WIRE 2688 -1424 2688 -1472
WIRE 2624 -1376 2576 -1376
WIRE 1808 -1360 1728 -1360
WIRE 1888 -1360 1872 -1360
WIRE 2176 -1360 2128 -1360
WIRE 2688 -1280 2688 -1328
WIRE 1760 -1216 1744 -1216
WIRE 1856 -1216 1840 -1216
WIRE 1744 -1168 1744 -1216
WIRE 1744 -1008 1744 -1088
WIRE 2032 -880 1968 -880
WIRE 2192 -880 2112 -880
WIRE 1968 -800 1968 -880
WIRE 1968 -656 1968 -720
WIRE 160 -288 160 -336
WIRE 464 -288 160 -288
WIRE 928 -288 928 -336
WIRE 1232 -288 928 -288
WIRE 1680 -288 1680 -336
WIRE 1984 -288 1680 -288
WIRE 2464 -288 2464 -336
WIRE 2768 -288 2464 -288
WIRE 3264 -288 3264 -320
WIRE 3568 -288 3264 -288
WIRE 4128 -288 4128 -320
WIRE 4432 -288 4128 -288
WIRE 464 -240 464 -288
WIRE 1232 -240 1232 -288
WIRE 1984 -240 1984 -288
WIRE 2768 -240 2768 -288
WIRE 3568 -240 3568 -288
WIRE 4432 -240 4432 -288
WIRE 160 -208 160 -288
WIRE 928 -208 928 -288
WIRE 1680 -208 1680 -288
WIRE 2464 -208 2464 -288
WIRE 3264 -208 3264 -288
WIRE 4128 -208 4128 -288
WIRE 464 -112 464 -160
WIRE 1232 -112 1232 -160
WIRE 1984 -112 1984 -160
WIRE 2768 -112 2768 -160
WIRE 3568 -112 3568 -160
WIRE 4432 -112 4432 -160
WIRE 160 -32 160 -128
WIRE 320 -32 160 -32
WIRE 416 -32 320 -32
WIRE 928 -32 928 -128
WIRE 1088 -32 928 -32
WIRE 1184 -32 1088 -32
WIRE 1680 -32 1680 -128
WIRE 1840 -32 1680 -32
WIRE 1936 -32 1840 -32
WIRE 2464 -32 2464 -128
WIRE 2624 -32 2464 -32
WIRE 2720 -32 2624 -32
WIRE 3264 -32 3264 -128
WIRE 3424 -32 3264 -32
WIRE 3520 -32 3424 -32
WIRE 4128 -32 4128 -128
WIRE 4288 -32 4128 -32
WIRE 4384 -32 4288 -32
WIRE 320 16 320 -32
WIRE 1088 16 1088 -32
WIRE 1840 16 1840 -32
WIRE 2624 16 2624 -32
WIRE 3424 16 3424 -32
WIRE 4288 16 4288 -32
WIRE 160 64 160 -32
WIRE 928 64 928 -32
WIRE 1680 64 1680 -32
WIRE 2464 64 2464 -32
WIRE 3264 64 3264 -32
WIRE 4128 64 4128 -32
WIRE -32 112 -48 112
WIRE 96 112 48 112
WIRE 464 112 464 -16
WIRE 736 112 720 112
WIRE 864 112 816 112
WIRE 1232 112 1232 -16
WIRE 1488 112 1472 112
WIRE 1616 112 1568 112
WIRE 1984 112 1984 -16
WIRE 2272 112 2256 112
WIRE 2400 112 2352 112
WIRE 2768 112 2768 -16
WIRE 3072 112 3056 112
WIRE 3200 112 3152 112
WIRE 3568 112 3568 -16
WIRE 3936 112 3920 112
WIRE 4064 112 4016 112
WIRE 4432 112 4432 -16
WIRE 320 128 320 80
WIRE 1088 128 1088 80
WIRE 1840 128 1840 80
WIRE 2624 128 2624 80
WIRE 3424 128 3424 80
WIRE 4288 128 4288 80
WIRE 160 256 160 160
WIRE 928 256 928 160
WIRE 1680 256 1680 160
WIRE 2464 256 2464 160
WIRE 3264 256 3264 160
WIRE 4128 256 4128 160
FLAG 2256 -1360 0
FLAG 1888 -1360 0
FLAG 464 112 0
FLAG 160 256 0
FLAG 320 128 0
FLAG 1232 112 0
FLAG 928 256 0
FLAG 1088 128 0
FLAG 1984 112 0
FLAG 1680 256 0
FLAG 1840 128 0
FLAG 2768 112 0
FLAG 2464 256 0
FLAG 2624 128 0
FLAG 3568 112 0
FLAG 3264 256 0
FLAG 3424 128 0
FLAG 4432 112 0
FLAG 4128 256 0
FLAG 4288 128 0
FLAG 160 -336 5V
IOPIN 160 -336 In
FLAG 928 -336 5V
IOPIN 928 -336 In
FLAG 1680 -336 5V
IOPIN 1680 -336 In
FLAG 2464 -336 5V
IOPIN 2464 -336 In
FLAG 3264 -320 5V
IOPIN 3264 -320 In
FLAG 4128 -320 5V
IOPIN 4128 -320 In
FLAG -48 112 NPN_enable
IOPIN -48 112 In
FLAG 720 112 NPN_enable
IOPIN 720 112 In
FLAG 1472 112 NPN_enable
IOPIN 1472 112 In
FLAG 2256 112 NPN_enable
IOPIN 2256 112 In
FLAG 3056 112 NPN_enable
IOPIN 3056 112 In
FLAG 3920 112 NPN_enable
IOPIN 3920 112 In
FLAG 1728 -1360 5V
IOPIN 1728 -1360 Out
FLAG 2128 -1360 3.3V
IOPIN 2128 -1360 Out
FLAG 2688 -1472 3.3V
IOPIN 2688 -1472 In
FLAG 2688 -1280 NPN_enable
IOPIN 2688 -1280 Out
FLAG 2576 -1376 PICO_output_pin
IOPIN 2576 -1376 In
FLAG 1744 -1008 0
FLAG 1856 -1216 PICO_output_pin
IOPIN 1856 -1216 Out
FLAG 1968 -656 0
FLAG 2192 -880 NPN_enable
IOPIN 2192 -880 Out
SYMBOL voltage 1792 -1360 R270
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName USB_5V
SYMATTR Value 5
SYMBOL voltage 2160 -1360 R270
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName Pico_3.3V
SYMATTR Value 3.3
SYMBOL npn 96 64 R0
SYMATTR InstName Q1
SYMATTR Value 2N2222
SYMBOL res 64 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 2k
SYMBOL nmos 416 -112 R0
SYMATTR InstName M1
SYMATTR Value IRFZ44N
SYMBOL res 448 -256 R0
SYMATTR InstName Output
SYMATTR Value 25
SYMBOL res 144 -224 R0
SYMATTR InstName R3
SYMATTR Value 20k
SYMBOL cap 304 16 R0
SYMATTR InstName C1
SYMATTR Value 47n
SYMBOL pnp 2624 -1328 M180
SYMATTR InstName Q2
SYMBOL npn 864 64 R0
SYMATTR InstName Q3
SYMATTR Value 2N2222
SYMBOL res 832 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 2k
SYMBOL nmos 1184 -112 R0
SYMATTR InstName M2
SYMATTR Value IRFZ44N
SYMBOL res 1216 -256 R0
SYMATTR InstName Output1
SYMATTR Value 25
SYMBOL res 912 -224 R0
SYMATTR InstName R5
SYMATTR Value 20k
SYMBOL cap 1072 16 R0
SYMATTR InstName C2
SYMATTR Value 47n
SYMBOL npn 1616 64 R0
SYMATTR InstName Q4
SYMATTR Value 2N2222
SYMBOL res 1584 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R6
SYMATTR Value 2k
SYMBOL nmos 1936 -112 R0
SYMATTR InstName M3
SYMATTR Value IRFZ44N
SYMBOL res 1968 -256 R0
SYMATTR InstName Output2
SYMATTR Value 25
SYMBOL res 1664 -224 R0
SYMATTR InstName R7
SYMATTR Value 20k
SYMBOL cap 1824 16 R0
SYMATTR InstName C3
SYMATTR Value 47n
SYMBOL npn 2400 64 R0
SYMATTR InstName Q5
SYMATTR Value 2N2222
SYMBOL res 2368 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R8
SYMATTR Value 2k
SYMBOL nmos 2720 -112 R0
SYMATTR InstName M4
SYMATTR Value IRFZ44N
SYMBOL res 2752 -256 R0
SYMATTR InstName Output3
SYMATTR Value 25
SYMBOL res 2448 -224 R0
SYMATTR InstName R9
SYMATTR Value 20k
SYMBOL cap 2608 16 R0
SYMATTR InstName C4
SYMATTR Value 47n
SYMBOL npn 3200 64 R0
SYMATTR InstName Q6
SYMATTR Value 2N2222
SYMBOL res 3168 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R10
SYMATTR Value 2k
SYMBOL nmos 3520 -112 R0
SYMATTR InstName M5
SYMATTR Value IRFZ44N
SYMBOL res 3552 -256 R0
SYMATTR InstName Output4
SYMATTR Value 25
SYMBOL res 3248 -224 R0
SYMATTR InstName R11
SYMATTR Value 20k
SYMBOL cap 3408 16 R0
SYMATTR InstName C5
SYMATTR Value 47n
SYMBOL npn 4064 64 R0
SYMATTR InstName Q7
SYMATTR Value 2N2222
SYMBOL res 4032 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R12
SYMATTR Value 2k
SYMBOL nmos 4384 -112 R0
SYMATTR InstName M6
SYMATTR Value IRFZ44N
SYMBOL res 4416 -256 R0
SYMATTR InstName Output5
SYMATTR Value 25
SYMBOL res 4112 -224 R0
SYMATTR InstName R13
SYMATTR Value 20k
SYMBOL cap 4272 16 R0
SYMATTR InstName C6
SYMATTR Value 47n
SYMBOL bv 1744 -1184 R0
SYMATTR InstName B1
SYMATTR Value V=delay(V(3.3V), 500m)
SYMBOL voltage 1968 -816 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value PULSE(0 3.3 0.5 20n 20n 1 2)
SYMBOL res 2128 -896 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R4
SYMATTR Value 15k
SYMBOL res 1856 -1232 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R14
SYMATTR Value 15k
TEXT 1568 -1592 Left 2 !.tran 10 startup
TEXT 1576 -1648 Left 2 ;0. Simulate PICO startup behaviour and toggling power MOSFET on/off
TEXT 2760 -1512 Left 2 ;1. The PNP is used to turn on all NPN transistors while the PICO is initializing the micropython\ncode, thus keeping the MOSFETs off, preventing power flickering during startup
TEXT 1872 -1160 Left 2 ;1. Emulate the PICO ready pin behavior
TEXT 272 -352 Left 2 ;Pico Port 1
TEXT 1016 -368 Left 2 ;Pico Port 2
TEXT 1784 -368 Left 2 ;Pico Port 3
TEXT 2568 -368 Left 2 ;Pico Port 4
TEXT 3360 -368 Left 2 ;Pico Port 5
TEXT 4224 -360 Left 2 ;Pico Port 6
TEXT 2064 -792 Left 2 ;2. Emulate PICO pins turning on/off