I am designing a buck-boost regulator for a course at school and I would like to use the OnSemi ntk3139p PMOS transistor. OnSemi provides a few spice models for this part and I am getting stuck converting the Pspice file so that it is usable in LTspice. I realize I could pick something else, but I wanted to take this opportunity to dive into some of the nitty gritty in spice.
Some of the references I have been following for spice are:
- Audio Perfection's Subcircuit Structure Guide
- PSPICE Reference Guide
- There are more but I don't have 10 reputation points yet to post them
The Pspice file in question is listed bellow:
.SUBCKT ntk3139p 1 2 3
**************************************
* Model Generated by MODPEX *
*Copyright(c) Symmetry Design Systems*
* All Rights Reserved *
* UNPUBLISHED LICENSED SOFTWARE *
* Contains Proprietary Information *
* Which is The Property of *
* SYMMETRY OR ITS LICENSORS *
*Commercial Use or Resale Restricted *
* by Symmetry License Agreement *
**************************************
* Model generated on Jan 4, 07
* MODEL FORMAT: PSpice
* Symmetry POWER MOS Model (Version 1.0)
* External Node Designations
* Node 1 -> Drain
* Node 2 -> Gate
* Node 3 -> Source
M1 9 7 8 8 MM L=100u W=100u
* Default values used in MM:
* The voltage-dependent capacitances are
* not included. Other default values are:
* RS=0 RD=0 LD=0 CBD=0 CBS=0 CGBO=0
.MODEL MM PMOS LEVEL=1 IS=1e-32
+VTO=-1 LAMBDA=0 KP=5.6585
+CGSO=1.09084e-06 CGDO=5.71422e-08
RS 8 3 0.298194
D1 1 3 MD
.MODEL MD D IS=1.38278e-09 RS=0.152961 N=1.5 BV=20
+IBV=0.00025 EG=1.2 XTI=1 TT=2.5e-09
+CJO=2.06195e-11 VJ=0.5 M=0.371211 FC=0.1
RDS 3 1 1.6e+07
RD 9 1 0.0001
RG 2 7 110.624
D2 5 4 MD1
* Default values used in MD1:
* RS=0 EG=1.11 XTI=3.0 TT=0
* BV=infinite IBV=1mA
.MODEL MD1 D IS=1e-32 N=50
+CJO=3.80558e-11 VJ=0.507085 M=0.9 FC=1e-08
D3 5 0 MD2
* Default values used in MD2:
* EG=1.11 XTI=3.0 TT=0 CJO=0
* BV=infinite IBV=1mA
.MODEL MD2 D IS=1e-10 N=0.4 RS=3e-06
RL 5 10 1
FI2 7 9 VFI2 -1
VFI2 4 0 0
EV16 10 0 9 7 1
CAP 11 10 3.80558e-11
FI1 7 9 VFI1 -1
VFI1 11 6 0
RCAP 6 10 1
D4 6 0 MD3
* Default values used in MD3:
* EG=1.11 XTI=3.0 TT=0 CJO=0
* RS=0 BV=infinite IBV=1mA
.MODEL MD3 D IS=1e-10 N=0.4
.ENDS ntk3139p
My crack at converting it is:
.SUBCKT ntk3139p 1 2 3
**************************************
* Model Generated by MODPEX *
*Copyright(c) Symmetry Design Systems*
* All Rights Reserved *
* UNPUBLISHED LICENSED SOFTWARE *
* Contains Proprietary Information *
* Which is The Property of *
* SYMMETRY OR ITS LICENSORS *
*Commercial Use or Resale Restricted *
* by Symmetry License Agreement *
**************************************
* External Node Designations
* Node 1 -> Drain
* Node 2 -> Gate
* Node 3 -> Source
M1 9 7 8 8 MM L=100u W=100u
RS 8 3 0.298194
D1 1 3 MD
RDS 3 1 1.6e+07
RD 9 1 0.0001
RG 2 7 110.624
D3 5 0 MD2
RL 5 10 1
FI2 7 9 VFI2 -1
VFI2 4 0 0
EV16 10 0 9 7 1
CAP 11 10 3.80558e-11
FI1 7 9 VFI1 -1
VFI1 11 6 0
RCAP 6 10 1
D4 6 0 MD3
* Model definitions
.MODEL MM PMOS(LEVEL=1
+ IS=1e-32
+ VTO=-1
+ LAMBDA=0
+ KP=5.6585
+ CGSO=1.09084e-06
+ CGDO=5.71422e-08)
.MODEL MD D (IS=1.38278e-09
+ RS=0.152961
+ N=1.5 BV=20
+ IBV=0.00025
+ EG=1.2
+ XTI=1
+ TT=2.5e-09
+ CJO=2.06195e-11
+ VJ=0.5
+ M=0.371211
+ FC=0.1)
.MODEL MD1 D (IS=1e-32 N=50
+ CJO=3.80558e-11 VJ=0.507085 M=0.9 FC=1e-08)
.MODEL MD2 D (IS=1e-10 N=0.4 RS=3e-06)
.MODEL MD3 D (IS=1e-10 N=0.4)
.ENDS
I have rearranged some of the lines so that they resemble some of the other subcircuit LTspice files that I have been looking at with the netlist first and the model definitions second and I have added the parenthesis to the parameters of the model directives. Most of the subcircuit file makes sense to me but a few of the devices I am not sure about such as FI2
. I think this is a current dependent current source but it may not be used properly here. I am not sure where I am going wrong here as the error I am getting in LTspice is
Fatal Error: Unknown subcircuit called in:
xu1 n002 n001 0 ntk3139p.sub ntk3139p
The way I implement my NTK3139P.sub is:
- I save the NTK3139P.sub file in
C:\Program Files (x86)\LTC\LTCspiceIV\lib\sub
- Open LTspice
- Create New symbol
- Pin numbers coorelate with subcircuit definitions
- In attributes: Prefix = X, Value = ntk3139p
- Saved where it can be seen by LTSpice
- Restart LTspice
- Create super simple schematic to test it with the FET, a resistor, a voltage source, and ground
- Run a
.tran 1
simulation - The aforementioned error occurs
Any help debugging this and/or explanations of where I went wrong or a friendly point to some more general spice literature would be appreciated!