0
\$\begingroup\$

I get error when trying to simulate an exported spice file from TINA to LTspice.

According to: How to convert a TINA-TI model into a generic spice mode

If I just make a symbol for the spice model I get the following error where the spice symbol points towards the file of model directory

enter image description here

However if I instead include the simulation file inside the simulation file and delete the pointer for the model directory in the symbol I get the following error.

enter image description here

Spice Model extracted from TINA

*****************************************************************************
* (C) Copyright 2018 Texas Instruments Incorporated. All rights reserved.     
*****************************************************************************
** This model is designed as an aid for customers of Texas Instruments.      
** TI and its licensors and suppliers make no warranties, either expressed   
** or implied, with respect to this model, including the warranties of       
** merchantability or fitness for a particular purpose. The model is        
** provided solely on an "as is" basis. The entire risk as to its quality   
** and performance is with the customer                                    
*****************************************************************************   
* Released by: Analog eLab Design Center, Texas Instruments Inc.
* Part: ISO224X
* +-12-V Single-Ended Input, Reinforced Isolated Amplifier
* Date: 03/12/2018
* Model Type: TINA
* Simulator: TINA-TI
* Simulator Version: 7.0.30.267 SF-TI
* Datasheet: SBAS738 - 26.JAN 2018
*
*****************************************************************************
* version 1.0:
*
*****************************************************************************   
* ISO224X SUBCIRCUIT
* High Impedance, 2-V Input, Reinforced Isolated Amplifier
** source ISO224X

.SUBCKT ISO224X VCAP IN VDD1 GND1 GND2 OUTN OUTP VDD2
XDFilter    POut1_11 VOCM NOut1 INP GND2 DFilter
XFilter     POut1_11 NOut1 GND2 VDD2 OUTN VOCM OUTP Filter_Block
XD4         GND2 OUTN D_D2
XD3         OUTN VDD2 D_D2
XD2         GND2 OUTP D_D2
XD1         OUTP VDD2 D_D2
XGain       POut1_13 GND1 VDD1 GND1 VDD2 GND2 INP GND2 FSO VGAIN
R3          GND2 GND1 100G 
C1          GND2 GND1  1.2P 
RIO         VDD2 VDD1 100G 
CIO         VDD2 VDD1  1.2P 
XInput      IN VCAP GND2 POut1_13 FSO VDD1 GND1 Input_circuit

.ENDS

.SUBCKT DFilter POut1 VOCM NOut1 INP GND2
R25         15 GND2 1 
GVCCS3      15 GND2 16 GND2  -1
GVCCS2      NOut1 VOCM VALUE = {0.5*V(15,GND2)}
GVCCS1      VOCM POut1 VALUE = {0.5*V(15,GND2)}
R22         VOCM NOut1 1 
R21         POut1 VOCM 1 
R6          17 INP 200K 
C6          16 GND2  428.833333F 
C4          15 17  885.333333F 
R5          16 17 200K 
.ENDS

.SUBCKT Filter_Block INP INN GND2 VDD2 VOUTN VOCM VOUTP
VPSref      29 GND2 3.3
R21ops      25 0 59 
L2ops       25 0  15.650236U 
R1          26 25 1 
R11ops      27 0 59 
L1ops       27 0  78.25118U 
R1ops       28 27 1 
G2ops       0 26 28 0  1
G1ops       0 28 29 VDD2  14.058532U
XOutputp VM Neg_30 IGND_23 Bias IAVDD_24 VOUTP VDD2 Plus_31 GND2 Vt0p Vt0 
+ Output 
C7          32 33  3.64P 
EVCVS2      32 GND2 35 GND2  1
EVCVS1      34 GND2 36 GND2  1
R16         37 INP 200K 
C8          36 35  1.493333P 
R15         33 INN 200K 
R14         35 33 200K 
C5          34 37  3.64P 
R11         36 37 200K 
XOutputn VM Neg_38 IGND_23 Bias IAVDD_24 VOUTN VDD2 Plus_39 GND2 Vt0p Vt0 
+ Output_1 
R8          40 34 200K 
R22ops      41 0 10 
C2ops       Veps_18 41  1.607626N 
Epsp        VOCM Plus_31 Veps_18 0  -1
Epsn        Plus_39 VOCM Veps_18 0  -1
R3ops       Veps_18 0 990 
G3ops       0 Veps_18 26 0  1.010101M
C3          40 42  4.76P 
R7          42 32 200K 
C4          VOUTP Neg_30  1.026667P 
R6          Neg_30 42 100K 
R5          VOUTP 42 200K 
C2          VOUTN Neg_38  1.026667P 
R3          Neg_38 40 100K 
R2          VOUTN 40 200K 
XBias       IAVDD_24 VDD2 IGND_23 GND2 Bias VM Vt0p Vt0 VOCM Bias
.ENDS

.SUBCKT Output VM Neg IGND Bias IAVDD OUT VDD2 Plus GND2 Vt0p Vt0
VAM2        47 VGN_45 ; Current Arrow
VAM1        50 OUT ; Current Arrow
Vo21        IAVDD 53 695.218247M
Vo22        48 IGND 695.218247M
XD5         VGP_44 VDD2 D_LIM100_05
XD3         GND2 VGN_45 D_LIM100_05
XD6         46 VGP_44 D_LIM100_05
XD1         48 VV_43 D_LIM1
XD4         VGN_45 49 D_LIM100_05
RO2         VDD2 51 10 
RO1         52 GND2 10 
XD2         VV_43 53 D_LIM1
C33         VV_43 VM  15.915494F 
XT7         50 VGP_44 51 VDD2 Q_PMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
XT2         OUT VGN_45 52 GND2 Q_NMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
EVMP2       VDD2 46 VALUE = {LIMIT(1.02*V(VDD2,Vt0p),0,V(VDD2,GND2))}
EVMN2       49 GND2 VALUE = {LIMIT(1.02*V(Vt0,GND2),0,V(VDD2,GND2))}
Ro23        VM Neg 100G 
Ro22        Plus VM 100G 
Ro21        Neg Plus 1G 
Co21        Neg Plus  10F 
Rdn2        VGP_44 Vt0p 2.041402MEG 
Gdn2        Vt0p VGP_44 VM VV_43  146.95U
Rdn1        47 Vt0 2.041402MEG 
Gdn1        Vt0 47 VM VV_43  146.95U
Cf5         OUT 47  1P 
Cf4         VGP_44 OUT  1P 
Co23        VM Neg  10F 
RCo23_RPAR  VM Neg 1T
Co22        Plus VM  10F 
RCo22_RPAR  Plus VM 1T
R83         VV_43 VM 100K 
G23         VM VV_43 Plus Neg  10U
.ENDS

.SUBCKT Output_1 VM Neg IGND Bias IAVDD OUT VDD2 Plus GND2 Vt0p Vt0
VAM2        58 VGN_56 ; Current Arrow
VAM1        61 OUT ; Current Arrow
Vo21        IAVDD 64 695.218247M
Vo22        59 IGND 695.218247M
XD5         VGP_55 VDD2 D_LIM100_05
XD3         GND2 VGN_56 D_LIM100_05
XD6         57 VGP_55 D_LIM100_05
XD1         59 VV_54 D_LIM1
XD4         VGN_56 60 D_LIM100_05
RO2         VDD2 62 10 
RO1         63 GND2 10 
XD2         VV_54 64 D_LIM1
C33         VV_54 VM  15.915494F 
XT7         61 VGP_55 62 VDD2 Q_PMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
XT2         OUT VGN_56 63 GND2 Q_NMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
EVMP2       VDD2 57 VALUE = {LIMIT(1.02*V(VDD2,Vt0p),0,V(VDD2,GND2))}
EVMN2       60 GND2 VALUE = {LIMIT(1.02*V(Vt0,GND2),0,V(VDD2,GND2))}
Ro23        VM Neg 100G 
Ro22        Plus VM 100G 
Ro21        Neg Plus 1G 
Co21        Neg Plus  10F 
Rdn2        VGP_55 Vt0p 2.041402MEG 
Gdn2        Vt0p VGP_55 VM VV_54  146.95U
Rdn1        58 Vt0 2.041402MEG 
Gdn1        Vt0 58 VM VV_54  146.95U
Cf5         OUT 58  1P 
Cf4         VGP_55 OUT  1P 
Co23        VM Neg  10F 
RCo23_RPAR  VM Neg 1T
Co22        Plus VM  10F 
RCo22_RPAR  Plus VM 1T
R83         VV_54 VM 100K 
G23         VM VV_54 Plus Neg  10U
.ENDS

.SUBCKT Bias  IAVDD VDD2 IGND GND2 Bias VM Vt0p Vt0 VOCM
VS2         67 68 1.2
XU5         0 Vocmtemp VOCMTEMP
EVSOCM      VOCM GND2 VALUE = {500M*V(VDD2,GND2)}
GIb2        IGND Bias VALUE = {48.98M*V(VDD2,GND2)+730.612M}
Rb3         Bias IGND 1 TC=970U,-77N
R3          68 GND2 10MEG 
R2          VDD2 69 10MEG 
EVCVS1      VM IGND VALUE = {0.5*V(IAVDD,IGND)}
EAVDD       IAVDD IGND VALUE = {5*V(Bias,IGND)}
EGND        IGND 0 GND2 0  1
EBMG        70 GND2 Vt0 GND2 1
XT4         69 69 VDD2 VDD2 Q_PMOS_OUT_L1_1
+ PARAMS: M=1 W=10U L=4U 
XT1         VT1 70 GND2 GND2 Q_NMOS_OUT_L1_1
+ PARAMS: M=9 W=21U L=0.8U
XT3         68 68 GND2 GND2 Q_NMOS_OUT_L1_2
+ PARAMS: M=1 W=10U L=4U 
XD2         67 69 D_LIM1_1
Rsp1        VDD2 VT1 2.111111K 
GIb1        69 68 Bias IGND  10U
Rpsrr1      69 68 10MEG 
EVMP1       Vt0p VDD2 69 VDD2  1
EVMN1       Vt0 GND2 68 GND2  1
.ENDS

