home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 180 / dpcs0203b.iso / editorial / easypc / Easy-Spice / data1.cab / Examples / Flyback_PSU / flyback.spi < prev   
Encoding:
Text File  |  2002-07-08  |  4.1 KB  |  142 lines

  1. .options minbreak=100p
  2. ** uncomment the following line if you experience convergence problems
  3. *.options pivrel=990m
  4.  
  5. .model D1n4148 D(IS=1.6f RS=1.0 IKF=22m CJO=3p M=0.3 VJ=0.75 ISR=2.6n 
  6. + BV=70 TT=20n)
  7.  
  8. .subckt IRFR420 D G S
  9. .model mosfet NMOS( LEVEL=7 VTO=3.81 RS=0.06816 KP=2.149 RD=2.3567 TC1RD=0.0127 RG=15 IS=1e-36
  10. + CGDMAX=1.00E-09 CGDMIN=1.06E-11 XG2CGD=0.5 XG1CGD=0.1 CBD=6.97E-11 VTCGD=0)
  11. .model diode D( IS=3.50e-13 RS=0.0343 TT=1.657e-06)
  12. M1 D G S S mosfet
  13. D1 S D Diode
  14. Cgs G S 3.18E-10
  15. .ends
  16.  
  17. .model mur110 D(IS=9p RS=23m IKF=11m CJO=40p M=0.37 VJ=0.75 ISR=820p 
  18. + BV=100 IBV=100u tt=62n)
  19.  
  20. .subckt BZX79-18 1 2
  21. D1 1 2 D1
  22. D2 2 3 D2
  23. I1 1 3 1.71956
  24. R1 1 3 10 TC1=0.8374m
  25. .model D1 D IS=9.19e-16 CJO=70p RS=0.57061 ISR=1.36e-08
  26. .model D2 D IS=1.00e-15
  27. .ends
  28.  
  29. ** From psu.sxlib
  30. .subckt UC3844 Vout Osc Vp Comp Sense Vfb Ref Gnd
  31. A$U2 [U6_OUT U5_IN4] U2_OUT nand
  32. A$U3 [U2_OUT U7_OUT] U5_IN4 nand
  33. X$ARB1 R1_P Sense ARB1_OUT $$arbsourceARB1 pinnames: N1 N2 OUT 
  34. .subckt $$arbsourceARB1 N1 N2 OUT 
  35. B1 OUT 0 V=tanh(v(n1,n2)*1000)*2.5+2.5 
  36. .ends
  37. A$U16 U12_OUT U16_OUT DA
  38. X$U1 Vfb Ref Vp Comp Gnd R5_N $$error_amp_2 pinnames: VINN BIAS VP VOUT VN VINP
  39. A$U17 U9_OUT U17_OUT DA
  40. A$U6 U12_OUT U6_OUT inv
  41. V1 S2_P 0 5V
  42. A$U7 U15_OUT U7_OUT delay1
  43. A$U15 ARB1_OUT U15_OUT AD
  44. A$U4 Vp U4_OUT schmitt
  45. A$U5 [U10_OUT U12_OUT U8_QP U5_IN4] U11_IN1 or
  46. A$U12 Osc U12_OUT schmitt_osc
  47. I2 R1_N Comp 10u
  48. A$U13 U11_OUT U13_OUT DA
  49. A$U10 U4_OUT U10_OUT inv
  50. A$U11 U11_IN1 U11_OUT inv_dead
  51. I1 Gnd I1_N 40m
  52. A$U18 U4_OUT U18_OUT DA
  53. A$VCC2 VCC2_P DIG_VCC
  54. D1 Comp D1_N Diode
  55. D2 D1_N R1_N Diode
  56. D3 R1_P I1_N Diode
  57. Q2 Vp S1_N Vout 0 N1 20
  58. R4 S1_N Gnd 1K
  59. R5 Ref R5_N 10k
  60. X$S4 Osc 0 U16_OUT 0 gen_switch : RON=250 ROFF=100Meg VON=3 VOFF=2 pinnames: P N CP CN
  61. A$U8 VCC2_P U12_OUT U8_SET U8_SET U8_QP U8_QN Toggle
  62. A$GND2 U8_SET DIG_GND
  63. R6 R5_N Gnd 10k
  64. A$U9 U11_IN1 U9_OUT dead
  65. Q1 Vout U17_OUT Gnd 0 N1 20
  66. X$S2 S2_P Ref U18_OUT 0 gen_switch : RON=1 ROFF=100Meg VON=3 VOFF=2 pinnames: P N CP CN
  67. R1 R1_P R1_N 20k
  68. X$S3 Vp 0 U18_OUT 0 gen_switch : RON=1.36k ROFF=30k VON=3 VOFF=2 pinnames: P N CP CN
  69. R2 Gnd R1_P 10k
  70. .ic Osc 0
  71. R3 I1_N Gnd 10
  72. X$S1 Vp S1_N U13_OUT Gnd gen_switch : RON=1  ROFF=1Meg VON=3  VOFF=2  pinnames: P N CP CN
  73. .model inv d_inverter
  74. .model or d_or
  75. .model DIG_GND d_pulldown strong=true out_family="FORCE5"
  76. .model DIG_VCC d_pullup strong=true out_family="FORCE5"
  77. .model toggle d_tff
  78. .model delay1 d_buffer rise_delay=150n fall_delay=150n
  79. .model dead d_buffer rise_delay=20n fall_delay=1n
  80. .model inv_dead d_inverter rise_delay=20n fall_delay=1n
  81. .model nand d_nand
  82. .model and d_and
  83. .model Diode D(IS=1.6f CJO=0.3p M=0.3 VJ=0.75 ISR=2.6n)
  84. .model N1 NPN BF=300 TF=0.5n CJC=0.3p VAF=100
  85. .model P1 PNP BF=150 TF=2n CJC=0.3p VAF=150
  86. .model D1 D
  87. .model schmitt_osc adc_schmitt in_low=1 in_high=3
  88. * 842/4
  89. .model schmitt adc_schmitt in_low=10 in_high=16
  90. * 843/5
  91. *.model schmitt adc_schmitt in_low=7.6 in_high=8.4
  92. .subckt gen_switch 1 2 3 4
  93. S1 1 2 3 4 SW
  94. .model SW VSWITCH RON={ron} ROFF={roff} VON={von} VOFF={voff}
  95. .ends
  96. .model AD adc_bridge 
  97. + in_low=2.1 
  98. + in_high=2.2 
  99. + rise_delay=1e-12 
  100. + fall_delay=1e-12
  101. + out_family = "UNIV"
  102. + out_low = 0
  103. + out_high = 5
  104. + clamp_bias=0.5
  105. + clamp_res=10
  106. .model DA dac_bridge 
  107. + out_high=5        
  108. + input_load=-31p   
  109. + t_rise=2n         
  110. + t_fall=2n         
  111. + g_pullup=0.024    
  112. + g_pulldown=0.034  
  113. + g_hiz=1e-9        
  114. + knee_low = 2.0    
  115. + knee_high =2.75   
  116. + v_smooth = 0.5    
  117. + in_family="UNIV"
  118. .subckt $$error_amp_2 VINN BIAS VP VOUT VN VINP
  119. Q8 Q6_C Q6_C VN 0 N1
  120. Q9 Q10_B Q6_C VN 0 N1
  121. V1 D2_N VN 5.5 
  122. Q10 VOUT Q10_B Q10_E 0 N1
  123. C1 C1_P Q10_B 270p
  124. D1 Q10_E VN D1
  125. D2 VOUT D2_N D1
  126. E1 C1_P 0 VOUT 0 1
  127. G2 VP G2_N BIAS VN 20u
  128. Q6 Q6_C R2_P G2_N 0 P1
  129. Q7 Q10_B R3_P G2_N 0 P1
  130. R2 R2_P VINN 2.7k
  131. X$S1 VP VOUT BIAS 0 gen_switch : RON=30k ROFF=1G VON=3 VOFF=2 pinnames: P N CP CN
  132. R3 R3_P VINP 2.7k
  133. .subckt gen_switch 1 2 3 4
  134. S1 1 2 3 4 SW
  135. .model SW VSWITCH RON={ron} ROFF={roff} VON={von} VOFF={voff}
  136. .ends
  137. .model N1 NPN BF=200 TF=0.15n CJC=0.3p VAF=100
  138. .model P1 PNP BF=150 TF=5n CJC=30p VAF=150 RB=100
  139. .model D1 D
  140. .ends
  141. .ends
  142.