* DIODES INCORPORATED AND ITS AFFILIATED COMPANIES AND SUBSIDIARIES (COLLECTIVELY, "DIODES") * PROVIDE THESE SPICE MODELS AND DATA (COLLECTIVELY, THE "SM DATA") "AS IS" AND WITHOUT ANY * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY * OR FITNESS FOR A PARTICULAR PURPOSE, ANY WARRANTY ARISING FROM COURSE OF DEALING OR COURSE OF * PERFORMANCE, OR ANY WARRANTY THAT ACCESS TO OR OPERATION OF THE SM DATA WILL BE UNINTERRUPTED, * OR THAT THE SM DATA OR ANY SIMULATION USING THE SM DATA WILL BE ERROR FREE. TO THE MAXIMUM * EXTENT PERMITTED BY LAW, IN NO EVENT WILL DIODES BE LIABLE FOR ANY DIRECT OR INDIRECT, * SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION WITH * THE PRODUCTION OR USE OF SM DATA, HOWEVER CAUSED AND UNDER WHATEVER CAUSE OF ACTION OR THEORY * OF LIABILITY BROUGHT (INCLUDING, WITHOUT LIMITATION, UNDER ANY CONTRACT, NEGLIGENCE OR OTHER * TORT THEORY OF LIABILITY), EVEN IF DIODES HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, * AND DIODES' TOTAL LIABILITY (WHETHER IN CONTRACT, TORT OR OTHERWISE) WITH REGARD TO THE SM * DATA WILL NOT, IN THE AGGREGATE, EXCEED ANY SUMS PAID BY YOU TO DIODES FOR THE SM DATA. * PSpice Model Editor - Version 16.6.0 *************************************************************************************** *************************************************************************************** * * DEVICE : AL8853 - Diodes Incorporated * DATE : 22NOV2019 * SIMULATOR : PSPICE 16.6 * MODEL VERSION : 1.0 * *************************************************************************************** *************************************************************************************** * * DEVICE NOTES: * Following features are been modelled: * 1. Under Voltage Lockout (UVLO) * 2. Output Overvoltage Protection * 3. Overvoltage UVLO Protection * 4. Overcurrent Protection * 5. LED Cathode Short to GND Protection * 6. Inductor or Diode short circuit Protection * 7. Thermal Shutdown * *************************************************************************************** *************************************************************************************** *$ .SUBCKT AL8853 PWM OVP CMP FB VIN GATE GND CS PARAMS: TAMB=27 XU1 PWM OVP CMP FB VIN GATE GND CS Block_1_0 .ENDS *$ .SUBCKT Block_1_0 PWM OVP CMP FB VIN GATE GND CS PARAMS: TAMB={TAMB} IS1 0 CS 50U R70 SHUTDOWN SHUTDOWN_DEL 100 C70 SHUTDOWN_DEL 0 1u IC=0 GComparator 23 0 VALUE = {(((0.2631*V(Ta,0))+((640*(1-V(SHUTDOWN,0)))+50))*1U)} VCCVS1_in VIN 23 HCCVS1 IQ 0 VCCVS1_in 1 XU9 Ta IC_PD IC_TEMP IC_TEMP_0 XU6 I_GATE_AVG IQ I_GATE IC_PD VIN PD_0 R1 PWM 0 220K ECS1 VCC_INT_J1 0 VALUE = {IF(V(UVLO,0)<0.5,7.2,0)} XU7 SNS_CL SS_Done CS PWM_GATE UVLO OVP VIN PWM CMP SHUTDOWN IC_TEMP + FB_OV_SNS_CL_0 XU1 I_GATE PWM_GATE VCC_INT_J1 GATE DRIVER_0 XU2 PWM_GATE CMP Slope_ramp SHUTDOWN SNS_CL CS CLK_ADV CLK PWM_BLOCK_0 XU5 SS_Done SHUTDOWN FB PWM CMP GM_AMP_0 XU4 CLK_ADV Slope_ramp CLK Oscillator_0 .ENDS *$ .SUBCKT IC_TEMP_0 Ta PD IC_TEMP PARAMS: TAMB={TAMB} *IS1 0 25 1 *ECS2 Ta 0 VALUE = {27-((1-V(25,0))/1M)} ECS2 Ta 0 VALUE = {TAMB} *R1 25 0 1 TC=1M ECS1 IC_TEMP 0 VALUE = {V(PD,0)*105+V(Ta,0)} .ENDS *$ .SUBCKT PD_0 I_GATE_AVG IQ I_GATE PD VIN R5 27 I_GATE_AVG 833M C4 I_GATE_AVG 0 100U IC=0 R4 28 27 833M C3 27 0 100U IC=0 EVCVS1 29 0 I_GATE 0 1 XU2 0 28 DIODE_SAN_0 R3 29 28 1 ECS3 PD 0 VALUE = {V(VIN,0)*(V(I_GATE_AVG,0)+V(IQ,0))} R2 30 31 100M C2 31 0 100U IC=0 R1 32 30 100M ECS2 I_GATE_RMS 0 VALUE = {SQRT(V(31,0))} C1 30 0 100U IC=0 ECS1 32 0 VALUE = {V(I_GATE,0)^2} .ENDS *$ .SUBCKT FB_OV_SNS_CL_0 SNS_CL SS_Done SENSE PWM_GATE UVLO OVP VIN PWM COMP + SHUTDOWN Ta V9 Y4 0 160 V8 Y3 0 30 V7 Y2 0 100m V2 50 0 1.2 V3 56 0 4.9 V6 58 0 1.2 IS3 0 59 1M V5 64 0 3.2 IS1 0 62 1M V4 66 0 400M V1 68 0 300M VREF 69 0 2 XU20 VF4 45 46 AND2_SAN_0 + PARAMS: VDD=1 VSS=0 VTH=0.5 XU19 UVLO 45 INV_SAN_0 + PARAMS: VDD=1 VSS=0 C4 46 OV_UVLO_HP 1U IC=0 R1 OV_UVLO_HP 0 1 ECS8 VIN_HP 0 VALUE = {IF(V(SS_Done,0)>0.5,V(X,0),0)} XU18 48 49 INV_SAN_0 + PARAMS: VDD=1 VSS=0 GVCCS1 0 CS_HIGH_Pre 49 0 4.901M XU1 50 SENSE 0 48 COMPHYS2_SAN_0 + PARAMS: VDD=1 VSS=0 XU6 VIN_HP OV_UVLO_HP VIN_OV_UVLO_HPOR OR2_SAN_0 + PARAMS: VDD=1 VSS=0 C5 VIN 47 1U IC=0 R2 47 0 1 XU50 47 X MINIMUM_ON_TIME XU17 VF5 VF6 VF4 AND2_SAN_0 + PARAMS: VDD=1 VSS=0 VTH=0.5 XU16 FBX_OVP_UVLO VF6 INV_SAN_0 + PARAMS: VDD=1 VSS=0 XU15 SS_Done VF5 INV_SAN_0 + PARAMS: VDD=1 VSS=0 *ECS7 VINORPWM 0 VALUE = {IF(V(VIN_OV_UVLO_HPOR,0)>0,V(VIN_OV_UVLO_HPOR,0),0)} ECS7 VINORPWM 0 VALUE = {IF(V(SHD_RST,0)>0,V(SHD_RST,0),0)} XU14 SD_Set VINORPWM SHUTDOWN SRLATCHRHP_SAN_0 + PARAMS: VDD=1 VSS=0 XU12 57 TSD PWMLOW SD_Set OR3_SAN_0 + PARAMS: VDD=1 VSS=0 ECS5 PWMLOW 0 VALUE = {IF(V(59,0)>0.5,1,0)} XU13 PWM 58 0 60 COMPHYS2_SAN_0 + PARAMS: VDD=1 VSS=0 SW3 59 0 60 0 S_VSWITCH_1 C3 59 0 40U IC=0 *ECS6 TSD 0 VALUE = {IF(V(Ta,0)>160,1,0)} XU100 Ta Y4 Y3 TSD COMPHYS2_SAN_0 XU11 61 CSHIGH COMP_HIGH 57 OR3_SAN_0 + PARAMS: VDD=1 VSS=0 XU10 FBX_OVP FBX_OVP_UVLO UVLO 61 OR3_SAN_0 + PARAMS: VDD=1 VSS=0 ECS4 63 0 VALUE = {IF(V(62,0)>0.5,1,0)} *XU9 63 VINORPWM COMP_HIGH SRLATCHRHP_SAN_0 XU9 63 Y1 COMP_HIGH SRLATCHRHP_SAN_0 + PARAMS: VDD=1 VSS=0 XU8 64 COMP 0 65 COMPHYS2_SAN_0 + PARAMS: VDD=1 VSS=0 SW1 62 0 65 0 S_VSWITCH_2 C2 62 0 74U IC=0 XU7 56 VIN 66 UVLO COMPHYS2_SAN_0 + PARAMS: VDD=1 VSS=0 ECS3 OV_UVLO_THRD 0 VALUE = {100M+(V(SS_Done,0)*100M)} XU3 OVP_Comp VINORPWM FBX_OVP SRLATCHRHP_SAN_0 + PARAMS: VDD=1 VSS=0 XU2 OV_UVLO_THRD OVP 0 FBX_OVP_UVLO COMPHYS2_SAN_0 + PARAMS: VDD=1 VSS=0 ECS2 67 0 VALUE = {IF(V(CS_HIGH_Pre,0)>0.45,1,0)} XU5 67 VINORPWM CSHIGH SRLATCHRHP_SAN_0 + PARAMS: VDD=1 VSS=0 SW2 CS_HIGH_Pre 0 SHUTDOWN 0 S_VSWITCH_3 C1 CS_HIGH_Pre 0 100N IC=0 *ECS1 SNS_CL 0 VALUE = {IF(V(SENSE,0)>V(68,0),1,0)} ECS1 SNS_CL_PRE 0 VALUE = {IF(V(SENSE,0)>V(68,0),1,0)} RCS_F SNS_CL_PRE SNS_CL 141 CCS_F SNS_CL 0 1n XU4 OVP 69 Y2 OVP_Comp COMPHYS2_SAN_0 XU53 VINORPWM Y1 MINIMUM_ON_TIME XU101 TSD TSD_FALL FALL_EDGE_DET_SAN XU103 OVP_Comp OVP_Comp_Fall FALL_EDGE_DET_SAN XU102 TSD_FALL VIN_OV_UVLO_HPOR OVP_Comp_Fall SHD_RST OR3_SAN_0 + PARAMS: VDD=1 VSS=0 .MODEL S_VSWITCH_1 VSWITCH (RON=1M ROFF=1G VON=800M VOFF=200M) .MODEL S_VSWITCH_2 VSWITCH (RON=1M ROFF=1G VON=800M VOFF=200M) .MODEL S_VSWITCH_3 VSWITCH (RON=1M ROFF=1G VON=800M VOFF=200M) .ENDS * USE FED at the output of OVP comparator and OR it with VIN_OV_UVLO_HPOR *$ .SUBCKT MINIMUM_ON_TIME IN OUT PARAMS: VDD=1 VSS=0 MIN_ON_TIME=50n C_C1 0 N06463 1n IC=0 TC=0,0 C_C2 0 N06605 1n IC=0 TC=0,0 V_V3 N06765 0 {VDD} R_R2 0 N06605 {19*{MIN_ON_TIME}/(13.86n)} TC=0,0 E_ABM7 N06563 0 VALUE { {IF(V(N06463)>VTH,VSS,VDD)} } E_ABM9 OUT 0 VALUE { {if(V(IN)>{VTH} | V(N06605)>{VTH},{VDD},{VSS})} + } R_R1 IN N06463 {MIN_ON_TIME/(20n)} TC=0,0 E_ABM8 N06583 0 VALUE { {if(V(IN)>{VTH} & V(N06563)>{VTH},{VDD},{VSS})} + } X_S1 N06583 0 N06765 N06605 MOT_COPY_S1 .PARAM vth={(vdd+vss)/2} .ENDS MINIMUM_ON_TIME *$ .subckt MOT_COPY_S1 1 2 3 4 S_S1 3 4 1 2 _S1 RS_S1 1 2 1G .MODEL _S1 VSWITCH Roff=10G Ron=10m Voff=0.2 Von=0.8 .ends MOT_COPY_S1 *$ .SUBCKT DRIVER_0 I_GATE PWM VCC_INT GATE VCCVS1_in 100 GATE HCCVS1 I_GATE 0 VCCVS1_in 1 SW2 100 0 PWM 0 S_VSWITCH_1 SW1 VCC_INT 100 PWM 0 S_VSWITCH_2 .MODEL S_VSWITCH_1 VSWITCH (RON=9.09 ROFF=1G VON=200M VOFF=800M) .MODEL S_VSWITCH_2 VSWITCH (RON=18.18 ROFF=1G VON=800M VOFF=200M) .ENDS *$ .SUBCKT PWM_BLOCK_0 PWM_OUT COMP SLOPE_R SHUTDOWN SNS_CL SENSE CLK_ADV CLK XU6 102 CLK_ADV CLK_ADV_J1 AND2_SAN_1 + PARAMS: VDD=1 VSS=0 VTH=0.5 XU4 SHUTDOWN 102 INV_SAN_0 + PARAMS: VDD=1 VSS=0 XU3 105 CLK CLK_SDNBAR AND2_SAN_1 + PARAMS: VDD=1 VSS=0 VTH=0.5 XU2 SHUTDOWN 105 INV_SAN_0 + PARAMS: VDD=1 VSS=0 XU5 PWM_OUT SR_OUT_J1 CLK_ADV_J1 CLK_SDNBAR MIN_ON_OFF_TIME_0 XU1 SHUTDOWN 106 SNS_CL 107 OR3_SAN_0 *XU1 SHUTDOWN Y SNS_CL 107 OR3_SAN_0 + PARAMS: VDD=1 VSS=0 XU36 CLK_SDNBAR 107 SR_OUT_J1 SRLATCHRHP_SAN_0 + PARAMS: VDD=1 VSS=0 EComparator 106 0 VALUE = {IF(V(109,0)>V(108,0),1,0)} *XU51 106 Y MINIMUM_ON_TIME Ecomp_ramp 108 0 VALUE = {V(COMP,0)-V(SLOPE_R,0)} EVCVS1 109 0 SENSE 0 3 .ENDS *$ .SUBCKT MIN_ON_OFF_TIME_0 PWM SR_OUT CLK_ADV CLK XU4 116 TMINON PWM AND2_SAN_1 + PARAMS: VDD=1 VSS=0 VTH=0.5 XU1 TMINON CLK_ADV 116 SRLATCHRHP_SAN_1 + PARAMS: VDD=1 VSS=0 XU3 TMIN SR_OUT TMINON OR2_SAN_0 + PARAMS: VDD=1 VSS=0 ECS1 118 0 VALUE = {IF(V(117,0)>0.5,1,0)} C1 117 0 869N IC=0 R1 117 TMIN 1 XU2 CLK 118 TMIN SRLATCHRHP_SAN_1 + PARAMS: VDD=1 VSS=0 .ENDS *$ .SUBCKT GM_AMP_0 SS_Done SHUTDOWN FB PWM COMP V3 136 0 0 V2 137 0 200M VHYS 138 0 1.2 VREF 139 0 2.5 V1 134 0 1 IS1 0 SS 22U V4 142 0 4.5 XU18 131 SS_Done DIODE_SAN_0 C6 SS_Done 0 1 ECS8 131 0 VALUE = {V(132,0)} SW1 CMP 0 SHUTDOWN 0 S_VSWITCH_1 GCS3 CMP 0 VALUE = {LIMIT(((V(FB,0)-V(VREF,0))*100U),60U,-30U)} C2 CMP 0 1F IC=0 R1 CMP 0 31.62MEG XU4 SS 134 DIODE_SAN_0 ECS2 135 0 VALUE = {LIMIT(V(SS,0),0.2,0)} XU1 SS 137 136 132 COMPHYS2_SAN_0 + PARAMS: VDD=1 VSS=0 ECS1 VREF 0 VALUE = {V(135,0)*V(Dutycycle,0)} XU5 PWM 139 138 140 COMPHYS2_SAN_0 + PARAMS: VDD=1 VSS=0 R5 141 Dutycycle 318 C4 Dutycycle 0 1U IC=0 R4 140 141 318 C3 141 0 1U IC=0 C1 SS 0 1U IC=0 SW3 SS 0 SHUTDOWN 0 S_VSWITCH_2 R2 CMP COMP 1 XU2 COMP 142 DIODE_SAN_0 .MODEL S_VSWITCH_1 VSWITCH (RON=1M ROFF=1G VON=800M VOFF=200M) .MODEL S_VSWITCH_2 VSWITCH (RON=1M ROFF=1G VON=800M VOFF=200M) .ENDS *$ .SUBCKT Oscillator_0 CLK_ADV Slope_ramp CLK V1 SLOPE_AMP 0 2 IS2 0 153 6M R3 148 CLK 1 *C4 148 0 28N IC=0 C4 148 0 72.15N IC=0 XU3 149 148 CLK SRLATCHRHP_SAN_1 + PARAMS: VDD=1 VSS=0 XU2 CLK_ADV 149 150 SRLATCHRHP_SAN_1 + PARAMS: VDD=1 VSS=0 R1 150 151 1 C3 151 0 601.24N IC=0 ECS12 149 0 VALUE = {IF(V(151,0)>0.5,1,0)} ECS3 152 0 VALUE = {IF(V(CLK,0)>0.5,1,0)} SW7 Slope_ramp 0 152 0 S_VSWITCH_1 GCS15 Slope_ramp 0 VALUE = {-120K*1U*V(SLOPE_AMP,0)} C7 Slope_ramp 0 1U IC=0 ECS2 154 0 VALUE = {IF(V(153,0)>0.5,1,0)} ECS1 156 0 VALUE = {IF(V(155,0)>0.5,1,0)} R2 155 CLK_ADV 1 *C2 155 0 28N IC=0 C2 155 0 72.2N IC=0 XU5 154 156 CLK_ADV SRLATCHRHP_SAN_1 + PARAMS: VDD=1 VSS=0 SW2 153 0 156 0 S_VSWITCH_2 C1 153 0 100N IC=0 XU53 0 153 DIODE_SAN_0 .MODEL S_VSWITCH_1 VSWITCH (RON=1M ROFF=1G VON=800M VOFF=200M) .MODEL S_VSWITCH_2 VSWITCH (RON=1M ROFF=1G VON=800M VOFF=200M) .ENDS *$ .SUBCKT DIODE_SAN_0 1 2 D1 1 2 IDEAL .MODEL IDEAL D N=1M IS=1E-15 TT=1F .ENDS DIODE_SAN_0 *$ .SUBCKT AND2_SAN_0 IN1 IN2 OUT PARAMS:VDD=1.8 VSS=0 VTH=0.9 E1 OUT1 0 VALUE={IF(V(IN1)>{VTH}&V(IN2)>{VTH},{VDD},0)} R1 OUT1 OUT 0.1 C1 OUT 0 1N IC=0 .ENDS AND2_SAN_0 *$ .SUBCKT INV_SAN_0 IN OUT PARAMS: VDD=1 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E1 OUT1 0 VALUE={IF(V(IN)>{VTH},{VSS},{VDD})} R1 OUT1 OUT 1 C1 OUT 0 1N IC=0 .ENDS INV_SAN_0 *$ * .SUBCKT COMPHYS2_SAN_0 INP INM HYS VOUT PARAMS: VDD=1.8 VSS=0 .PARAM VTH = {( {VDD} + {VSS})/2 } EHYS INM INM_INT VALUE = {IF (V(VOUT)>{VTH},V(HYS),0)} E1 VOUT_PRE 0 VALUE = {IF(V(INP)>V(INM_INT),{VDD},{VSS})} R1 VOUT_PRE VOUT 1 C1 VOUT 0 1N IC=0 .ENDS COMPHYS2_SAN_0 *$ .SUBCKT OR2_SAN_0 IN1 IN2 OUT PARAMS:VDD=1 VSS=0 .PARAM VTH = {( {VDD} + {VSS})/2} E1 OUT1 0 VALUE={IF(V(IN1)<{VTH}&V(IN2)<{VTH},{VSS},{VDD})} R5 OUT1 OUT 1 C5 OUT 0 1N IC=0 .ENDS OR2_SAN_0 *$ ****SRLATCHRHP_SAN**** .SUBCKT SRLATCHRHP_SAN_0 S R Q PARAMS: VDD=1 VSS=0 .PARAM VTH = 0.1 E1 QPRE 0 VALUE = {IF((V(S)VTH,VSS,IF(V(S)>VTH&V(R)VTH&V(R)>VTH,VSS,VSS))))} R1 QPRE OUT 1 C1 OUT 0 1N IC=0 E3 Q 0 VALUE = {IF (V(OUT)>VTH,VDD,0)} .ENDS SRLATCHRHP_SAN_0 *$ .SUBCKT OR3_SAN_0 IN1 IN2 IN3 OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH = {( {VDD} + {VSS})/2} E1 OUT1 0 VALUE={IF(V(IN1)<{VTH}&V(IN2)<{VTH}&V(IN3)<{VTH},{VSS},{VDD})} R1 OUT1 OUT 1 C1 OUT 0 1N IC=0 .ENDS OR3_SAN_0 *$ .SUBCKT AND2_SAN_1 IN1 IN2 OUT PARAMS:VDD=1.8 VSS=0 VTH=0.9 E1 OUT1 0 VALUE={IF(V(IN1)>{VTH}&V(IN2)>{VTH},{VDD},0)} R1 OUT1 OUT 1 C1 OUT 0 1N IC=0 .ENDS AND2_SAN_1 *$ ****SRLATCHRHP_SAN**** .SUBCKT SRLATCHRHP_SAN_1 S R Q PARAMS: VDD=1 VSS=0 .PARAM VTH = 0.5 E1 QPRE 0 VALUE = {IF((V(S)VTH,VSS,IF(V(S)>VTH&V(R)VTH&V(R)>VTH,VSS,VSS))))} R1 QPRE OUT 1 C1 OUT 0 1N IC=0 E3 Q 0 VALUE = {IF (V(OUT)>VTH,VDD,0)} .ENDS SRLATCHRHP_SAN_1 .END *$ * SCMP13WBC8W1 LED model * Model Generated by ROHM * All Rights Reserved * Commercial Use or * Resale Restricted * Date: 2011/06/20 .subckt LED A C D1 A C SCMP13WBC8W1 .MODEL SCMP13WBC8W1 D + IS=10.000E-21 + N=2.3976 + RS=.1837 + IKF=8.4401 + CJO=1.0000E-12 + M=.3333 + VJ=.75 + BV=100 + IBV=100.00E-6 + TT=5.0000E-9 *+ ISR=100.00E-12 .ENDS LED *$ .SUBCKT DMT10H010LK3 10 20 30 * TERMINALS: D G S M1 1 2 3 3 NMOS L = 1E-006 W = 1E-006 RD 10 1 0.003569 RS 30 3 0.001 RG 20 2 1.2 CGS 2 3 3.092E-009 EGD 12 0 2 1 1 VFB 14 0 0 FFB 2 1 VFB 1 CGD 13 14 2.1E-009 R1 13 0 1 D1 12 13 DLIM DDG 15 14 DCGD R2 12 15 1 D2 15 0 DLIM DSD 3 10 DSUB .MODEL NMOS NMOS LEVEL = 3 VMAX = 5.378E+005 ETA = 0.001 VTO = 2.685 + TOX = 6E-008 NSUB = 1E+016 KP = 53.29 U0 = 400 KAPPA = 10 .MODEL DCGD D CJO = 3.5E-010 VJ = 0.8 M = 0.6 .MODEL DSUB D IS = 2.273E-010 N = 1.184 RS = 0.0002213 BV = 103 CJO = 2E-009 VJ = 0.8 M = 0.6 .MODEL DLIM D IS = 0.0001 .ENDS *$ .SUBCKT SDT 1 2 D1 1 2 ideal .model ideal D IS=350.02E-9 +N=1.0363 +RS=18.307E-3 +IKF=3.7362 +CJO=1.1962E-9 +M=.60651 +VJ=1.1416 *+ISR=99.900E-3 +NR=.5005 +XTI=-14 +BV=100 +IBV=100.00E-6 +TT=5.0000E-9 .ENDS SDT *$ *FALL_EDGE_DET_SAN .SUBCKT FALL_EDGE_DET_SAN IN OUT PARAMS:VDD=1.8 VSS=0 T=100n .PARAM VTH={({VDD}+{VSS})/2} XU2 IN INT_1 INV PARAMS:VDD={VDD} VSS={VSS} XU1 INT_1 INT_2 OUT AND2_SAN PARAMS:VDD={VDD} VSS={VSS} R1 IN INT_2 {{{T}*1E9}-2} C1 INT_2 0 1.443n IC=0 .ENDS FALL_EDGE_DET_SAN *$ .SUBCKT INV INV_IN INV_OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E2 INV_OUT1 0 VALUE={if(V(INV_IN)>{VTH},{VSS},{VDD})} R4 INV_OUT1 INV_OUT 1 C4 INV_OUT 0 1n IC=0 .ENDS INV *$ .SUBCKT AND2_SAN IN1 IN2 OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E1 OUT1 0 VALUE={if(V(IN1)>{VTH}&V(IN2)>{VTH},{VDD},0)} R1 OUT1 OUT 1 C1 OUT 0 1n IC=0 .ENDS AND2_SAN *$ * PSpice Model Editor - Version 16.6.0 *$ *************************************************************************************** *************************************************************************************** * * DEVICE : AL8860 - Diodes Incorporated * DATE : 14AUG2019 * SIMULATOR : PSPICE 16.6 * MODEL VERSION : 1.0 * *************************************************************************************** *************************************************************************************** * * DEVICE NOTES: * Following features are been modelled: * 1. Soft-Start * 2. PWM Dimming * 3. Analog Dimming * 4. Pulse Skip Mode * 5. Ron variation vs Temperature * 6. LED Open circuit protection * 7. LED Short circuit protection * 8. Over Temperature Protection * *************************************************************************************** *************************************************************************************** .SUBCKT AL8860 CTRL GND SET SW VIN PARAMS: TEMP_CHANGE_RATE=500U TAMB=27 + RTJA=147 E_E4 N148834 GND N148696 GND 1 C_C15 GND N148696 1n IC=0 TC=0,0 E_ABM15 N148964 0 VALUE { if(V(TEMP) > 150-(30*V(OTP)),1,0) } R_R7 N146146 REF 0.1 TC=0,0 X_U12 PWM ISW I_WR IP_INT N07827 ipeaksampler PARAMS: R_R2 RISING_THRS N145465 50 TC=0,0 E_ABM3 RISING_THRS 0 VALUE { V(CTRL_LIMIT)*1.2 } E_ABM20 VRON 0 VALUE { ((0.0016m*V(TEMP)*V(TEMP)) + (0.5137m*V(TEMP)) + + 17.383m)*V(ISW) } C_C12 OTP GND 1n TC=0,0 E_ABM22 RON 0 VALUE { V(SW)/(V(ISW)+10u) } C_C9 GND N148806 1n IC=0 TC=0,0 X_U11 N148806 N148802 diode PARAMS: C_C17 GND CTRL 71.43p IC=0 TC=0,0 E_ABM16 VIN_UVLO 0 VALUE { if(V(VIN) > 4.2-(0.2*V(VIN_UVLO)),1,0) } E_ABM4 N145295 0 VALUE { V(RISING_THRS)-V(CTRL_LIMIT)*0.8 } E_ABM8 IOUT 0 VALUE { (V(N07827))/1.1 } R_R11 N148964 OTP 500 TC=0,0 E_ABM7 IRMS 0 VALUE { ((V(IOUT)**2)+((0.26*V(IOUT))**2)/12)*V(D) } E_ABM1 REF 0 VALUE { min(max((0.8928*(V(VIN)-0.75)),0),2.5) } C_C5 GND N140441 1u IC=0 TC=0,0 R_R10 N140441 D 6 TC=0,0 E_ABM27 N148696 0 VALUE { V(IRMS)*((V(VRON)/V(Isw))+0.2)*{Rtja} } E_ABM2 CTRL_LIMIT 0 VALUE { min(V(CTRL),2.5) } C_C13 GND N145359 1n TC=0,0 C_C1 GND N145465 1n TC=0,0 R_R5 N140479 N140441 6 TC=0,0 G_G2 N148802 N148806 N149178 GND 1 X_U3 SENSE N145465 N145295 N145353 COMPHYS2_SAN PARAMS: VDD=1.8 VSS=0 X_U16 GND CTRL diode PARAMS: E_E3 N145603 GND VRON GND 1 E_ABM24 N149178 0 VALUE { 1n/{Temp_Change_rate} } X_U10 N148834 N148802 diode PARAMS: C_C11 GND D 1u IC=0 TC=0,0 X_H1 SW SW1 ISW GND AL8860_H1 E_E1 SENSE GND VIN SET 25 X_U6 GND SW1 diode PARAMS: E_ABM5 PWM 0 VALUE { IF( V(N145353)>0.5 | V(N145359)>0.5,1,0) } V_V1 N146278 GND 4.5 X_U15 CTRL N146146 diode PARAMS: E_ABM12 N145529 0 VALUE { if((V(CTRL_LIMIT)<0.3) | (V(VIN_UVLO)<0.5) | + (V(OTP)>0.5) ,1,0) } E_ABM13 N140413 0 VALUE { IF(V(PWM)>0.5,0,1) } R_R12 N145529 N145359 1 TC=0,0 X_S1 PWM GND SW1 N145603 AL8860_S1 I_I5 N146278 CTRL DC 1.786u E_E2 N140479 GND N140413 GND 1 G_G1 N148802 N148834 N149178 GND 1 E_ABM10 TEMP 0 VALUE { (V(N148806)+{Tamb}) } .ENDS .subckt AL8860_H1 1 2 3 4 H_H1 3 4 VH_H1 1 VH_H1 1 2 0V .ends AL8860_H1 *$ .subckt AL8860_S1 1 2 3 4 S_S1 3 4 1 2 _S1 RS_S1 1 2 1G .MODEL _S1 VSWITCH Roff=1G Ron=200m Voff=0.8 Von=0.2 .ends AL8860_S1 *$ .subckt ipeaksampler pwm isw i_wr ip_int ip c5 ip 0 1n ic=0 xu7 pwm 5 rise_edge_det_san_0 + params: VDD=1 VSS=0 T=100n sw3 ip ip_int 5 0 s_vswitch_1 c4 i_wr 0 1u ic=0 r4 isw i_wr 100m c3 ip_int 0 1n ic=0 sw2 ip_int i_wr pwm 0 s_vswitch_2 .model s_vswitch_1 vswitch + ron=0.01 + roff=1e+009 + von=0.8 + voff=0.2 .model s_vswitch_2 vswitch + ron=0.01 + roff=1e+009 + von=0.2 + voff=0.8 .ends ipeaksampler *$ .subckt diode 1 2 d1 1 2 ideal .model ideal d + n=0.001 + is=1e-015 .ends diode *$ .subckt COMPHYS2_SAN INP INM HYS VOUT PARAMS: VDD=1 VSS=0 .PARAM VTH = {( {VDD} + {VSS})/2 } EHYS INM INM_INT value = {if (V(VOUT)>{VTH},V(HYS),0)} E1 VOUT_PRE 0 value = {if(V(INP)>V(INM_INT),{VDD},{VSS})} R1 VOUT_PRE VOUT 1 C1 VOUT 0 1n IC=0 .ends COMPHYS2_SAN *$ .SUBCKT RISE_EDGE_DET_SAN_0 IN OUT PARAMS:VDD=1 VSS=0 T=100N .PARAM VTH={({VDD}+{VSS})/2} XU1 IN IN2 OUT AND PARAMS:VDD={VDD} VSS={VSS} XU2 IN OUT_IN INV PARAMS:VDD={VDD} VSS={VSS} XU3 OUT_IN IN2 DIODE R1 OUT_IN IN2 {{{T}*1E9}} C1 IN2 0 1.443N .ENDS RISE_EDGE_DET_SAN_0 *$ .SUBCKT AND IN1 IN2 OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E1 OUT1 0 VALUE={IF(V(IN1)>{VTH}&V(IN2)>{VTH},{VDD},{VSS})} R2 OUT1 OUT 1 C2 OUT 0 1N .ENDS AND *$ .SUBCKT INV INV_IN INV_OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E2 INV_OUT1 0 VALUE={IF(V(INV_IN)>{VTH},{VSS},{VDD})} R4 INV_OUT1 INV_OUT 1 C4 INV_OUT 0 1N .ENDS INV *$ ** Schottky diode ** .subckt B240A A B DSD1 A B DI_B240A .MODEL DI_B240A D ( IS=7.98u RS=13.4m BV=40.0 IBV=500u + CJO=370p M=0.333 N=1.13 TT=1.44n ) .ENDS B240A *$ ** LED Model ** .subckt LEDR A B DLED1 A B D_CQX35A_1 .MODEL D_CQX35A_1 D( IS= 9.43000000000000E-0017 N=2.13 BV=5 IBV=10U + RS=2.08 CJO=63.8P VJ=3.4 M=226M FC=500M + TT=25.9N EG=1.11 XTI=3 KF=0 AF=1 ) .ENDS LEDR *$ * PSpice Model Editor - Version 16.6.0 *$ *************************************************************************************** *************************************************************************************** * * DEVICE : AL8860 - Diodes Incorporated * DATE : 23AUG2019 * SIMULATOR : PSPICE 16.6 * MODEL VERSION : 1.0 * *************************************************************************************** *************************************************************************************** * * DEVICE NOTES: * Following features are been modelled: * 1. Soft-Start * 2. PWM Dimming * 3. Analog Dimming * 4. Pulse Skip Mode * 5. Ron variation vs Temperature * 6. LED Open circuit protection * 7. LED Short circuit protection * 8. Over Temperature Protection * *************************************************************************************** *************************************************************************************** .SUBCKT AL8860Q CTRL GND SET SW VIN PARAMS: TEMP_CHANGE_RATE=500U TAMB=27 E_E4 N148834 GND N148696 GND 1 C_C15 GND N148696 1n IC=0 TC=0,0 E_ABM15 N148964 0 VALUE { if(V(TEMP) > 150-(30*V(OTP)),1,0) } R_R7 N146146 REF 0.1 TC=0,0 X_U12 PWM ISW I_WR IP_INT N07827 ipeaksampler PARAMS: R_R2 RISING_THRS N145465 50 TC=0,0 E_ABM3 RISING_THRS 0 VALUE { V(CTRL_LIMIT)*1.2 } E_ABM20 VRON 0 VALUE { ((0.0016m*V(TEMP)*V(TEMP)) + (0.5137m*V(TEMP)) + + 17.383m)*V(ISW) } C_C12 OTP GND 1n TC=0,0 E_ABM22 RON 0 VALUE { V(SW)/(V(ISW)+10u) } C_C9 GND N148806 1n IC=0 TC=0,0 X_U11 N148806 N148802 diode PARAMS: C_C17 GND CTRL 71.43p IC=0 TC=0,0 E_ABM16 VIN_UVLO 0 VALUE { if(V(VIN) > 4.2-(0.2*V(VIN_UVLO)),1,0) } E_ABM4 N145295 0 VALUE { V(RISING_THRS)-V(CTRL_LIMIT)*0.8 } E_ABM8 IOUT 0 VALUE { (V(N07827))/1.1 } R_R11 N148964 OTP 500 TC=0,0 E_ABM7 IRMS 0 VALUE { ((V(IOUT)**2)+((0.26*V(IOUT))**2)/12)*V(D) } E_ABM1 REF 0 VALUE { min(max((0.8928*(V(VIN)-0.75)),0),2.5) } C_C5 GND N140441 1u IC=0 TC=0,0 R_R10 N140441 D 6 TC=0,0 E_ABM27 N148696 0 VALUE { V(IRMS)*((V(VRON)/(V(Isw)))+0.2)* 56 } E_ABM2 CTRL_LIMIT 0 VALUE { min(V(CTRL),2.5) } C_C13 GND N145359 1n TC=0,0 C_C1 GND N145465 1n TC=0,0 R_R5 N140479 N140441 6 TC=0,0 G_G2 N148802 N148806 N149178 GND 1 X_U3 SENSE N145465 N145295 N145353 COMPHYS2_SAN PARAMS: VDD=1.8 VSS=0 X_U16 GND CTRL diode PARAMS: E_E3 N145603 GND VRON GND 1 E_ABM24 N149178 0 VALUE { 1n/{Temp_Change_rate} } X_U10 N148834 N148802 diode PARAMS: C_C11 GND D 1u IC=0 TC=0,0 X_H1 SW SW1 ISW GND AL8860_H1 E_E1 SENSE GND VIN SET 25 X_U6 GND SW1 diode PARAMS: E_ABM5 PWM 0 VALUE { IF( V(N145353)>0.5 | V(N145359)>0.5,1,0) } V_V1 N146278 GND 4.5 X_U15 CTRL N146146 diode PARAMS: E_ABM12 N145529 0 VALUE { if((V(CTRL_LIMIT)<0.3) | (V(VIN_UVLO)<0.5) | + (V(OTP)>0.5) ,1,0) } E_ABM13 N140413 0 VALUE { IF(V(PWM)>0.5,0,1) } R_R12 N145529 N145359 1 TC=0,0 X_S1 PWM GND SW1 N145603 AL8860_S1 I_I5 N146278 CTRL DC 1.786u E_E2 N140479 GND N140413 GND 1 G_G1 N148802 N148834 N149178 GND 1 E_ABM10 TEMP 0 VALUE { (V(N148806)+{Tamb}) } .ENDS *$ .subckt AL8860_H1 1 2 3 4 H_H1 3 4 VH_H1 1 VH_H1 1 2 0V .ends AL8860_H1 *$ .subckt AL8860_S1 1 2 3 4 S_S1 3 4 1 2 _S1 RS_S1 1 2 1G .MODEL _S1 VSWITCH Roff=10G Ron=200m Voff=0.8 Von=0.2 .ends AL8860_S1 *$ .subckt ipeaksampler pwm isw i_wr ip_int ip c5 ip 0 1n ic=0 xu7 pwm 5 rise_edge_det_san_0 + params: VDD=1 VSS=0 T=100n sw3 ip ip_int 5 0 s_vswitch_1 c4 i_wr 0 1u ic=0 r4 isw i_wr 100m c3 ip_int 0 1n ic=0 sw2 ip_int i_wr pwm 0 s_vswitch_2 .model s_vswitch_1 vswitch + ron=0.01 + roff=1e+009 + von=0.8 + voff=0.2 .model s_vswitch_2 vswitch + ron=0.01 + roff=1e+009 + von=0.2 + voff=0.8 .ends ipeaksampler *$ .subckt diode 1 2 d1 1 2 ideal .model ideal d + n=0.001 + is=1e-015 .ends diode *$ .subckt COMPHYS2_SAN INP INM HYS VOUT PARAMS: VDD=1 VSS=0 .PARAM VTH = {( {VDD} + {VSS})/2 } EHYS INM INM_INT value = {if (V(VOUT)>{VTH},V(HYS),0)} E1 VOUT_PRE 0 value = {if(V(INP)>V(INM_INT),{VDD},{VSS})} R1 VOUT_PRE VOUT 1 C1 VOUT 0 1n IC=0 .ends COMPHYS2_SAN *$ .SUBCKT RISE_EDGE_DET_SAN_0 IN OUT PARAMS:VDD=1 VSS=0 T=100N .PARAM VTH={({VDD}+{VSS})/2} XU1 IN IN2 OUT AND PARAMS:VDD={VDD} VSS={VSS} XU2 IN OUT_IN INV PARAMS:VDD={VDD} VSS={VSS} XU3 OUT_IN IN2 DIODE R1 OUT_IN IN2 {{{T}*1E9}} C1 IN2 0 1.443N .ENDS RISE_EDGE_DET_SAN_0 *$ .SUBCKT AND IN1 IN2 OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E1 OUT1 0 VALUE={IF(V(IN1)>{VTH}&V(IN2)>{VTH},{VDD},{VSS})} R2 OUT1 OUT 1 C2 OUT 0 1N .ENDS AND *$ .SUBCKT INV INV_IN INV_OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E2 INV_OUT1 0 VALUE={IF(V(INV_IN)>{VTH},{VSS},{VDD})} R4 INV_OUT1 INV_OUT 1 C4 INV_OUT 0 1N .ENDS INV *$ ** Schottky diode ** .subckt B240A A B DSD1 A B DI_B240A .MODEL DI_B240A D ( IS=7.98u RS=13.4m BV=40.0 IBV=500u + CJO=370p M=0.333 N=1.13 TT=1.44n ) .ENDS B240A *$ ** LED Model ** .subckt LEDR A B DLED1 A B D_CQX35A_1 .MODEL D_CQX35A_1 D( IS= 9.43000000000000E-0017 N=2.13 BV=5 IBV=10U + RS=2.08 CJO=63.8P VJ=3.4 M=226M FC=500M + TT=25.9N EG=1.11 XTI=3 KF=0 AF=1 ) .ENDS LEDR *$ *$ *************************************************************************************** *************************************************************************************** * * DEVICE : AL8863 - Diodes Incorporated * DATE : 11NOV2019 * SIMULATOR : PSPICE 16.6 * MODEL VERSION : 1.1 * *************************************************************************************** *************************************************************************************** * * DEVICE NOTES: * Following features are been modelled: * 1. Soft-Start * 2. PWM Dimming * 3. LED Open circuit protection * 4. LED Short circuit protection * *************************************************************************************** *************************************************************************************** .SUBCKT AL8863 OSP DIM NTC GND DRV VIN FAULT CSN V_V4 N170483 GND 2.6 V_V3 N170415 GND 150m V_V2 N170387 GND 4.3 E_ABM4 N170769 0 VALUE { V(RISING_THRS)-V(CTRL_LIMIT)*0.87 } E_E1 SENSE GND VIN CSN 25 X_U18 DIM N170483 N170531 N171165 COMPHYS2_SAN PARAMS: VDD=2.5 VSS=0 C_C13 GND N170833 1n TC=0,0 X_U3 SENSE N170915 N170769 N170809 COMPHYS2_SAN PARAMS: VDD=1 VSS=0 R_R13 DIM REF 10.8k TC=0,0 E_ABM5 N170977 0 VALUE { IF( V(N170809)>0.5 | V(N170833)>0.5,0,1) } E_ABM3 RISING_THRS 0 VALUE { V(CTRL_LIMIT)*1.13 } R_R12 N170985 N170833 2 TC=0,0 E_ABM1 REF 0 VALUE { min(max((0.8928*(V(VIN)-0.75)),0),2.61) } X_U17 VIN N170387 N170415 VIN_UVLO COMPHYS2_SAN PARAMS: VDD=1 VSS=0 V_V5 N170531 GND 2.3 R_R2 RISING_THRS N170915 100 TC=0,0 C_C1 GND N170915 1.433n TC=0,0 E_ABM13 N174870 0 VALUE { LIMIT(IF( V(N178997)>0.5,V(VIN),0),0,15) } R_R14 N174879 DRV 2.2 TC=0,0 R_R15 N174883 DRV 5.7 TC=0,0 X_U15 N174870 N174883 DIODE X_U19 N174879 N174870 DIODE E_ABM20 OPEN 0 VALUE { if(V(VIN)-V(CSN)<0.01,1,0) } G_ABMII1 GND N176460 VALUE { if(V(SHORT)>0.5,1u,-10 ) } G_ABM2I1 GND N176707 VALUE { if(V(OPEN)<0.5,-10,(if(V(CTRL_LIMIT)>1.3 & + V(OPEN)>0.5,1u,0))) } C_C14 N176707 GND 1u IC=0 TC=0,0 C_C15 N176460 GND 1u IC=0 TC=0,0 X_U20 GND N176707 DIODE_1 X_U21 GND N176460 DIODE_1 E_ABM21 SHORT 0 VALUE { if(V(CSN)-V(OSP)<1,1,0) } E_ABM23 N177392 0 VALUE { if(V(N176707)>416u,1,0) } E_ABM24 N177399 0 VALUE { if(V(N176460)>23m,1,0) } X_S3 N177426 GND FAULT GND SCHEMATIC1_S3 E_ABM25 N177426 0 VALUE { if(V(N177392)>0.5 | V(N177399)>0.5,1,0) } X_U22 N170977 N178997 MINIMUM_ON_TIME PARAMS: MIN_ON_TIME=500n VDD=1 + VSS=0 E_ABM26 N170985 0 VALUE { IF(V(VIN_UVLO)<0.5 | V(CTRL_LIMIT)<0.3,1,0) + } I_I1 GND NTC DC 100u E_ABM27 CTRL_LIMIT 0 VALUE { + LIMIT(if(V(N171165)>1.25,(5*V(NTC_INT)-4),0),0,2.5) } E_ABM28 NTC_INT 0 VALUE { LIMIT(V(NTC),1,1.3) } R_R16 GND NTC 5G TC=0,0 X_U23 NTC N185478 DIODE_1 V_V6 N185478 GND 4.5 .ENDS AL8863 *$ .subckt SCHEMATIC1_S3 1 2 3 4 S_S3 3 4 1 2 _S3 RS_S3 1 2 1G .MODEL _S3 VSWITCH Roff=1G Ron=1u Voff=200m Von=800m .ends SCHEMATIC1_S3 *$ .SUBCKT DMN6068 10 20 30 M1 1 2 3 3 Nmod1 RD 10 1 Rmod1 27E-3 RS 23 3 Rmod1 27E-3 RG 20 22 1.5 RIN 20 23 2E11 RDS 10 23 6E9 CGS 2 3 380E-12 EGD 12 0 2 1 1 VFB 14 0 0 FFB 2 1 VFB 1 CGD 13 14 426E-12 R1 13 0 1 D1 12 13 DLIM DDG 15 14 DCGD R2 12 15 1 D2 15 0 DLIM DSD 23 10 DSUB EL 2 22 1 3 0.0015 LS 30 23 2n .MODEL Nmod1 NMOS (LEVEL=3 VTO=3.4 TOX=6E-8 NSUB=2.8E+17 KP=155 NFS=8E+11 IS=1E-15 N=10) .MODEL DCGD D (CJO = 244E-12 VJ = 0.5 M = 0.43 T_ABS=25) .MODEL DSUB D (IS = .1E-10 N=1.1 RS=0.02 BV=66 CJO=330E-12 VJ=0.42 M=0.5 TT=145E-9 TRS1=2E-3) .MODEL DLIM D (IS=100U N=1 T_ABS=25) .MODEL Rmod1 RES (TC1=2e-3 TC2=6E-6) .ENDS DMN6068 *$ .subckt diode 1 2 d1 1 2 ideal .model ideal d + n=0.001 + is=1e-015 .ends diode *$ .subckt diode_1 1 2 d1 1 2 ideal .model ideal d + n=1u + is=1e-015 .ends diode_1 *$ .subckt COMPHYS2_SAN INP INM HYS VOUT PARAMS: VDD=1 VSS=0 .PARAM VTH = {( {VDD} + {VSS})/2 } EHYS INM INM_INT value = {if (V(VOUT)>{VTH},V(HYS),0)} E1 VOUT_PRE 0 value = {if(V(INP)>V(INM_INT),{VDD},{VSS})} R1 VOUT_PRE VOUT 1 C1 VOUT 0 1n IC=0 .ends COMPHYS2_SAN *$ .SUBCKT RISE_EDGE_DET_SAN_0 IN OUT PARAMS:VDD=1 VSS=0 T=100N .PARAM VTH={({VDD}+{VSS})/2} XU1 IN IN2 OUT AND PARAMS:VDD={VDD} VSS={VSS} XU2 IN OUT_IN INV PARAMS:VDD={VDD} VSS={VSS} XU3 OUT_IN IN2 DIODE R1 OUT_IN IN2 {{{T}*1E9}} C1 IN2 0 1.443N .ENDS RISE_EDGE_DET_SAN_0 *$ .SUBCKT AND IN1 IN2 OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E1 OUT1 0 VALUE={IF(V(IN1)>{VTH}&V(IN2)>{VTH},{VDD},{VSS})} R2 OUT1 OUT 1 C2 OUT 0 1N .ENDS AND *$ .SUBCKT INV INV_IN INV_OUT PARAMS:VDD=1.8 VSS=0 .PARAM VTH={({VDD}+{VSS})/2} E2 INV_OUT1 0 VALUE={IF(V(INV_IN)>{VTH},{VSS},{VDD})} R4 INV_OUT1 INV_OUT 1 C4 INV_OUT 0 1N .ENDS INV *$ .subckt B240A A B DSD1 A B DI_B240A .MODEL DI_B240A D ( IS=7.98u RS=13.4m BV=40.0 IBV=500u + CJO=370p M=0.333 N=1.13 TT=1.44n ) .ENDS B240A *$ .subckt LEDR A B DLED1 A B D_CQX35A_1 .MODEL D_CQX35A_1 D( IS= 9.43000000000000E-0017 N=2.13 BV=5 IBV=10U + RS=2.08 CJO=63.8P VJ=3.4 M=226M FC=500M + TT=25.9N EG=1.11 XTI=3 KF=0 AF=1 ) .ENDS LEDR *$ .SUBCKT MINIMUM_ON_TIME IN OUT PARAMS: MIN_ON_TIME=20n VDD=1 VSS=0 C_C1 0 N06463 1n IC=0 TC=0,0 C_C2 0 N06605 1n IC=0 TC=0,0 V_V3 N06765 0 {VDD} R_R2 0 N06605 {19*{MIN_ON_TIME}/(13.86n)} TC=0,0 E_ABM7 N06563 0 VALUE { {IF(V(N06463)>VTH,VSS,VDD)} } E_ABM9 OUT 0 VALUE { {if(V(IN)>{VTH} | V(N06605)>{VTH},{VDD},{VSS})} + } R_R1 IN N06463 {MIN_ON_TIME/(20n)} TC=0,0 E_ABM8 N06583 0 VALUE { {if(V(IN)>{VTH} & V(N06563)>{VTH},{VDD},{VSS})} + } X_S1 N06583 0 N06765 N06605 MOT_COPY_S1 .PARAM vth={(vdd+vss)/2} .ENDS MINIMUM_ON_TIME *$ .subckt MOT_COPY_S1 1 2 3 4 S_S1 3 4 1 2 _S1 RS_S1 1 2 1G .MODEL _S1 VSWITCH Roff=10G Ron=10m Voff=0.2 Von=0.8 .ends MOT_COPY_S1 *$