.SUBCKT Input_circuit  VIN VCAP GND2 POut1 FSO VDD1 GND1
VPSref      85 GND1 5
XD3         76 VIN D_ZR_5V3
XD9         76 GND1 D_ZR_5V3
XU1         77 IGND_72 FSO IGND_72 HYSTCOMPG_THLRF
+ PARAMS: VOUTH=1 VOUTL=0 ROUT=100 TDLH=48U TDHL=1U TRISE=1N TFALL=1N VTHRES=0.5
+ VHYST=100m
C3          VIN GND1  2P
C1          VLCM GND1  2P
XU_1        VLCM GND1 VDD1 GND1 IIB
Rin1        VLCM GND1 208.333333K 
Rin2        VIN VLCM 1.041667MEG 
XD2         GND1 78 D_LIMINH
XD1         VLCM VDD1 D_LIMINH
GVCCS1      IGND_72 77 VALUE = {IF( V(79,IGND_72)<0.5,1,0)}
R11         77 IGND_72 1 
XU2         VDD1 GND1 79 IGND_72 HYSTCOMPGD
+ PARAMS: VTHRES=4.25 VHYST=200M VOUTH=1 VOUTL=0 ROUT=100 DELAY=100N
Eios        VLCM POut1 VALUE = {V(Venoise,0)+50.1187N*V(GND1,GND2)+V(VOS,0)+V(Veps_73,0)+10*V(Venoise,0)}
L3          80 0  3.248354U 
R10         80 0 999 
R9          Venoise 80 1 
Gnoise      0 Venoise 0 81  233.333333M
L2          82 0  6.963029U 
R8          82 0 7 
R7          83 82 1 
G88ps       0 83 0 Veps_73  1
R6          84 0 9 
L1          84 0  7.161972U 
R5          Veps_73 84 1 
G8ps        0 Veps_73 85 VDD1  562.341325U
XU5         0 VOS VOST
Rnoise2     81 0 4.8263MEG 
Rnoise1     81 0 4.8263MEG 
XBias       GND1 IGND_72 IAVDD_75 VCAP VDD1 FSO Bias_1
.ENDS

.SUBCKT Bias_1 GND1 IGND IAVDD LDO VDD1 SHTDN
XU20        LDO GND1 VDD1 LDO
Rp1         VDD1 GND1 3.846154MEG TC=-6M,22U
GIS1        87 GND1 VALUE = {(5.8096M+V(87,GND1)/1.5625K)*(1-V(SHTDN,GND1))}
EAVDD       IAVDD IGND VALUE = {LIMIT(5*(V(VDD1,GND1)-1.4),5,0)}
Rs4         87 GND1 1.5625G TC=-6M,22U
XD1         GND1 87 D_D4
XDZb1       87 VDD1 D_ZB1
EGND        IGND 0 GND1 0  1
.ENDS

.SUBCKT LDO  LDO GND VIN
VS1         89 GND 2
C2          LDO GND  10P
XU1         V_FB 89 VIN GND AM_OUT STDOPAMP
+ PARAMS: RIN=100MEG GAIN=1K RINC=1E9 ROUT=1000 SLEWRATE=15MEG FPOLE1=20000
+ VDROPOH=0 VDROPOL=1.55 CIN=100F CINC=100F
XQ1         LDO AM_OUT VIN VIN SWMOSP
+ PARAMS: VTH=-700M KP=1.4M L=2U W=102U RD=2.5 RS=1
C1          V_FB LDO  10P
R2          V_FB GND 25K 
R1          LDO V_FB 25K 
.ENDS

.SUBCKT D_D2  1    2
D1 1 2  D2
.ENDS
*
 

.SUBCKT VGAIN  INP INN VDD1 GND1 VDD2 GND2 OUTP OUTN FSO
*EG Gain error
*ISO224A, Initial, at TA = 25°C 0.3% ±0.05%(1) 0.3%
*ISO224B, Initial, at TA = 25°C 0.5% ±0.1%(1) 0.5%
*TCEG Gain error drift ppm/°C
*ISO224A ±20(1) 
*ISO224B 50 ±15(1) 50
.PARAM TCGERR0= {-20E-6}
.PARAM TCGERRB= {-15E-6}
.PARAM TCGERR= {TCGERR0}
.PARAM EG0= {0.05/100}  ;ISO224A
.PARAM EGB= {0.1/100}  ;ISO224B
.PARAM EG= { EG0 }
.PARAM Gin={8.2/2}
.PARAM Gout={1.0}
.PARAM G={8.2} 
.PARAM RG1= {0.01}
.PARAM RG2= {1/Gin}
.PARAM I0 = 1
.PARAM R0 = {1/(I0*Gout)}
*.PARAM Rout = {R0*(1 + 2*TCGERR + EG - 96.4519m/100)}
*.PARAM Rout = {R0*(1 + 2*TCGERR + EG - 59.0m/100)}
.PARAM Rout = {R0*(1 + 2*TCGERR + EG - 7.0m/100)}
.PARAM TC1= {TCGERR/R0/I0}
.PARAM K=1.2
.PARAM C25={56.0014427*K}
.PARAM B25={0.146489/K}
.PARAM C125={47.45704}
.PARAM B125={0.17289}

*.PARAM MC={(C125-C25)/100}
.PARAM MC={0}
.PARAM C0={C25 - MC}
*.PARAM MB={(B125-B25)/100}
.PARAM MB={0}
.PARAM B0={B25 - MB}

.PARAM A0={-0.010854}
.PARAM D0={0.088938}

*.PARAM Vclip={2.516}
.PARAM Vclip={2.3}
.PARAM VL={Vclip}
*.PARAM VLFSO={-2.563/R0 - 1m}
*.PARAM VLFSO={-2.6/Rout}
.PARAM VLFSO={-5.5/Rout}

*GVDD1 0 G1 TABLE {V(VDD1,GND1)} = (3,0.0617284, 3.50217,0.0345679, 4.00435,0.0296296, 4.50000,0.0320988, 4.99783,0.0518519, 5.49783,0.0592593)
GVDD1 0 G1 TABLE {V(VDD1,GND1)} = (3,-0.04615, 5.00,0.0, 18,0.3)
RG1 G1 0 {RG1}

*GVDD2 0 G12 TABLE {V(VDD2,GND1)} = (3,0.0617284, 3.25217,0.0518519, 3.50652,0.0617284, 3.75000,0.0641975, 4.24783,0.0641975, 4.75217,0.0641975, 5.25217,0.0641975, 5.49783,0.0641975)
GVDD2 0 G12 TABLE {V(VDD2,GND1)} = (3,0.0637284, 3.25217,0.0629519, 3.50652,0.0637284, 3.75000,0.0641975, 4.24783,0.0641975, 4.75217,0.0641975, 5.25217,0.0641975, 5.49783,0.0641975)
*GVDD2 0 G12 TABLE {V(VDD2,GND1)} = (3,0.0617284, 3.25217,0.0617284, 3.50652,0.0617284, 3.75000,0.0641975, 4.24783,0.0641975, 4.75217,0.0641975, 5.25217,0.0641975, 5.49783,0.0641975)
RG12 G12 0 {RG1}
G2 0 G2 VALUE = { Limit(V(INP,INN), -VL, VL) }
RG2 G2 0 {RG2}
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, (C0*(0.2 + 0.2*V(VDD1,GND1))*(1 + V(G1))*(1 + (V(G12)-EGB))*TANH( B0*(1.6667 - 0.16667*V(VDD1,GND1))*(V(G2) + A0) ) + D0), VLFSO) }
G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, (C0*(1 + V(G1))*(1 + (V(G12)-EGB))*TANH( B0*(V(G2) + A0) ) + D0), VLFSO) }
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, (1 + V(G1))*(1 + (V(G12)-EGB))*(C0*TANH( B0*(V(G2) + A0) ) + D0), VLFSO) }
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, G*(1 + V(G1))*(1 + (V(G12)-EGB))*V(G2), VLFSO) }
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, ((C0 + MC*V(Temp))*TANH( (B0 + MB*V(Temp))*(V(G2) + A0) ) + D0), VLFSO) }
ROUT OUTP OUTN  RMOD2 {Rout}
.MODEL RMOD2 RES (TC1={TC1} TC2=0 TCE=0)

Itemp 0 Temp 1
RTemp Temp 0 RTemp 1
.MODEL RTemp RES (TC1={1} TC2=0 TCE=0)
.ENDS

.SUBCKT D_LIM100_05  1 2
D1 1 2  D_Lim100_05
.ENDS
*$

.SUBCKT D_LIM1  1 2
D1 1 2  D_Lim1
.ENDS
*$

.SUBCKT Q_PMOS_OUT_L1  D G S B PARAMS:  M = 1 W = 100U L = 10U
*_L1
M1 D G S B Q_PMOS_Out_L1 W = {W} L = {L} M = {M} 
*AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*M1 D G S B Q_PMOS_Out W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 

