* .SUBCKT UC1846 ILIM VREF CSNEG CSPOS EAPOS EANEG COMP CT RT + SYNC AOUT GND VC BOUT VIN SD Q3 GND NODE35 COMP _QP R22 NODE50 GND 3.58K V4 NODE23 NODE18 0 GB1 GND CT Value={ IF ( V(SYNC) > 2.5 & V(VREF) > 4.35 , + -0.013 , 0 ) } E5 NODE25 GND CSPOS CSNEG 3 S1 VREF NODE34 CT GND _S1_MOD GB8 GND NODE28 Value={ IF ( V(SD)>0.35 , 150U , 0 ) } S2 VIN NODE33 VIN GND _S2_MOD R23 SD GND 6K EBE1 NODE23 GND Value={ IF ( V(VIN,GND)>7.1 , 5.1 , + IF ( V(VIN,GND)<2 , 0 , (V(VIN,GND)-2) ) ) } Q1 VREF NODE34 SYNC QMOD R7 GND NODE34 150K EBE4 NODE26 GND Value={ IF ( V(SYNC)>3 , 10 , 0 ) } R20 NODE37 NODE35 10K GB4 VIN GND Value={I(V4)} R9 NODE34 VREF 100K R21 ILIM NODE35 1K D6X COMP 21 DMOD R10 SYNC GND 10K R19 COMP ILIM 1MEG R5 NODE33 0 100K R16X NODE32 GND 100K D5 NODE29 NODE27 DMOD R3 NODE18 VREF 0.33 X9 NODE26 NODE13 GND GND NODE13 NODE14 FFLOP380X EBE9 NODE36 GND Value={ if ( V(Node28) > 0.6, 5, + if (V(Node50) > 0.6, 5, IF( V(Node29)>3.5, 5,0))) } V5 21 NODE32 DC=0.5 R2 VIN GND 882 R1 GND NODE18 300 C2 NODE29 GND 2.00P R25 NODE27 NODE29 100K EBECOMP NODE27 GND Value={ IF ( V(NODE25) > V(NODE32) , 5 , 0 ) } X2 VC GND NODE19 BOUT 1846OUT X3 VREF GND EAPOS EANEG COMP 1846AMP X10 GND GND NODE36 NODE26 NODE31 NODE30 FFLOP380X GB3 GND CT Value={ IF ( V(VREF) > 4.35 , I(V2) , 0 ) } X1 VC GND NODE20 AOUT 1846OUT S3 CT GND VREF GND _S3_MOD D1 VREF 29 D2 V2 NODE11 RT 0 D6 29 NODE11 D2 bEBE6 NODE19 0 V=IF( V(NODE14)>2.5 & V(NODE26)<2.5 & V(NODE33) >5 & V(NODE31)<2.5 , 5 , 0 ) rser=2 cpar=1n ;my bEBE7 NODE20 0 V=IF( V(NODE13)>2.5 & V(NODE26)<2.5 & V(NODE33) >3.5 & V(NODE31)<2.5 , 3.5 , 0 ) rser=2 cpar=1n ;my Q7 NODE35 NODE28 GND QMOD *Q4 NODE28 NODE37 ILIM _Q4_MOD Q4 NODE50 NODE37 ILIM _Q4_MOD Q9 NODE37 NODE50 GND QMOD .MODEL _QP PNP .MODEL _S1_MOD VSWITCH RON=0.01 ROFF=1MEG VT=2.06 VH=0.88 .MODEL _S2_MOD VSWITCH RON=0.01 ROFF=1MEG VT=7.32 VH=0.375 .MODEL _S3_MOD VSWITCH RON=100MEG ROFF=10K VT=2.5 VH=0 .MODEL QMOD NPN .MODEL DMOD D .MODEL D2 D BV=2.1 IBV=1M RS=250 .MODEL _Q4_MOD PNP CJC=0.1P CJE=10P .ENDS *$ .SUBCKT FFLOP380X 1 2 11 12 5 6 * CLK D R S QB Q ¥1 N01 0 6 5 2 1 12 11 ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ D-FLOP RSRC=10 CAPVSS=10p ic=0 V1 N01 0 5V .ENDS .SUBCKT 1846OUT_ 4 7 3 12 * +V -V IN OUT I3 4 8 100U D3 8 4 DMOD D4 12 8 DMOD Q3 8 1 9 QIN Q4 12 9 7 QMOD Q5 4 8 6 QMOD I4 7 1 .9M R1 3 2 10K Q8 1 2 7 QIN Q2 4 6 12 QMOD2 .MODEL QMOD NPN RC=1.5 RE=.5 RB=100 .MODEL QMOD2 NPN .MODEL QIN NPN BF=100 BR=2 IS=1E-16 VAF=50 + CJE=1.5P CJC=.25P TR=1N TF=3N .MODEL DMOD D RS=1 IS=0.4U .ENDS .SUBCKT 1846OUT 4 7 3 12 * +V -V IN OUT ¥1 vp vm N02 ¥ 3 vm vp ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ HMITT Vh=0.5 VT=2.25 TFALL=20n Trise=20n S1 vp 12 N02 vm Hout S2 12 vm N01 vm Lout ¥2 vp vm ¥ N01 3 vm vp ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ HMITT Vh=0.5 VT=2.75 TFALL=20n Trise=20n V1 vm 7 25m V2 4 vp 1.5 .model HOUT SW(Roff=200K Ron=3.75 Vt=2.5 Vh=-0.5) .model LOUT SW(Roff=200K Ron=3.75 Vt=2.5 Vh=-0.5) .ends *$ .SUBCKT 1846AMP 4 11 12 1 9 * VCC GND NINV INV OUT R2 12 11 8MEG R3 6 11 1G C1 6 11 14P E1 5 11 6 0 1 R4 1 11 8MEG I2 4 9 .5M R6 0 15 300 D11 9 14 DMOD Q1 11 13 14 QPMOD I3 13 11 65U D14 15 13 DMOD D15 11 6 DCLAMP L1 3 15 10U C2 15 11 200P R9 5 3 5 C5 3 11 .02U G1 11 6 12 1 100U .MODEL QPMOD PNP .MODEL DCLAMP D (RS=10 BV=4 IBV=.01) .MODEL DMOD D .ENDS