.SUBCKT Q_NMOS_OUT_L1  D G S B PARAMS:  M = 1 W = 100U L = 10U
M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} 
*AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*M1 D G S B Q_NMOS_Out  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 
.SUBCKT VOCMTEMP  1 2
.PARAM R0 = {1/1.44}
GVocmtemp 1 2 table {TEMP} = (-55,1.43532, -39.6341,1.43680, -24.8955,1.43778, -9.84321,1.43901, 4.89547,1.43975, 19.9477,1.44000, 
+ 35,1.44025, 49.8955,1.44037, 65.1045,1.44049, 80.1568,1.44025, 94.8955,1.43988, 109.948,1.43926, 124.686,1.43852)
Rout 1 2 {R0}
.ENDS

.SUBCKT Q_PMOS_OUT_L1_1 D G S B PARAMS:  M = 1 W = 100U L = 10U
M1 D G S B Q_PMOS_Out_L1 W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 
.SUBCKT Q_NMOS_OUT_L1_1 D G S B PARAMS:  M = 1 W = 100U L = 10U
M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
+ NRD={LS/W} NRS={LS/W}
.ENDS
*$

 .SUBCKT Q_NMOS_OUT_L1_2 D G S B PARAMS:  M = 1 W = 100U L = 10U
*M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 
.SUBCKT D_LIM1_1 1 2
D1 1 2  D_Lim1
.ENDS
*$
 
.SUBCKT D_ZR_5V3  1    2
D1 1 2  D_Z5V3
.MODEL D_Z5V3 D( IS=1P N=1.0 BV=14.15 IBV=1.0M RS=10 XTI=0 EG=0.48 )
.ENDS 

.SUBCKT HYSTCOMPG_THLRF  inp inm out gnd 
+ Params: Vthres=0 Vhyst=1 VoutH=5 VoutL=0 Rout=1 Tdlh=1N Tdhl=1N Trise=1N Tfall=1N 
* Trise ->   90%*(VoutH-VoutL), Tfall -> 10%*(VoutH-VoutL)
.PARAM Tdellh = {MAX(Tdlh,MinADel)}
.PARAM Tdelhl = {MAX(Tdhl,MinADel)}
.Param Rdel = {IF ( ((Tdellh > 1E-15)|(Tdelhl > 1E-15)) & (Rout < 1), 1, Rout ) } 
.Param Ro = {IF ( ((Trise > 1E-15)|(Tfall > 1E-15)) & (Rout < 1), 1, Rout ) } 
.Param VoutM={(VoutH+VoutL)/2}
.Param Tdmin= 1p
*.Param Cdel={Sqrt((Tdelhl+Tdmin)*(Tdellh+Tdmin))/(0.693*(Rdel+1u))}
.Param Cdel={Sqrt((Tdelhl+Tdmin)*(Tdellh+Tdmin))/(4.6*(Rdel+1u))}
.Param Gdlh={Sqrt((Tdelhl+Tdmin)/(Tdellh+Tdmin))/Rdel}
.Param Gdhl={(Tdellh+Tdmin)/(Tdelhl+Tdmin)*Gdlh}

.Param Cout={Sqrt(Tfall*Trise)/(2.287*(Ro+1u))}
.Param Gr={Sqrt(Tfall/(Trise+Tdmin))/Ro}
.Param Gf={(Trise+Tdmin)/Tfall*Gr}

.Param VthH={Vthres+Vhyst}
.Param VthL={Vthres-Vhyst}

*EVthrH VthrH 0 value = {4.35}
*EVthrL VthrL 0 value = {4.25}

Rinp inp gnd 1G
Rinm inm gnd 1G
Gthr gnd thr Value= { IF ( V(out,gnd) < {VoutM}, {VthH}, {VthL}) }
*Gthr gnd thr Value= { IF ( V(out,gnd) < VoutM, V(VthrH), V(VthrL) ) }
Rthr gnd thr 1

Gouti gnd outi Value= { IF ( (V(inp,inm) > V(thr,gnd)), (VoutH - V(outi,gnd))*Gdlh, (VoutL - V(outi,gnd))*Gdhl ) }
Couti outi gnd {Cdel}

Gthro gnd thro Value= { IF ( V(out,gnd) < VoutM, VoutH*0.99, VoutH*0.01 ) }
Rthro gnd thro 1
*Gout gnd out Value= { IF ( (V(outi, gnd) > VoutM), (VoutH - V(out,gnd))*Gr, (VoutL - V(out,gnd))*Gf ) }
Gout gnd out Value= { IF ( (V(outi, gnd) > V(thro,gnd)), (VoutH - V(out,gnd))*Gr, (VoutL - V(out,gnd))*Gf ) }
Cout out gnd {Cout}
.ENDS

.SUBCKT IIB  1 2 Vdd Gnd
.PARAM Rtemp = {1/3.50985}
.PARAM RVdd = {1/1.0}
GVocmtemp 0 10 table {TEMP} = (-55,3.84236, -25.2609,3.76847, 4.79130,3.62069, 24.5130,3.50985, 34.9478,3.49754, 
+ 49.7130,3.47291, 64.7391,3.47291, 79.7130,3.49754, 94.6348,3.69458, 109.661,3.95320, 124.374,4.35961)
R1 10 0 { Rtemp}
GIibvdd 0 20 table {V(Vdd,Gnd)} = (0,0, 3,1.73219, 3.49652,2.24816, 3.99739,2.61671, 
+ 4.50261,3.13268, 5.00348,3.50123, 5.50000,3.86978)
R2 20 0 {RVdd}
GIib 1 2 Value = { V(20)*V(10)*1n}
.ENDS

.SUBCKT D_LIMINH  1 2
D1 1 2  D_Liminh
*.MODEL D_Liminh D( IS=3.5n N=1.0 RS=0 XTI=0 AF=0 KF=0 EG=0.1)
.MODEL D_Liminh D( IS=3.5f N=1.0 RS=0 XTI=0 AF=0 KF=0 EG=0.55)
.ENDS

.PARAM MinADel = {1n}
.SUBCKT HYSTCOMPGD  inp inm out gnd 
+ Params: Vthres=0 Vhyst=1 VoutH=5 VoutL=0 Rout=1 Delay=1N
*
.PARAM Tdel = {MAX(Delay,MinADel)}
.Param Rdel = {IF ( (Tdel > 1E-15) & (Rout < 1), 1, Rout ) }
.Param VoutM={(VoutH+VoutL)/2}
.Param VthH={Vthres+Vhyst}
.Param VthL={Vthres-Vhyst}
.Param Cout={Tdel/(0.693*(Rdel+1u))}
.Param Gdlh={1/Rdel}
.Param Gdhl={1*Gdlh}
*
Gthr gnd thr Value= { IF ( V(out,gnd) < {VoutM}, {VthH}, {VthL}) }
Rthr gnd thr 1
Gout gnd out Value= { IF ( (V(inp,inm) > V(thr,gnd)), (VoutH - V(out,gnd))*Gdlh, (VoutL - V(out,gnd))*Gdhl ) }
Cout out gnd {Cout}
Rout out gnd {1e5*Rdel}
.ENDS

.SUBCKT VOST  1 2
*VOS Input offset voltage
*ISO224X, Initial, at TA = 25°C, VIN = GND1 50.0 ±0.4(1) 50.0mV
*ISO224XB, Initial, at TA = 25°C, VIN = GND1, 4.5 V = VDD1 = 5.5 V 5.0 ±0.4(1) 5.0
*TCVOS Input offset drift ISO224X ±20(1)µV/°C
.PARAM I0 = 1M
*.PARAM DVOS_DT= {0.4U}
.PARAM DVOS_DT= {-5.0U}

.PARAM VOFFS = {-119.0U + 2*DVOS_DT}
.PARAM R0 = {VOFFS/I0}
.PARAM TC1= {DVOS_DT/R0/I0}

R2 40 0 RMOD2 {R0}
I2 40 0 {I0}
E3 1 2 40 0 1
.MODEL RMOD2 RES (TC1={TC1} TC2=0 TCE=0)
.ENDS

.SUBCKT D_D4  1    2
D1 1 2  DD
.MODEL DD D( IS=10n N=0.50 RS=1 XTI=0 Eg=0.35)
.ENDS D_D

.SUBCKT D_ZB1  1    2
D1 1 2  D_4_9V
CD 1 2 10P
.MODEL D_4_9V D( IS=1n N=1.0 BV=2.4 IBV=1.0m RS=0 XTI=0 EG=0.55)
.ENDS 

* STANDARD OPERATIONAL AMPLIFIER MACROMODEL SUBCIRCUIT
* CREATED USING 08/05/06
* (REV 1.53 03/05/16, simplified 1.5, VDROPOL referenced to VP  )
.SUBCKT STDOPAMP  INP INM VP VM OUT
+ PARAMS: GAIN=200K RIN=2MEG RINC=1E9 CIN=1p CINC=1p ROUT=75 SLEWRATE=500K FPOLE1=5 
+ VDROPOH=1.9 VDROPOL=1.9 
*FPOLE2=1MEG
*
.PARAM PI = 3.141592
.PARAM IS = 1.0E-12
.PARAM VT = 0.02585
.PARAM IMAX = 100.0E-2
.PARAM C1 = {IMAX/SLEWRATE}
.PARAM R1 = {1/(2*PI*C1*FPOLE1)}
.PARAM GM1 = {GAIN/R1}
*.PARAM R2 = 100
*.PARAM G2 = {1/R2}
.PARAM GOUT = {1/ROUT}
*.PARAM C2 = {1/(2*PI*R2*FPOLE2)}
.PARAM VDF = {VT*LOG(1 + IMAX/IS)}
*
RINM1      INM VP  {2*RINC}
RINM2      INM VM  {2*RINC}
RINP1      INP VP  {2*RINC}
RINP2      INP VM  {2*RINC}
RIN        INM INP  {RIN}
CINM1      INM VM  {CINC}
CINP1      INP VM  {CINC}
CIN        INM INP  {CIN}
*EVP VPI 0 VALUE = { V(VP)-(VDROPOH + VDF) }
EVM VMI 0 VALUE = { Limit(V(VP)-(VDROPOL - VDF), V(VM) + VDF, V(VP) + VDF)  }
EVP VPI 0 VALUE = { Limit(V(VP)-(VDROPOH + VDF), V(VM) + VDF, V(VP))  }

GIQ         VP VM VALUE = {5M*ABS(V(P1,OUT))}
GMO2        VM OUT P1 VM {0.5*GOUT}
RO2         OUT VM {2*ROUT} 
GMO1        OUT VP VP P1 {0.5*GOUT}
RO1         VP OUT {2*ROUT} 
*C2          P2 GND  {C2}
*R2          P2 GND  {R2}
*GM2         GND P2 P1 GND {G2}
EGND        GND  0  POLY(2) (VP,0) (VM,0) 0 .5 .5

D3         VMI P1  D_1
D2          P1 VPI  D_1
C1          P1 GND  {C1}
R1          P1 GND  {R1}
*GM1         GND P1 VALUE = { LIMIT( GM1*V(INP,INM), -IMAX, IMAX) }
GM1         GND P1 VALUE = { IF (TIME < 1e-30, GM1*V(INP,INM), LIMIT( GM1*V(INP,INM), -IMAX, IMAX)) }
*GM1         GND P1 VALUE = { Limit( V(VP,VM)/(Abs(-VDROPOH + VDROPOL)+1m), 0, 1 )*IF (TIME < 1e-30, GM1*V(INP,INM), LIMIT( GM1*V(INP,INM), -IMAX, IMAX)) }
.MODEL D_1 D( IS={IS} XTI=0 EG=0.8)
.ENDS

.SUBCKT SWMOSP  D  G  S  B Params: Vth=2.0 KP=10 Rd=1m Rs=1m L=1u W=1u
.Param T0={273.15}
.Param Tnom={25+T0}

Rs     S    Si   {Rs}
Rd     D    Di   {Rd} TC=7m

M1      Di    G    Si    B    SWMOS    L={L}   W={W}
.MODEL SWMOS PMOS (LEVEL=1 KP= {KP}  VTO={Vth} IS=0 LAMBDA=0.5M RDS=1e7)

*Dbody      Di  Bi  DBODY
*.MODEL DBODY  D(IS=100n  N=1.1  CJO=1.00n M=0.3 VJ=0.7 RS=20.47u BV=85 IBV=1m EG=1.12  TT=30n)

Cgd     G    Di    1p
Cgs     G    Si    10p
Cds     Di    Si    1p
.ENDS   

.SUBCKT D_LIMCM 1 2
D1 1 2  D_Limcm
.MODEL D_LIMcm D( IS=1p N=1.0 RS=100 XTI=0 AF=0 KF=0 EG=1.1)
.ENDS

.SUBCKT D_LIM1T 1 2
D1 1 2  D_Lim1T
.ENDS
.MODEL D_LIM1T D( IS=10F N=1.0 RS=10 XTI=0 AF=0 KF=0 EG=0.555)
*$

*Parameters: 0.4um CMOS
.PARAM LS = 1.0U
.PARAM VTOHP = 0.75
.PARAM VTOHN = 0.75

.PARAM LAMBDA = 10M

.PARAM GAMMA = 0.00
.PARAM KAPPA = 1.0
.PARAM THETA = 0.23
.PARAM ETA = 3

.PARAM KPN = {UON*TESTCOX * 1e-4}
.PARAM KPP = {UOP*TESTCOX * 1e-4}
.PARAM LDN = 0.09U
.PARAM LDP = 0.09U
.PARAM RSW = 1810
.PARAM RSN = 1.41
.PARAM RDS = 10MEG
.PARAM VBMUL = 1E6
.PARAM RPAR = 1T
.PARAM CBDJ = 1.0 
.PARAM CBDS = 1.0
.PARAM CGBF = 1.0
.PARAM PBP = 0.7
.PARAM PBN = 0.7
.PARAM UON = 450
.PARAM UOP = 450
*.PARAM UOP = 150
*
.PARAM CJN = {200U}
.PARAM CJP = {400U} 
.PARAM CJSWN = {1.2N}
.PARAM CJSWP = {2.4N}
.PARAM XJN = 0.15U
.PARAM CGSON = {0.6*XJN*TESTCOX} 
.PARAM CGDON = {CGSON}
.PARAM CGBON = {CGBF*CGDON}
.PARAM XJP = 0.18U
.PARAM CGSOP = {0.6*XJP*TESTCOX} 
.PARAM CGDOP = {CGSOP}
.PARAM CGBOP = {CGBF*CGDOP}
.PARAM EPSSIO2 = {3.9*8.854214871E-12}
.PARAM TOX = 80E-10
.PARAM TESTCOX = {EPSSIO2/TOX}
*$
.MODEL Q_NMOS NMOS Level=1 L=2U W=10U KP={KPN} VTO={VTOHN}  AF=0 KF=0
*$
.MODEL Q_PMOS PMOS Level=1 L=2U W=10U KP={KPP} VTO={-VTOHP}  AF=0 KF=0
*$
.MODEL Q_NMOS_Out_L1 NMOS LEVEL=1 L=10U W=100U KP={KPN} VTO={VTOHN} LAMBDA={LAMBDA}
+ CJ={CJN} CJSW={CJSWN} CGSO={CGSON} CGDO={CGDON} RSH= 4 PB={PBN} LD= {LDN} RDS={RDS} 
*$
.MODEL Q_NMOS_Out NMOS LEVEL=3 L=10U W=100U KP={KPN} VTO={VTOHN} THETA={THETA}
+ CJ={CJN} CJSW={CJSWN} CGSO={CGSON} CGDO={CGDON} RSH= 4 PB={PBN} LD= {LDN} RDS={RDS} TOX={TOX} XJ={XJN}
+ GAMMA={GAMMA} KAPPA={KAPPA} ETA={ETA}
*$
.MODEL Q_PMOS_Out_L1 PMOS LEVEL=1 L=10U W=100U KP={KPP} VTO={-VTOHP} LAMBDA={LAMBDA}
+ CJ={CJP} CJSW={CJSWP} CGSO={CGSOP} CGDO={CGDOP} RSH=4 PB={PBP} LD= {LDP} RDS={RDS} 
*$
.MODEL Q_PMOS_Out PMOS LEVEL=3 L=10U W=100U KP={KPP} VTO={-VTOHP} THETA={THETA}
+ CJ={CJP} CJSW={CJSWP} CGSO={CGSOP} CGDO={CGDOP} RSH=4 PB={PBP} LD= {LDP} RDS={RDS} TOX={TOX} XJ={XJP}
+ GAMMA={GAMMA} KAPPA={KAPPA} ETA={ETA}
*$
.MODEL D_Lim1 D( IS=10F N=1.0 RS=1000 XTI=0 AF=0 KF=0 EG=1.11)
*$
.MODEL D_Lim100 D( IS=10F N=1.0 RS=100 XTI=0 AF=0 KF=0 EG=1.11)
*$
.MODEL D_Lim1005 D( IS=10F N=0.5 RS=100 XTI=0 AF=0 KF=0 EG=0.555)
*$
.MODEL D_Lim100_05 D( IS=10F N=0.5 RS=100 XTI=0 AF=0 KF=0 EG=0.555)
*$
.MODEL D_Lim10 D( IS=10F N=1.0 RS=10 XTI=0 AF=0 KF=0 EG=1.11)
*$
.MODEL D_Lim2 D( IS=10f N=0.5 RS=1 XTI=0 AF=0 KF=0 EG=0.555 )
*$
.MODEL D_Lim3 D( IS=1E-18 N=1.0 RS=1 XTI=0 AF=0 KF=0)
*$
.MODEL D_Lim4 D( IS=10F N=1.0 RS=1m XTI=0 AF=0 KF=0)
*$
.MODEL D1 D( IS=1p N=1.0 RS=0 XTI=3 AF=0 KF=0 )
*$
.MODEL DZ_14V D( IS=1p N=1.0 BV=14.0 IBV=5.0M XTI=0 RS=10)
.MODEL DZ_80V D( IS=1p N=1.0 BV=80.0 IBV=5.0M XTI=0 RS=10)
*$
.MODEL D2 D( IS=1p N=1.0 XTI=0 RS=10)
\$\endgroup\$
2
  • \$\begingroup\$ Can you post the contents of the model? Use ``` as delimiters for the block of code. \$\endgroup\$ Aug 26, 2020 at 9:24
  • \$\begingroup\$ @aconcernedcitizen model code added \$\endgroup\$ Aug 26, 2020 at 11:20

1 Answer 1

2
\$\begingroup\$

I guess TINA uses a different keyword/notation for ground, because they named some nets as 0 (zero, universal SPICE reference ground), and GND. But GND must have no meaning other than a label in TINA, because in LTspice it's an alias for node 0. Which means somewhere in all that haystack there was a naming conflict. The solution: search & replace with regex \sGND\s -> GROUND (spaces both before and after).

With that, it's another fatal error about an unknown subcircuit:

Fatal Error: Unknown subcircuit called in:
   x:u1:input:u_1 u1:input:vlcm 0«:gnd1:gnd1» vdd1«:vdd1:vdd1» 0«:gnd1:gnd1» u1:input:iib

Following the thread, it turns out the subcircuit for IIB (line 441) has a non-standard notation: .SUBCKT IIB 1 2 Vdd GROUND .param Rtemp = {1/3.50985}. That should either be split as a new line (<enter> right before the dot in .param):

.SUBCKT IIB  1 2 Vdd GROUND
.PARAM Rtemp = {1/3.50985}

or keep on the same line and rename .param to params: (no dot, with colon):

.SUBCKT IIB  1 2 Vdd GROUND params: Rtemp = {1/3.50985}

After these the simulation runs, but the error log pops up. That only happens when there is still something wrong, but which might not be critical. In this case, there are two errors about a floating node across two current sources:

ERROR: Node U1:INPUT:U1:OUTI is floating and connected to current source G:U1:INPUT:U1:OUTI
ERROR: Node U1:FSO is floating and connected to current source G:U1:INPUT:U1:OUT

The two offenders are on lines 431 and 437. The solution is to add Rpar=1g to each of the capacitors that are right below these two current sources:

Couti outi GROUND {Cdel} Rpar=1g

and

Cout out GROUND {Cout} Rpar=1g

Now it works. How well, that's up to you (and the people that made the subcircuit). Since the search & replace might go wrong, here's the contents of the modified file:

*****************************************************************************
* (C) Copyright 2018 Texas Instruments Incorporated. All rights reserved.     
*****************************************************************************
** This model is designed as an aid for customers of Texas Instruments.      
** TI and its licensors and suppliers make no warranties, either expressed   
** or implied, with respect to this model, including the warranties of       
** merchantability or fitness for a particular purpose. The model is        
** provided solely on an "as is" basis. The entire risk as to its quality   
** and performance is with the customer                                    
*****************************************************************************   
* Released by: Analog eLab Design Center, Texas Instruments Inc.
* Part: ISO224X
* +-12-V Single-Ended Input, Reinforced Isolated Amplifier
* Date: 03/12/2018
* Model Type: TINA
* Simulator: TINA-TI
* Simulator Version: 7.0.30.267 SF-TI
* Datasheet: SBAS738 - 26.JAN 2018
*
*****************************************************************************
* version 1.0:
*
*****************************************************************************   
* ISO224X SUBCIRCUIT
* High Impedance, 2-V Input, Reinforced Isolated Amplifier
** source ISO224X

.SUBCKT ISO224X VCAP IN VDD1 GND1 GND2 OUTN OUTP VDD2
XDFilter    POut1_11 VOCM NOut1 INP GND2 DFilter
XFilter     POut1_11 NOut1 GND2 VDD2 OUTN VOCM OUTP Filter_Block
XD4         GND2 OUTN D_D2
XD3         OUTN VDD2 D_D2
XD2         GND2 OUTP D_D2
XD1         OUTP VDD2 D_D2
XGain       POut1_13 GND1 VDD1 GND1 VDD2 GND2 INP GND2 FSO VGAIN
R3          GND2 GND1 100G 
C1          GND2 GND1  1.2P 
RIO         VDD2 VDD1 100G 
CIO         VDD2 VDD1  1.2P 
XInput      IN VCAP GND2 POut1_13 FSO VDD1 GND1 Input_circuit

.ENDS

.SUBCKT DFilter POut1 VOCM NOut1 INP GND2
R25         15 GND2 1 
GVCCS3      15 GND2 16 GND2  -1
GVCCS2      NOut1 VOCM VALUE = {0.5*V(15,GND2)}
GVCCS1      VOCM POut1 VALUE = {0.5*V(15,GND2)}
R22         VOCM NOut1 1 
R21         POut1 VOCM 1 
R6          17 INP 200K 
C6          16 GND2  428.833333F 
C4          15 17  885.333333F 
R5          16 17 200K 
.ENDS

.SUBCKT Filter_Block INP INN GND2 VDD2 VOUTN VOCM VOUTP
VPSref      29 GND2 3.3
R21ops      25 0 59 
L2ops       25 0  15.650236U 
R1          26 25 1 
R11ops      27 0 59 
L1ops       27 0  78.25118U 
R1ops       28 27 1 
G2ops       0 26 28 0  1
G1ops       0 28 29 VDD2  14.058532U
XOutputp VM Neg_30 IGND_23 Bias IAVDD_24 VOUTP VDD2 Plus_31 GND2 Vt0p Vt0 
+ Output 
C7          32 33  3.64P 
EVCVS2      32 GND2 35 GND2  1
EVCVS1      34 GND2 36 GND2  1
R16         37 INP 200K 
C8          36 35  1.493333P 
R15         33 INN 200K 
R14         35 33 200K 
C5          34 37  3.64P 
R11         36 37 200K 
XOutputn VM Neg_38 IGND_23 Bias IAVDD_24 VOUTN VDD2 Plus_39 GND2 Vt0p Vt0 
+ Output_1 
R8          40 34 200K 
R22ops      41 0 10 
C2ops       Veps_18 41  1.607626N 
Epsp        VOCM Plus_31 Veps_18 0  -1
Epsn        Plus_39 VOCM Veps_18 0  -1
R3ops       Veps_18 0 990 
G3ops       0 Veps_18 26 0  1.010101M
C3          40 42  4.76P 
R7          42 32 200K 
C4          VOUTP Neg_30  1.026667P 
R6          Neg_30 42 100K 
R5          VOUTP 42 200K 
C2          VOUTN Neg_38  1.026667P 
R3          Neg_38 40 100K 
R2          VOUTN 40 200K 
XBias       IAVDD_24 VDD2 IGND_23 GND2 Bias VM Vt0p Vt0 VOCM Bias
.ENDS

.SUBCKT Output VM Neg IGND Bias IAVDD OUT VDD2 Plus GND2 Vt0p Vt0
VAM2        47 VGN_45 ; Current Arrow
VAM1        50 OUT ; Current Arrow
Vo21        IAVDD 53 695.218247M
Vo22        48 IGND 695.218247M
XD5         VGP_44 VDD2 D_LIM100_05
XD3         GND2 VGN_45 D_LIM100_05
XD6         46 VGP_44 D_LIM100_05
XD1         48 VV_43 D_LIM1
XD4         VGN_45 49 D_LIM100_05
RO2         VDD2 51 10 
RO1         52 GND2 10 
XD2         VV_43 53 D_LIM1
C33         VV_43 VM  15.915494F 
XT7         50 VGP_44 51 VDD2 Q_PMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
XT2         OUT VGN_45 52 GND2 Q_NMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
EVMP2       VDD2 46 VALUE = {LIMIT(1.02*V(VDD2,Vt0p),0,V(VDD2,GND2))}
EVMN2       49 GND2 VALUE = {LIMIT(1.02*V(Vt0,GND2),0,V(VDD2,GND2))}
Ro23        VM Neg 100G 
Ro22        Plus VM 100G 
Ro21        Neg Plus 1G 
Co21        Neg Plus  10F 
Rdn2        VGP_44 Vt0p 2.041402MEG 
Gdn2        Vt0p VGP_44 VM VV_43  146.95U
Rdn1        47 Vt0 2.041402MEG 
Gdn1        Vt0 47 VM VV_43  146.95U
Cf5         OUT 47  1P 
Cf4         VGP_44 OUT  1P 
Co23        VM Neg  10F 
RCo23_RPAR  VM Neg 1T
Co22        Plus VM  10F 
RCo22_RPAR  Plus VM 1T
R83         VV_43 VM 100K 
G23         VM VV_43 Plus Neg  10U
.ENDS

.SUBCKT Output_1 VM Neg IGND Bias IAVDD OUT VDD2 Plus GND2 Vt0p Vt0
VAM2        58 VGN_56 ; Current Arrow
VAM1        61 OUT ; Current Arrow
Vo21        IAVDD 64 695.218247M
Vo22        59 IGND 695.218247M
XD5         VGP_55 VDD2 D_LIM100_05
XD3         GND2 VGN_56 D_LIM100_05
XD6         57 VGP_55 D_LIM100_05
XD1         59 VV_54 D_LIM1
XD4         VGN_56 60 D_LIM100_05
RO2         VDD2 62 10 
RO1         63 GND2 10 
XD2         VV_54 64 D_LIM1
C33         VV_54 VM  15.915494F 
XT7         61 VGP_55 62 VDD2 Q_PMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
XT2         OUT VGN_56 63 GND2 Q_NMOS_OUT_L1
+ PARAMS: M=25 W=20U L=0.8U
EVMP2       VDD2 57 VALUE = {LIMIT(1.02*V(VDD2,Vt0p),0,V(VDD2,GND2))}
EVMN2       60 GND2 VALUE = {LIMIT(1.02*V(Vt0,GND2),0,V(VDD2,GND2))}
Ro23        VM Neg 100G 
Ro22        Plus VM 100G 
Ro21        Neg Plus 1G 
Co21        Neg Plus  10F 
Rdn2        VGP_55 Vt0p 2.041402MEG 
Gdn2        Vt0p VGP_55 VM VV_54  146.95U
Rdn1        58 Vt0 2.041402MEG 
Gdn1        Vt0 58 VM VV_54  146.95U
Cf5         OUT 58  1P 
Cf4         VGP_55 OUT  1P 
Co23        VM Neg  10F 
RCo23_RPAR  VM Neg 1T
Co22        Plus VM  10F 
RCo22_RPAR  Plus VM 1T
R83         VV_54 VM 100K 
G23         VM VV_54 Plus Neg  10U
.ENDS

.SUBCKT Bias  IAVDD VDD2 IGND GND2 Bias VM Vt0p Vt0 VOCM
VS2         67 68 1.2
XU5         0 Vocmtemp VOCMTEMP
EVSOCM      VOCM GND2 VALUE = {500M*V(VDD2,GND2)}
GIb2        IGND Bias VALUE = {48.98M*V(VDD2,GND2)+730.612M}
Rb3         Bias IGND 1 TC=970U,-77N
R3          68 GND2 10MEG 
R2          VDD2 69 10MEG 
EVCVS1      VM IGND VALUE = {0.5*V(IAVDD,IGND)}
EAVDD       IAVDD IGND VALUE = {5*V(Bias,IGND)}
EGND        IGND 0 GND2 0  1
EBMG        70 GND2 Vt0 GND2 1
XT4         69 69 VDD2 VDD2 Q_PMOS_OUT_L1_1
+ PARAMS: M=1 W=10U L=4U 
XT1         VT1 70 GND2 GND2 Q_NMOS_OUT_L1_1
+ PARAMS: M=9 W=21U L=0.8U
XT3         68 68 GND2 GND2 Q_NMOS_OUT_L1_2
+ PARAMS: M=1 W=10U L=4U 
XD2         67 69 D_LIM1_1
Rsp1        VDD2 VT1 2.111111K 
GIb1        69 68 Bias IGND  10U
Rpsrr1      69 68 10MEG 
EVMP1       Vt0p VDD2 69 VDD2  1
EVMN1       Vt0 GND2 68 GND2  1
.ENDS

.SUBCKT Input_circuit  VIN VCAP GND2 POut1 FSO VDD1 GND1
VPSref      85 GND1 5
XD3         76 VIN D_ZR_5V3
XD9         76 GND1 D_ZR_5V3
XU1         77 IGND_72 FSO IGND_72 HYSTCOMPG_THLRF
+ PARAMS: VOUTH=1 VOUTL=0 ROUT=100 TDLH=48U TDHL=1U TRISE=1N TFALL=1N VTHRES=0.5
+ VHYST=100m
C3          VIN GND1  2P
C1          VLCM GND1  2P
XU_1        VLCM GND1 VDD1 GND1 IIB
Rin1        VLCM GND1 208.333333K 
Rin2        VIN VLCM 1.041667MEG 
XD2         GND1 78 D_LIMINH
XD1         VLCM VDD1 D_LIMINH
GVCCS1      IGND_72 77 VALUE = {IF( V(79,IGND_72)<0.5,1,0)}
R11         77 IGND_72 1 
XU2         VDD1 GND1 79 IGND_72 HYSTCOMPGD
+ PARAMS: VTHRES=4.25 VHYST=200M VOUTH=1 VOUTL=0 ROUT=100 DELAY=100N
Eios        VLCM POut1 VALUE = {V(Venoise,0)+50.1187N*V(GND1,GND2)+V(VOS,0)+V(Veps_73,0)+10*V(Venoise,0)}
L3          80 0  3.248354U 
R10         80 0 999 
R9          Venoise 80 1 
Gnoise      0 Venoise 0 81  233.333333M
L2          82 0  6.963029U 
R8          82 0 7 
R7          83 82 1 
G88ps       0 83 0 Veps_73  1
R6          84 0 9 
L1          84 0  7.161972U 
R5          Veps_73 84 1 
G8ps        0 Veps_73 85 VDD1  562.341325U
XU5         0 VOS VOST
Rnoise2     81 0 4.8263MEG 
Rnoise1     81 0 4.8263MEG 
XBias       GND1 IGND_72 IAVDD_75 VCAP VDD1 FSO Bias_1
.ENDS

.SUBCKT Bias_1 GND1 IGND IAVDD LDO VDD1 SHTDN
XU20        LDO GND1 VDD1 LDO
Rp1         VDD1 GND1 3.846154MEG TC=-6M,22U
GIS1        87 GND1 VALUE = {(5.8096M+V(87,GND1)/1.5625K)*(1-V(SHTDN,GND1))}
EAVDD       IAVDD IGND VALUE = {LIMIT(5*(V(VDD1,GND1)-1.4),5,0)}
Rs4         87 GND1 1.5625G TC=-6M,22U
XD1         GND1 87 D_D4
XDZb1       87 VDD1 D_ZB1
EGND        IGND 0 GND1 0  1
.ENDS

.SUBCKT LDO  LDO GROUND VIN
VS1         89 GROUND 2
C2          LDO GROUND  10P
XU1         V_FB 89 VIN GROUND AM_OUT STDOPAMP
+ PARAMS: RIN=100MEG GAIN=1K RINC=1E9 ROUT=1000 SLEWRATE=15MEG FPOLE1=20000
+ VDROPOH=0 VDROPOL=1.55 CIN=100F CINC=100F
XQ1         LDO AM_OUT VIN VIN SWMOSP
+ PARAMS: VTH=-700M KP=1.4M L=2U W=102U RD=2.5 RS=1
C1          V_FB LDO  10P
R2          V_FB GROUND 25K 
R1          LDO V_FB 25K 
.ENDS

.SUBCKT D_D2  1    2
D1 1 2  D2
.ENDS
*
 

.SUBCKT VGAIN  INP INN VDD1 GND1 VDD2 GND2 OUTP OUTN FSO
*EG Gain error
*ISO224A, Initial, at TA = 25°C 0.3% ±0.05%(1) 0.3%
*ISO224B, Initial, at TA = 25°C 0.5% ±0.1%(1) 0.5%
*TCEG Gain error drift ppm/°C
*ISO224A ±20(1) 
*ISO224B 50 ±15(1) 50
.PARAM TCGERR0= {-20E-6}
.PARAM TCGERRB= {-15E-6}
.PARAM TCGERR= {TCGERR0}
.PARAM EG0= {0.05/100}  ;ISO224A
.PARAM EGB= {0.1/100}  ;ISO224B
.PARAM EG= { EG0 }
.PARAM Gin={8.2/2}
.PARAM Gout={1.0}
.PARAM G={8.2} 
.PARAM RG1= {0.01}
.PARAM RG2= {1/Gin}
.PARAM I0 = 1
.PARAM R0 = {1/(I0*Gout)}
*.PARAM Rout = {R0*(1 + 2*TCGERR + EG - 96.4519m/100)}
*.PARAM Rout = {R0*(1 + 2*TCGERR + EG - 59.0m/100)}
.PARAM Rout = {R0*(1 + 2*TCGERR + EG - 7.0m/100)}
.PARAM TC1= {TCGERR/R0/I0}
.PARAM K=1.2
.PARAM C25={56.0014427*K}
.PARAM B25={0.146489/K}
.PARAM C125={47.45704}
.PARAM B125={0.17289}

*.PARAM MC={(C125-C25)/100}
.PARAM MC={0}
.PARAM C0={C25 - MC}
*.PARAM MB={(B125-B25)/100}
.PARAM MB={0}
.PARAM B0={B25 - MB}

.PARAM A0={-0.010854}
.PARAM D0={0.088938}

*.PARAM Vclip={2.516}
.PARAM Vclip={2.3}
.PARAM VL={Vclip}
*.PARAM VLFSO={-2.563/R0 - 1m}
*.PARAM VLFSO={-2.6/Rout}
.PARAM VLFSO={-5.5/Rout}

*GVDD1 0 G1 TABLE {V(VDD1,GND1)} = (3,0.0617284, 3.50217,0.0345679, 4.00435,0.0296296, 4.50000,0.0320988, 4.99783,0.0518519, 5.49783,0.0592593)
GVDD1 0 G1 TABLE {V(VDD1,GND1)} = (3,-0.04615, 5.00,0.0, 18,0.3)
RG1 G1 0 {RG1}

*GVDD2 0 G12 TABLE {V(VDD2,GND1)} = (3,0.0617284, 3.25217,0.0518519, 3.50652,0.0617284, 3.75000,0.0641975, 4.24783,0.0641975, 4.75217,0.0641975, 5.25217,0.0641975, 5.49783,0.0641975)
GVDD2 0 G12 TABLE {V(VDD2,GND1)} = (3,0.0637284, 3.25217,0.0629519, 3.50652,0.0637284, 3.75000,0.0641975, 4.24783,0.0641975, 4.75217,0.0641975, 5.25217,0.0641975, 5.49783,0.0641975)
*GVDD2 0 G12 TABLE {V(VDD2,GND1)} = (3,0.0617284, 3.25217,0.0617284, 3.50652,0.0617284, 3.75000,0.0641975, 4.24783,0.0641975, 4.75217,0.0641975, 5.25217,0.0641975, 5.49783,0.0641975)
RG12 G12 0 {RG1}
G2 0 G2 VALUE = { Limit(V(INP,INN), -VL, VL) }
RG2 G2 0 {RG2}
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, (C0*(0.2 + 0.2*V(VDD1,GND1))*(1 + V(G1))*(1 + (V(G12)-EGB))*TANH( B0*(1.6667 - 0.16667*V(VDD1,GND1))*(V(G2) + A0) ) + D0), VLFSO) }
G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, (C0*(1 + V(G1))*(1 + (V(G12)-EGB))*TANH( B0*(V(G2) + A0) ) + D0), VLFSO) }
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, (1 + V(G1))*(1 + (V(G12)-EGB))*(C0*TANH( B0*(V(G2) + A0) ) + D0), VLFSO) }
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, G*(1 + V(G1))*(1 + (V(G12)-EGB))*V(G2), VLFSO) }
*G1 OUTN OUTP  VALUE = {IF ( V(FSO,GND1) < 0.5, ((C0 + MC*V(Temp))*TANH( (B0 + MB*V(Temp))*(V(G2) + A0) ) + D0), VLFSO) }
ROUT OUTP OUTN  RMOD2 {Rout}
.MODEL RMOD2 RES (TC1={TC1} TC2=0 TCE=0)

Itemp 0 Temp 1
RTemp Temp 0 RTemp 1
.MODEL RTemp RES (TC1={1} TC2=0 TCE=0)
.ENDS

.SUBCKT D_LIM100_05  1 2
D1 1 2  D_Lim100_05
.ENDS
*$

.SUBCKT D_LIM1  1 2
D1 1 2  D_Lim1
.ENDS
*$

.SUBCKT Q_PMOS_OUT_L1  D G S B PARAMS:  M = 1 W = 100U L = 10U
*_L1
M1 D G S B Q_PMOS_Out_L1 W = {W} L = {L} M = {M} 
*AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*M1 D G S B Q_PMOS_Out W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 

.SUBCKT Q_NMOS_OUT_L1  D G S B PARAMS:  M = 1 W = 100U L = 10U
M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} 
*AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*M1 D G S B Q_NMOS_Out  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
*+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 
.SUBCKT VOCMTEMP  1 2
.PARAM R0 = {1/1.44}
GVocmtemp 1 2 table {TEMP} = (-55,1.43532, -39.6341,1.43680, -24.8955,1.43778, -9.84321,1.43901, 4.89547,1.43975, 19.9477,1.44000, 
+ 35,1.44025, 49.8955,1.44037, 65.1045,1.44049, 80.1568,1.44025, 94.8955,1.43988, 109.948,1.43926, 124.686,1.43852)
Rout 1 2 {R0}
.ENDS

.SUBCKT Q_PMOS_OUT_L1_1 D G S B PARAMS:  M = 1 W = 100U L = 10U
M1 D G S B Q_PMOS_Out_L1 W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 
.SUBCKT Q_NMOS_OUT_L1_1 D G S B PARAMS:  M = 1 W = 100U L = 10U
M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
+ NRD={LS/W} NRS={LS/W}
.ENDS
*$

 .SUBCKT Q_NMOS_OUT_L1_2 D G S B PARAMS:  M = 1 W = 100U L = 10U
*M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
M1 D G S B Q_NMOS_Out_L1  W = {W} L = {L} M = {M} AD={W*LS} AS={W*LS} PD={W + 2*LS} PS={W + 2*LS} 
+ NRD={LS/W} NRS={LS/W}
.ENDS
*$
 
.SUBCKT D_LIM1_1 1 2
D1 1 2  D_Lim1
.ENDS
*$
 
.SUBCKT D_ZR_5V3  1    2
D1 1 2  D_Z5V3
.MODEL D_Z5V3 D( IS=1P N=1.0 BV=14.15 IBV=1.0M RS=10 XTI=0 EG=0.48 )
.ENDS 

.SUBCKT HYSTCOMPG_THLRF  inp inm out GROUND 
+ Params: Vthres=0 Vhyst=1 VoutH=5 VoutL=0 Rout=1 Tdlh=1N Tdhl=1N Trise=1N Tfall=1N 
* Trise ->   90%*(VoutH-VoutL), Tfall -> 10%*(VoutH-VoutL)
.PARAM Tdellh = {MAX(Tdlh,MinADel)}
.PARAM Tdelhl = {MAX(Tdhl,MinADel)}
.Param Rdel = {IF ( ((Tdellh > 1E-15)|(Tdelhl > 1E-15)) & (Rout < 1), 1, Rout ) } 
.Param Ro = {IF ( ((Trise > 1E-15)|(Tfall > 1E-15)) & (Rout < 1), 1, Rout ) } 
.Param VoutM={(VoutH+VoutL)/2}
.Param Tdmin= 1p
*.Param Cdel={Sqrt((Tdelhl+Tdmin)*(Tdellh+Tdmin))/(0.693*(Rdel+1u))}
.Param Cdel={Sqrt((Tdelhl+Tdmin)*(Tdellh+Tdmin))/(4.6*(Rdel+1u))}
.Param Gdlh={Sqrt((Tdelhl+Tdmin)/(Tdellh+Tdmin))/Rdel}
.Param Gdhl={(Tdellh+Tdmin)/(Tdelhl+Tdmin)*Gdlh}

.Param Cout={Sqrt(Tfall*Trise)/(2.287*(Ro+1u))}
.Param Gr={Sqrt(Tfall/(Trise+Tdmin))/Ro}
.Param Gf={(Trise+Tdmin)/Tfall*Gr}

.Param VthH={Vthres+Vhyst}
.Param VthL={Vthres-Vhyst}

*EVthrH VthrH 0 value = {4.35}
*EVthrL VthrL 0 value = {4.25}

Rinp inp GROUND 1G
Rinm inm GROUND 1G
Gthr GROUND thr Value= { IF ( V(out,gnd) < {VoutM}, {VthH}, {VthL}) }
*Gthr GROUND thr Value= { IF ( V(out,gnd) < VoutM, V(VthrH), V(VthrL) ) }
Rthr GROUND thr 1

Gouti GROUND outi Value= { IF ( (V(inp,inm) > V(thr,gnd)), (VoutH - V(outi,gnd))*Gdlh, (VoutL - V(outi,gnd))*Gdhl ) }
Couti outi GROUND {Cdel} Rpar=1g

Gthro GROUND thro Value= { IF ( V(out,gnd) < VoutM, VoutH*0.99, VoutH*0.01 ) }
Rthro GROUND thro 1
*Gout GROUND out Value= { IF ( (V(outi, gnd) > VoutM), (VoutH - V(out,gnd))*Gr, (VoutL - V(out,gnd))*Gf ) }
Gout GROUND out Value= { IF ( (V(outi, gnd) > V(thro,gnd)), (VoutH - V(out,gnd))*Gr, (VoutL - V(out,gnd))*Gf ) }
Cout out GROUND {Cout} Rpar=1g
.ENDS

.SUBCKT IIB  1 2 Vdd GROUND PARAMS: Rtemp = {1/3.50985}
.PARAM RVdd = {1/1.0}
GVocmtemp 0 10 table {TEMP} = (-55,3.84236, -25.2609,3.76847, 4.79130,3.62069, 24.5130,3.50985, 34.9478,3.49754, 
+ 49.7130,3.47291, 64.7391,3.47291, 79.7130,3.49754, 94.6348,3.69458, 109.661,3.95320, 124.374,4.35961)
R1 10 0 { Rtemp}
GIibvdd 0 20 table {V(Vdd,Gnd)} = (0,0, 3,1.73219, 3.49652,2.24816, 3.99739,2.61671, 
+ 4.50261,3.13268, 5.00348,3.50123, 5.50000,3.86978)
R2 20 0 {RVdd}
GIib 1 2 Value = { V(20)*V(10)*1n}
.ENDS

.SUBCKT D_LIMINH  1 2
D1 1 2  D_Liminh
*.MODEL D_Liminh D( IS=3.5n N=1.0 RS=0 XTI=0 AF=0 KF=0 EG=0.1)
.MODEL D_Liminh D( IS=3.5f N=1.0 RS=0 XTI=0 AF=0 KF=0 EG=0.55)
.ENDS

.PARAM MinADel = {1n}
.SUBCKT HYSTCOMPGD  inp inm out GROUND 
+ Params: Vthres=0 Vhyst=1 VoutH=5 VoutL=0 Rout=1 Delay=1N
*
.PARAM Tdel = {MAX(Delay,MinADel)}
.Param Rdel = {IF ( (Tdel > 1E-15) & (Rout < 1), 1, Rout ) }
.Param VoutM={(VoutH+VoutL)/2}
.Param VthH={Vthres+Vhyst}
.Param VthL={Vthres-Vhyst}
.Param Cout={Tdel/(0.693*(Rdel+1u))}
.Param Gdlh={1/Rdel}
.Param Gdhl={1*Gdlh}
*
Gthr GROUND thr Value= { IF ( V(out,gnd) < {VoutM}, {VthH}, {VthL}) }
Rthr GROUND thr 1
Gout GROUND out Value= { IF ( (V(inp,inm) > V(thr,gnd)), (VoutH - V(out,gnd))*Gdlh, (VoutL - V(out,gnd))*Gdhl ) }
Cout out GROUND {Cout}
Rout out GROUND {1e5*Rdel}
.ENDS

.SUBCKT VOST  1 2
*VOS Input offset voltage
*ISO224X, Initial, at TA = 25°C, VIN = GND1 50.0 ±0.4(1) 50.0mV
*ISO224XB, Initial, at TA = 25°C, VIN = GND1, 4.5 V = VDD1 = 5.5 V 5.0 ±0.4(1) 5.0
*TCVOS Input offset drift ISO224X ±20(1)µV/°C
.PARAM I0 = 1M
*.PARAM DVOS_DT= {0.4U}
.PARAM DVOS_DT= {-5.0U}

.PARAM VOFFS = {-119.0U + 2*DVOS_DT}
.PARAM R0 = {VOFFS/I0}
.PARAM TC1= {DVOS_DT/R0/I0}

R2 40 0 RMOD2 {R0}
I2 40 0 {I0}
E3 1 2 40 0 1
.MODEL RMOD2 RES (TC1={TC1} TC2=0 TCE=0)
.ENDS

.SUBCKT D_D4  1    2
D1 1 2  DD
.MODEL DD D( IS=10n N=0.50 RS=1 XTI=0 Eg=0.35)
.ENDS D_D

.SUBCKT D_ZB1  1    2
D1 1 2  D_4_9V
CD 1 2 10P
.MODEL D_4_9V D( IS=1n N=1.0 BV=2.4 IBV=1.0m RS=0 XTI=0 EG=0.55)
.ENDS 

* STANDARD OPERATIONAL AMPLIFIER MACROMODEL SUBCIRCUIT
* CREATED USING 08/05/06
* (REV 1.53 03/05/16, simplified 1.5, VDROPOL referenced to VP  )
.SUBCKT STDOPAMP  INP INM VP VM OUT
+ PARAMS: GAIN=200K RIN=2MEG RINC=1E9 CIN=1p CINC=1p ROUT=75 SLEWRATE=500K FPOLE1=5 
+ VDROPOH=1.9 VDROPOL=1.9 
*FPOLE2=1MEG
*
.PARAM PI = 3.141592
.PARAM IS = 1.0E-12
.PARAM VT = 0.02585
.PARAM IMAX = 100.0E-2
.PARAM C1 = {IMAX/SLEWRATE}
.PARAM R1 = {1/(2*PI*C1*FPOLE1)}
.PARAM GM1 = {GAIN/R1}
*.PARAM R2 = 100
*.PARAM G2 = {1/R2}
.PARAM GOUT = {1/ROUT}
*.PARAM C2 = {1/(2*PI*R2*FPOLE2)}
.PARAM VDF = {VT*LOG(1 + IMAX/IS)}
*
RINM1      INM VP  {2*RINC}
RINM2      INM VM  {2*RINC}
RINP1      INP VP  {2*RINC}
RINP2      INP VM  {2*RINC}
RIN        INM INP  {RIN}
CINM1      INM VM  {CINC}
CINP1      INP VM  {CINC}
CIN        INM INP  {CIN}
*EVP VPI 0 VALUE = { V(VP)-(VDROPOH + VDF) }
EVM VMI 0 VALUE = { Limit(V(VP)-(VDROPOL - VDF), V(VM) + VDF, V(VP) + VDF)  }
EVP VPI 0 VALUE = { Limit(V(VP)-(VDROPOH + VDF), V(VM) + VDF, V(VP))  }

GIQ         VP VM VALUE = {5M*ABS(V(P1,OUT))}
GMO2        VM OUT P1 VM {0.5*GOUT}
RO2         OUT VM {2*ROUT} 
GMO1        OUT VP VP P1 {0.5*GOUT}
RO1         VP OUT {2*ROUT} 
*C2          P2 GROUND  {C2}
*R2          P2 GROUND  {R2}
*GM2         GROUND P2 P1 GROUND {G2}
EGND        GROUND  0  POLY(2) (VP,0) (VM,0) 0 .5 .5

D3         VMI P1  D_1
D2          P1 VPI  D_1
C1          P1 GROUND  {C1}
R1          P1 GROUND  {R1}
*GM1         GROUND P1 VALUE = { LIMIT( GM1*V(INP,INM), -IMAX, IMAX) }
GM1         GROUND P1 VALUE = { IF (TIME < 1e-30, GM1*V(INP,INM), LIMIT( GM1*V(INP,INM), -IMAX, IMAX)) }
*GM1         GROUND P1 VALUE = { Limit( V(VP,VM)/(Abs(-VDROPOH + VDROPOL)+1m), 0, 1 )*IF (TIME < 1e-30, GM1*V(INP,INM), LIMIT( GM1*V(INP,INM), -IMAX, IMAX)) }
.MODEL D_1 D( IS={IS} XTI=0 EG=0.8)
.ENDS

.SUBCKT SWMOSP  D  G  S  B Params: Vth=2.0 KP=10 Rd=1m Rs=1m L=1u W=1u
.Param T0={273.15}
.Param Tnom={25+T0}

Rs     S    Si   {Rs}
Rd     D    Di   {Rd} TC=7m

M1      Di    G    Si    B    SWMOS    L={L}   W={W}
.MODEL SWMOS PMOS (LEVEL=1 KP= {KP}  VTO={Vth} IS=0 LAMBDA=0.5M RDS=1e7)

*Dbody      Di  Bi  DBODY
*.MODEL DBODY  D(IS=100n  N=1.1  CJO=1.00n M=0.3 VJ=0.7 RS=20.47u BV=85 IBV=1m EG=1.12  TT=30n)

Cgd     G    Di    1p
Cgs     G    Si    10p
Cds     Di    Si    1p
.ENDS   

.SUBCKT D_LIMCM 1 2
D1 1 2  D_Limcm
.MODEL D_LIMcm D( IS=1p N=1.0 RS=100 XTI=0 AF=0 KF=0 EG=1.1)
.ENDS

.SUBCKT D_LIM1T 1 2
D1 1 2  D_Lim1T
.ENDS
.MODEL D_LIM1T D( IS=10F N=1.0 RS=10 XTI=0 AF=0 KF=0 EG=0.555)
*$

*Parameters: 0.4um CMOS
.PARAM LS = 1.0U
.PARAM VTOHP = 0.75
.PARAM VTOHN = 0.75

.PARAM LAMBDA = 10M

.PARAM GAMMA = 0.00
.PARAM KAPPA = 1.0
.PARAM THETA = 0.23
.PARAM ETA = 3

.PARAM KPN = {UON*TESTCOX * 1e-4}
.PARAM KPP = {UOP*TESTCOX * 1e-4}
.PARAM LDN = 0.09U
.PARAM LDP = 0.09U
.PARAM RSW = 1810
.PARAM RSN = 1.41
.PARAM RDS = 10MEG
.PARAM VBMUL = 1E6
.PARAM RPAR = 1T
.PARAM CBDJ = 1.0 
.PARAM CBDS = 1.0
.PARAM CGBF = 1.0
.PARAM PBP = 0.7
.PARAM PBN = 0.7
.PARAM UON = 450
.PARAM UOP = 450
*.PARAM UOP = 150
*
.PARAM CJN = {200U}
.PARAM CJP = {400U} 
.PARAM CJSWN = {1.2N}
.PARAM CJSWP = {2.4N}
.PARAM XJN = 0.15U
.PARAM CGSON = {0.6*XJN*TESTCOX} 
.PARAM CGDON = {CGSON}
.PARAM CGBON = {CGBF*CGDON}
.PARAM XJP = 0.18U
.PARAM CGSOP = {0.6*XJP*TESTCOX} 
.PARAM CGDOP = {CGSOP}
.PARAM CGBOP = {CGBF*CGDOP}
.PARAM EPSSIO2 = {3.9*8.854214871E-12}
.PARAM TOX = 80E-10
.PARAM TESTCOX = {EPSSIO2/TOX}
*$
.MODEL Q_NMOS NMOS Level=1 L=2U W=10U KP={KPN} VTO={VTOHN}  AF=0 KF=0
*$
.MODEL Q_PMOS PMOS Level=1 L=2U W=10U KP={KPP} VTO={-VTOHP}  AF=0 KF=0
*$
.MODEL Q_NMOS_Out_L1 NMOS LEVEL=1 L=10U W=100U KP={KPN} VTO={VTOHN} LAMBDA={LAMBDA}
+ CJ={CJN} CJSW={CJSWN} CGSO={CGSON} CGDO={CGDON} RSH= 4 PB={PBN} LD= {LDN} RDS={RDS} 
*$
.MODEL Q_NMOS_Out NMOS LEVEL=3 L=10U W=100U KP={KPN} VTO={VTOHN} THETA={THETA}
+ CJ={CJN} CJSW={CJSWN} CGSO={CGSON} CGDO={CGDON} RSH= 4 PB={PBN} LD= {LDN} RDS={RDS} TOX={TOX} XJ={XJN}
+ GAMMA={GAMMA} KAPPA={KAPPA} ETA={ETA}
*$
.MODEL Q_PMOS_Out_L1 PMOS LEVEL=1 L=10U W=100U KP={KPP} VTO={-VTOHP} LAMBDA={LAMBDA}
+ CJ={CJP} CJSW={CJSWP} CGSO={CGSOP} CGDO={CGDOP} RSH=4 PB={PBP} LD= {LDP} RDS={RDS} 
*$
.MODEL Q_PMOS_Out PMOS LEVEL=3 L=10U W=100U KP={KPP} VTO={-VTOHP} THETA={THETA}
+ CJ={CJP} CJSW={CJSWP} CGSO={CGSOP} CGDO={CGDOP} RSH=4 PB={PBP} LD= {LDP} RDS={RDS} TOX={TOX} XJ={XJP}
+ GAMMA={GAMMA} KAPPA={KAPPA} ETA={ETA}
*$
.MODEL D_Lim1 D( IS=10F N=1.0 RS=1000 XTI=0 AF=0 KF=0 EG=1.11)
*$
.MODEL D_Lim100 D( IS=10F N=1.0 RS=100 XTI=0 AF=0 KF=0 EG=1.11)
*$
.MODEL D_Lim1005 D( IS=10F N=0.5 RS=100 XTI=0 AF=0 KF=0 EG=0.555)
*$
.MODEL D_Lim100_05 D( IS=10F N=0.5 RS=100 XTI=0 AF=0 KF=0 EG=0.555)
*$
.MODEL D_Lim10 D( IS=10F N=1.0 RS=10 XTI=0 AF=0 KF=0 EG=1.11)
*$
.MODEL D_Lim2 D( IS=10f N=0.5 RS=1 XTI=0 AF=0 KF=0 EG=0.555 )
*$
.MODEL D_Lim3 D( IS=1E-18 N=1.0 RS=1 XTI=0 AF=0 KF=0)
*$
.MODEL D_Lim4 D( IS=10F N=1.0 RS=1m XTI=0 AF=0 KF=0)
*$
.MODEL D1 D( IS=1p N=1.0 RS=0 XTI=3 AF=0 KF=0 )
*$
.MODEL DZ_14V D( IS=1p N=1.0 BV=14.0 IBV=5.0M XTI=0 RS=10)
.MODEL DZ_80V D( IS=1p N=1.0 BV=80.0 IBV=5.0M XTI=0 RS=10)
*$
.MODEL D2 D( IS=1p N=1.0 XTI=0 RS=10)
```
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you very much! \$\endgroup\$ Aug 26, 2020 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.