This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OPA838: Fixed LTSPICE model

Part Number: OPA838
Other Parts Discussed in Thread: TINA-TI

following on from this post: https://e2e.ti.com/support/tools/simulation-hardware-system-design-tools-group/sim-hw-system-design/f/simulation-hardware-system-design-tools-forum/769211/tina-spice-opa838-the-opa838-tina-spice-model-has-occurred-floating-error-for-using-some-standard-spice

The model required a few more resistors to allow simulation in the latest version of LTSPICE.  Model was verified with loaded open loop gain simulation

CIR file follows:

* OPA838
*****************************************************************************
* (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: WEBENCH(R) Design Center, Texas Instruments Inc.
* Part: OPA838
* Date: 06/29/2018
* Model Type: All In One
* Simulator: TINA
* Simulator Version: 9.0
* EVM Order Number: N/A
* EVM Users Guide: N/A
* Datasheet: Rev2 Nov16, 2016
*
*****************************************************************************
* Notes:
* The following parameters are modeled: Aol,GBW,PM,
* Closed loop f_3db, peaking, Zincm,Zindiff,Vnoise, Inoise,
* PSRR,CMRR,Vos,Ib,Ios,Vos drift, Ib drift ,Ios drift , Isc,
* VOH,VOL,Zool,Zocl,Slew Rate,VIH,VIL, quiscent current,recovery time.
*****************************************************************************

.subckt OPA838 VOUT VS- VIN+ VIN- PDBAR VS+
XI0 VS- VS+ VIN- VIN+ VOUT PDBAR VFA
.ends

.subckt VFA VEE VCC VINM VINP VOUT PD
XI0 VEE VCC VINM VINP VOUT PD VFA_HT5

XI5 NET35 VINP DiodeIdeal
V0 NET35 NET38 700e-3
XI6 NET33 NET38 DiodeIdeal
V1 NET33 VINM 700e-3

XI8 NET030 VINM DiodeIdeal
V3 NET030 NET023 700e-3
XI7 NET032 NET023 DiodeIdeal
V2 NET032 VINP 700e-3

.ends


.subckt ESDDIODES VCC VEE VIN VOUT PARAMS: VESDL=-700e-3 VESDH=-700e-3
XIDVIH NET12 NET16 DiodeIdeal
XIDVIL NET16 NET20 DiodeIdeal
R0 VIN NET16 1e-3
V0 NET16 VOUT 0
VESDL NET20 VEE {VESDL}
VESDH VCC NET12 {VESDH}
.ends ESDDIODES

.subckt VINRANGE3 SIGNAL1 SIGNAL2 VCC VEE VINM VINP PARAMS: SignalGain=1 VIL=100e-3 VIH=100e-3
XIDVIL NET13 NET074 DiodeIdeal
XIDVIH NET076 NET13 DiodeIdeal
FVIL2 SIGNAL2 VEE VIL {SignalGain}
FVIL1 SIGNAL1 VEE VIL {SignalGain}
FVIH1 VCC SIGNAL1 VIH {SignalGain}
FVIH2 VCC SIGNAL2 VIH {SignalGain}
E1 NET8 0 VINM 0 1
E0 NET6 0 VINP 0 1
VIL NET074 VEE {VIL}
VIH VCC NET076 {VIH}
R7 NET8 NET13 1
R6 NET6 NET13 1
.ends VINRANGE3

.subckt ZIN IN1 IN2 OUT1 OUT2 PARAMS: R5=100e-3 R4=100e-3 C3=50e-15 C2=50e-15
+ C1=50e-15 R2=10e9 R1=10e9 R3=1e9

R5 IN2 OUT2 {R5}
R4 IN1 OUT1 {R4}
C3 OUT1 OUT2 {C3}
C2 OUT2 0 {C2}
C1 OUT1 0 {C1}
GR2 OUT2 0 OUT2 0 {1/R2}
GR1 0 OUT1 0 OUT1 {1/R1}
GR3 OUT1 OUT2 OUT1 OUT2 {1/R3}
.ends ZIN

.subckt DOMPOLE A B C PARAMS: R2=1e-3 R1=2.653e6 C2=1e-15 C1=10e-12
R2 NET7 A {R2}
R1 B A {R1}
C2 NET7 C {C2}
C1 A B {C1}
.ends DOMPOLE

.subckt PHASEDELAY A B VIN VOUT PARAMS: R1=1 R2=1e9 C1=1e-15 C2=1e-15 Gain=1 L=1e-12
R5 VOUT NET026 1e-3
R3 NET15 NET024 1e-3
R1 NET27 NET15 {R1}
R4 NET15 A 1e9
R2 VOUT B {R2}
C1 NET024 A {C1}
C2 NET026 B {C2}
E0 NET27 0 VIN 0 {Gain}
L0 NET15 VOUT {L}
.ends PHASEDELAY

.subckt NONDOMPOLE C VIN VOUT PARAMS: L=1e-12 Gain=1 C=226.7e-12 Rp=1e9 Rs=1
L0 NET020 VOUT {L}
E0 NET4 0 VIN 0 {Gain}
C1 NET019 C {C}
R3 VOUT C {Rp}
R2 VOUT NET019 1e-3
R1 NET020 NET4 {Rs}
.ends NONDOMPOLE

.subckt ANALOG_BUFFER VOUT VIN
R0 VIN 0 1e9
R1 VOUT 0 1e9
E0 VOUT 0 VIN 0 1
.ends ANALOG_BUFFER

.subckt OUTPUTCIR PD VCC VCCMAIN VEE VEEMAIN VIN VOUT
XI25 NET75 NET092 OutputCir_IscDiodeIdeal PARAMS: IS=10e-15 N=50e-3
XI23 NET79 NET76 OutputCir_IscDiodeIdeal PARAMS: IS=10e-15 N=50e-3

*XIVOL VOL VEE VIMONINV OutputCir_VOHVOL PARAMS: VSUPPLYREF=0 VOUTvsIOUT_X1=
*+ {ABS(0)} VOUTvsIOUT_Y1=0.1 VOUTvsIOUT_X2= {ABS(-19e-3)} VOUTvsIOUT_Y2=0.131
*+
*XIVOH VCC VOH VIMON OutputCir_VOHVOL PARAMS: VSUPPLYREF=5 VOUTvsIOUT_X1= {ABS(0)}
*+ VOUTvsIOUT_Y1=4.9 VOUTvsIOUT_X2= {ABS(17e-3)} VOUTvsIOUT_Y2=4.59


*XISOURCEVLIMIT NET064 NET76 VCC VEE OutputCir_IscVlimit PARAMS: RIsc=1 IscVsVsupply_X1=3
*+ IscVsVsupply_Y1= {ABS(37.5e-3)} IscVsVsupply_X2=5 IscVsVsupply_Y2= {ABS(37.5e-3)}
*+
*XISINKVLIMIT NET047 NET092 VCC VEE OutputCir_IscVlimit PARAMS: RIsc=1 IscVsVsupply_X1=3
*+ IscVsVsupply_Y1= {ABS(-50e-3)} IscVsVsupply_X2=5 IscVsVsupply_Y2= {ABS(-50e-3)}
*+


XIVOH VCC VOH VIMON OutputCir_VOH
XIVOL VOL VEE VIMONINV OutputCir_VOL


XI14 NET070 NET15 DiodeIdeal
XI15 NET068 VOL DiodeIdeal
XI0 VCCMAIN VEEMAIN VIMON PD OutputCir_ILOAD
XI6 NET22 NET0100 0 NET043 VCC VEE RECOVERYSIGNAL OutputCir_RecoveryAssist
XAHDLI43 NET055 NET054 RECOVERYSIGNAL VCC VEE HPA_OR2
XAHDLI41 VOUT NET067 NET055 VCC VEE HPA_COMP_IDEAL
XAHDLI42 NET059 VOUT NET054 VCC VEE HPA_COMP_IDEAL
HVIMONINV VIMONINV 0 VCURSINKDETECT 1
HVIMON VIMON 0 VCURSOURCEDETECT 1
RVIMONINV VIMONINV 0 1e9
RVIMON VIMON 0 1e9
RISC NET092 NET15 1
XI11 NET76 NET15 ANALOG_BUFFER
XI2 NET22 VIN ANALOG_BUFFER
VPROBE3 NET070 VOH 0
VPROBE2 NET043 NET0100 0
VTRIGGERVOL NET059 VOL 10e-3
VTRIGGERVOH VOH NET067 10e-3
*no idea where these two voltages where meant to connect
V3 NET79 NET047 0
V4 NET75 NET064 0
RFIX1 NET047 NET092 1e12
RFIX2 NET064 NET76 1e12
VPROBE4 NET068 NET15 0
VCURSOURCEDETECT NET15 NET34 0
VCURSINKDETECT VOUT NET34 0
VPROBE1 NET53 NET17 0
XI1 NET53 NET22 VIMON OutputCir_Rout PARAMS: Ro_Iout_0A=3.76e+05 RIsc=1 Isc=37.5e-3 Islope_const=10u
COUT NET22 NET0100 40e-6
ROUTMINOR NET0100 NET17 5.7354
LOUT1 NET17 NET092B 300e-9
LOUT2 NET092B NET092 100e-9
CBYP NET17 NET092A 100e-12
RBYP NET092A NET092B 150
RP NET092 NET0146 103
CP NET0146 0 2.7e-12
.ends OUTPUTCIR


.SUBCKT OutputCir_VOH A B C
E1 A B TABLE { V(C) } =
+ (0, 0.1)
+ (0.004398167, 0.101)
+ (0.004990522, 0.115)
+ (0.005727892, 0.132)
+ (0.006644229, 0.152)
+ (0.007775451, 0.177)
+ (0.009165461, 0.208)
+ (0.010861992, 0.246)
+ (0.012924627, 0.291)
+ (0.015409226, 0.345)
+ (0.018368556, 0.410)
+ (0.021854651, 0.486)
+ (0.025888259, 0.575)
+ (0.030440626, 0.679)
+ (0.035458333, 0.798)
+ (37.5m, 1)
+ (38.5m, 2)
+ (40.0m, 3)
+ (41.0m, 4)
+ (42.0m, 5)

.ENDS


.SUBCKT OutputCir_VOL A B C
E1 A B TABLE { V(C) } =
+ (0, 0.027)
+ (0.004533833, 0.027)
+ (0.005164196, 0.032)
+ (0.005957685, 0.037)
+ (0.006949841, 0.044)
+ (0.008193846, 0.052)
+ (0.009749299, 0.062)
+ (0.011686039, 0.075)
+ (0.014100656, 0.090)
+ (0.017096732, 0.109)
+ (0.020820626, 0.131)
+ (0.025392196, 0.160)
+ (0.030998669, 0.195)
+ (0.037762424, 0.241)
+ (0.045708333, 0.306)
+ (47.5m, 0.5000)
+ (50.0m, 1.0000)
+ (51.0m, 2.0000)
+ (52.0m, 3.0000)
+ (53.0m, 4.0000)
+ (54.0m, 5.0000)

.ENDS


.subckt RECOVERYCIRCUIT A B VCC VEE PARAMS: VRecL=-10e-3 VRecH=-10e-3
XI2 NET8 NET014 DiodeIdeal
XI3 NET014 NET9 DiodeIdeal
VBRIDGE NET014 A 0
VPROBE A B 0
VRECL NET9 VEE {VRecL}
VRECH VCC NET8 {VRecH}
.ends RECOVERYCIRCUIT

.subckt VFA_HT5 VEE VCC VINM VINP VOUT PD

***step1
*Rincm=R1=R2,Cincm=C1=C2,Rindiff=R3,Cindiff=C3
XI53 VINP VINM NET1 NET2 ZIN PARAMS: R5=100e-3 R4=100e-3
+ C3=0.8e-12 C2=1.3e-12 C1=1.3e-12 R2=100e3 R1=100e3 R3=50e3
XI17 NET1 NET11 Vnoise PARAMS: X=0.01 Y=191.1e-9 Z=1.9e-9
XI18 NET11 0 Inoise PARAMS: X=0.01 Y=131e-12 Z=1.3e-12
XI63 NET2 0 Inoise PARAMS: X=0.01 Y=131e-12 Z=1.3e-12
XI59 NET21 NET11 Vinoffset PARAMS: TA=25 VOS=15e-6 DRIFT=0.3e-6
XI60 VINP_INT VINM_INT Ibias PARAMS: Choice=1 Ibias=-1.8e-6 Ioffset=10e-9 TA=25
+ IbiasDrift=10e-9 IoffsetDrift=10e-12 Ibiasp=-1.795e-6 Ibiasm=-1.805e-6
XI40 VCC VEE POWER VEE_INT VCC_INT Iq PARAMS: IOFF=2e-6 ION_X1=0 ION_Y1=0.95e-3
+ ION_X2=1.8 ION_Y2=0.95e-3 ION_X3=3.3 ION_Y3=0.95e-3 ION_X4=5.5 ION_Y4=0.95e-3

***step2
XI19 VCC_INT VEE_INT NET2 NET12 PSRR PARAMS: PSRRP_DC=-120 PSRRP_f3dB=10.03e3
+ PSRRN_DC=-120 PSRRN_f3dB=10.08e3
XI66 HIGHZ NET56 VCC_INT VEE_INT NET22 NET21 VINRANGE3 PARAMS: SignalGain=1 VIL=-0.2 VIH=1.2
*Isc-source and sink current

***step3 & step4
XI21 NET12 NET22 NET12 CMRR PARAMS: CMRR_DC=-106 CMRR_f3dB=10e3 CMRR_f3dB_FudgeFactor=1
XI52 VINP_INT VINM_INT NET32 NET31 VEE_INT VCC_INT POWER GmItail PARAMS: Choice=11
+ Gm=9.021e-1 SBF=1 ITAILMAX_X1=3 ITAILMAX_Y1=100e-3 ITAILMAX_X2=5 ITAILMAX_Y2=100e-3
+ ITAILMIN_X1=3 ITAILMIN_Y1=100e-3 ITAILMIN_X2=5 ITAILMIN_Y2=100e-3
XI58 HIGHZ NET32 0 DOMPOLE PARAMS: R2=1e-3 C2=1e-15 R1=2.482e6 C1=4.985e-10

**The Gain = VCVS3 Gain, RS=R10, L=L1, C=C2, Rp=R13
XI26 0 NET51 NET61 NONDOMPOLE PARAMS: Gain=1.18 Rs=60 L=53.2e-9 C=1.7e-12 Rp=340

**The Gain=VCVS2 gain, R1=R4, C1=C3, L=L3, C2=C4, R2=R6
XI85 0 0 NET61 NET71 PHASEDELAY PARAMS: R1=10 C1=21.55e-12 L=6.2e-9 C2=140.7e-12 R2=10 Gain=2
*VOH and VOL

***step5
XI30 POWER VCC_INT VCC VEE_INT VEE NET71 VOUT OUTPUTCIR

***step7
XI28 NET41 NET51 VCC_INT VEE_INT RECOVERYCIRCUIT PARAMS: VRecL=-0.1 VRecH=-0.1

***

XI67 VCC_INT VEE_INT NET21 VINP_INT ESDDIODES PARAMS: VESDL=-700e-3 VESDH=-700e-3
XI68 VCC_INT VEE_INT NET22 VINM_INT ESDDIODES PARAMS: VESDL=-700e-3 VESDH=-700e-3
VPROBE2 HIGHZ NET41 0
*VPROBE2 HIGHZ NET41
VDOMPOLEBIAS NET32 0 0
VPROBE1 NET31 HIGHZ 0
*VPROBE1 NET31 HIGHZ
R0 NET56 0 1e3
R14 VCC_INT PD 10e6
XAHDLINV3 PD PDINV VCC_INT VEE_INT HPA_INV_IDEAL
XAHDLINV1 PDINV POWER VCC_INT VEE_INT HPA_INV_IDEAL
XI13 VEE_INT VEE ANALOG_BUFFER
XI12 VCC_INT VCC ANALOG_BUFFER
.ends VFA_HT5

.SUBCKT HPA_OR2 1 2 3 VDD VSS
E1 4 0 VALUE={IF(((V(1)<(V(VDD)+V(VSS))/2 ) & (V(2)<(V(VDD)+V(VSS))/2 )),V(VSS),V(VDD))}
R1 4 3 1
C1 3 0 1e-12
.ENDS

.SUBCKT HPA_INV_IDEAL 1 2 VDD VSS
E1 2 0 VALUE = { IF( V(1)> (V(VDD)+V(VSS))/2, V(VSS), V(VDD) ) }
.ENDS

.SUBCKT HPA_COMP_IDEAL INP INN OUT VDD VSS
E1 OUT 0 VALUE = { IF( (V(INP) > V(INN)), V(VDD), V(VSS) ) }
.ENDS

.SUBCKT AVG VIN1 VIN2 VOUT
E1 VOUT 0 VALUE = { ( V(VIN1) + V(VIN2) ) / 2 }
.ENDS

.SUBCKT CMRR A B C PARAMS:

+ CMRR_DC = -100
+ CMRR_f3dB = 50e3
+ CMRR_f3dB_FudgeFactor = 3.4

.PARAM CMRR = {0-CMRR_DC}
.PARAM FCMRR = {CMRR_f3dB * CMRR_f3dB_FudgeFactor}

X1 A B C 0 CMRR_NEW PARAMS: CMRR = {CMRR} FCMRR = {FCMRR}
.ENDS

.SUBCKT DiodeIdeal NEG POS
G1 POS NEG VALUE = { IF ( V(POS,NEG) <= 0 , 0, V(POS,NEG)*0.01G ) }
R0 POS NEG 1000G
.ENDS


.SUBCKT DomPoleBias VIN1 VIN2 VOUT
E1 VOUT 0 VALUE = { ( V(VIN1) + V(VIN2) ) / 2 * 1/2}
R1 VOUT 0 1G
.ENDS


.SUBCKT GmItail Vinp Vinm Ioutp Ioutm VEE VCC PD PARAMS:
+ Choice = 2

+ Gm = 3.77e-2
+ SBF = 1

+ ITAILMAX_X1 = { 3.0 }
+ ITAILMAX_Y1 = { 10m }

+ ITAILMAX_X2 = { 5.0 }
+ ITAILMAX_Y2 = { 10m }

+ ITAILMIN_X1 = { 3.0 }
+ ITAILMIN_Y1 = { 10m }

+ ITAILMIN_X2 = { 5.0 }
+ ITAILMIN_Y2 = { 10m }

.PARAM Choice1 = { IF ( Choice == 1, 1, 0 ) }
.PARAM Choice2 = { IF ( Choice == 2, 1, 0 ) }
.PARAM Choice3 = { IF ( Choice == 3, 1, 0 ) }
.PARAM Choice11 = { IF ( Choice == 11, 1, 0 ) }

X1 PD PDINV VCC VEE LOGIC1 0 DLSINV
VLOGIC1 LOGIC1 0 1

.PARAM ITAILMAX_SLOPE =
+ { ( ITAILMAX_Y2 - ITAILMAX_Y1 ) / ( ITAILMAX_X2 - ITAILMAX_X1 ) }
.PARAM ITAILMAX_INTCP =
+ { ITAILMAX_Y1 - ITAILMAX_SLOPE * ITAILMAX_X1 }

EITAILMAX ITAILMAX 0 VALUE =
+ { ITAILMAX_SLOPE * V(VCC,VEE) + ITAILMAX_INTCP }

.PARAM ITAILMIN_SLOPE =
+ { ( ITAILMIN_Y2 - ITAILMIN_Y1 ) / ( ITAILMIN_X2 - ITAILMIN_X1 ) }
.PARAM ITAILMIN_INTCP =
+ { ITAILMIN_Y1 - ITAILMIN_SLOPE * ITAILMIN_X1 }

EITAILMIN ITAILMIN 0 VALUE =
+ { ITAILMIN_SLOPE * V(VCC,VEE) + ITAILMIN_INTCP }

G1 IOUTP IOUTM VALUE = { ( 1-V(PDINV) ) * (
+ Choice1 * ( LIMIT ( Gm * V(VINP,VINM) , -V(ITAILMIN), V(ITAILMAX) ) ) +
+ Choice2 * ( Gm * (V(ITAILMAX)/Gm) * TANH( V(VINP,VINM) / (V(ITAILMAX)/Gm) ) ) +
+ Choice3 * ( Gm * V(VINP,VINM) / ( 1 + Gm/V(ITAILMAX) * ABS( V(VINP,VINM) ) ) ) +
+ Choice11 * ( LIMIT ( ( Gm * EXP ( LIMIT ( SBF * ABS(V(VINP,VINM)) , -LOG(1E100), LOG(1E100) ) ) )
+ * V(VINP,VINM) , -V(ITAILMIN), V(ITAILMAX) ) ) +
+ 0 ) }

.ENDS

.SUBCKT Ibias VINP VINM PARAMS:
+ Choice = 1

+ Ibias = -10u
+ Ioffset = 150n

+ TA = 25
+ IbiasDrift = 0
+ IoffsetDrift = 0

+ Ibiasp = -9.925u
+ Ibiasm = -10.075u

.PARAM Choice1 = { IF ( Choice == 1, 1, 0 ) }
.PARAM Choice2 = { IF ( Choice == 2, 1, 0 ) }

.PARAM Ib = { Choice1 * Ibias + Choice2 * (Ibiasp + Ibiasm)/2 }
.PARAM Io = { Choice1 * Ioffset + Choice2 * ABS(Ibiasp - Ibiasm) }

EIb Ib 0 VALUE = { IbiasDrift * TEMP + ( Ib - IbiasDrift * TA ) }
EIo Io 0 VALUE = { IoffsetDrift * TEMP + ( Io - IoffsetDrift * TA ) }

GIbp VINP 0 VALUE = { V(Ib) + V(Io)/2 }
GIbm VINM 0 VALUE = { V(Ib) - V(Io)/2 }

.ENDS

.SUBCKT Inoise A B PARAMS:
+ X = { 1m }
+ Y = { 100f }
+ Z = { 1f }
X1 A B FEMT PARAMS: NLFF = { Y/1f } FLWF = { X } NVRF = { Z/1f }
.ENDS

.subckt Iq VCCmain VEEmain PD VEE VCC PARAMS:
+ IOFF = { 1n }

+ ION_X1 = { 0.0 }
+ ION_Y1 = { 1m }

+ ION_X2 = { 1.6 }
+ ION_Y2 = { 1m }

+ ION_X3 = { 1.9 }
+ ION_Y3 = { 1m }

+ ION_X4 = { 12.0 }
+ ION_Y4 = { 1m }

EION_SEG1 ION_SEG1 0 VALUE = { IF ( V(VCC,VEE) <= ION_X2, 1, 0 ) }
EION_SEG2 ION_SEG2 0 VALUE = { IF ( V(VCC,VEE) > ION_X2 & V(VCC,VEE) <= ION_X3, 1, 0 ) }
EION_SEG3 ION_SEG3 0 VALUE = { IF ( V(VCC,VEE) > ION_X3 , 1, 0 ) }

.PARAM ION_SEG1_SLOPE = { ( ION_Y2 - ION_Y1 ) / ( ION_X2 - ION_X1 ) }
.PARAM ION_SEG1_INTCP = { ION_Y1 - ION_SEG1_SLOPE * ION_X1 }

.PARAM ION_SEG2_SLOPE = { ( ION_Y3 - ION_Y2 ) / ( ION_X3 - ION_X2 ) }
.PARAM ION_SEG2_INTCP = { ION_Y2 - ION_SEG2_SLOPE * ION_X2 }

.PARAM ION_SEG3_SLOPE = { ( ION_Y4 - ION_Y3 ) / ( ION_X4 - ION_X3 ) }
.PARAM ION_SEG3_INTCP = { ION_Y3 - ION_SEG3_SLOPE * ION_X3 }

EION ION 0 VALUE = { V(ION_SEG1) * ( ION_SEG1_SLOPE * V(VCC,VEE) + ION_SEG1_INTCP ) +
+ V(ION_SEG2) * ( ION_SEG2_SLOPE * V(VCC,VEE) + ION_SEG2_INTCP ) +
+ V(ION_SEG3) * ( ION_SEG3_SLOPE * V(VCC,VEE) + ION_SEG3_INTCP ) }

X1 PD PDINV VCC VEE LOGIC1 0 DLSINV
VLOGIC1 LOGIC1 0 1

G1 VCCMAIN VEEMAIN VALUE = { V(ION) * ( 1-V(PDINV) ) + IOFF * V(PDINV) }
.ends

.SUBCKT OutputCir_ILOAD VDD VSS VIMON PD
X1 PD PDINV VDD VSS LOGIC1 0 DLSINV
VLOGIC1 LOGIC1 0 1
G1 VDD 0 VALUE = {IF(V(VIMON) >= 0, V(VIMON)*( 1-V(PDINV) ), 0)}
G2 VSS 0 VALUE = {IF(V(VIMON) < 0, V(VIMON)*( 1-V(PDINV) ), 0)}
.ENDS

.SUBCKT OutputCir_IscDiodeIdeal NEG POS PARAMS:
+ IS = 1E-14
+ N = 50m

G1 POS NEG_INT VALUE = { IF ( V(POS,NEG_INT) <= 0 , IS,
+ IS * ( EXP ( V(POS,NEG_INT)/25m * 1/N ) - 0 ) ) }
V1 NEG_INT NEG {-N*0.8}
.ENDS

.SUBCKT OutputCir_IscVlimit A B VCC VEE PARAMS:
+RIsc = { 1 }

+IscVsVsupply_X1 = { 3.0 }
+IscVsVsupply_Y1 = { 75m }

+IscVsVsupply_X2 = { 5.0 }
+IscVsVsupply_Y2 = { 100m }

.PARAM IscVsVsupply_SLOPE =
+ { ( IscVsVsupply_Y2 - IscVsVsupply_Y1 ) / ( IscVsVsupply_X2 - IscVsVsupply_X1 ) }
.PARAM IscVsVsupply_INTCP =
+ { IscVsVsupply_Y1 - IscVsVsupply_SLOPE * IscVsVsupply_X1 }

EIscVsVsupply IscVsVsupply 0 VALUE =
+ { IscVsVsupply_SLOPE * V(VCC,VEE) + IscVsVsupply_INTCP }

E1 A B VALUE = { V(IscVsVsupply) * RIsc }
.ENDS

.SUBCKT OutputCir_RecoveryAssist VINP VINM IOUTP IOUTM VCC VEE RecoverySignal
X1 RecoverySignal RS VCC VEE LOGIC1 0 DLS
VLOGIC1 LOGIC1 0 1
G1 IOUTP IOUTM VALUE = { LIMIT ( 1m * V(VINP,VINM) * V(RS) , -100m, 100m ) }
.ENDS

.SUBCKT OutputCir_Rout B A VIMON PARAMS:
+ Ro_Iout_0A = 100
+ RIsc = 1
+ Isc = 100m
+ Islope_const = 1/100

.PARAM Islope = { Islope_const * Isc }

G1 A B VALUE = { V(A,B) * 1 / ( (Ro_Iout_0A - RIsc) * Islope / ( Islope + ABS(V(VIMON)) ) ) }
.ENDS

.SUBCKT OutputCir_VOHVOLDiodeIdeal NEG POS
G1 POS NEG VALUE = { IF ( V(POS,NEG) <= 0 , 0, V(POS,NEG)*0.01G ) }
R0 POS NEG 1000G
.ENDS

.SUBCKT OutputCir_VOHVOL A B C PARAMS:
+ VSUPPLYREF = {2.5}

+ VOUTvsIOUT_X1 = { ABS(0) }
+ VOUTvsIOUT_Y1 = { 2.4 }

+ VOUTvsIOUT_X2 = { ABS(100m) }
+ VOUTvsIOUT_Y2 = { 2.1 }

.PARAM VDROPvsIOUT_X1 = { VOUTvsIOUT_X1 }
.PARAM VDROPvsIOUT_Y1 = { ABS(VSUPPLYREF-VOUTvsIOUT_Y1) }

.PARAM VDROPvsIOUT_X2 = { VOUTvsIOUT_X2 }
.PARAM VDROPvsIOUT_Y2 = { ABS(VSUPPLYREF-VOUTvsIOUT_Y2) }

.PARAM VDROPvsIOUT_SLOPE =
+ { ( VDROPvsIOUT_Y2 - VDROPvsIOUT_Y1 ) / ( VDROPvsIOUT_X2 - VDROPvsIOUT_X1 ) }
.PARAM VDROPvsIOUT_INTCP =
+ { VDROPvsIOUT_Y1 - VDROPvsIOUT_SLOPE * VDROPvsIOUT_X1 }

EVDROPvsIOUT VDROPvsIOUT 0 VALUE =
+ { VDROPvsIOUT_SLOPE * V(C) + VDROPvsIOUT_INTCP }
E1 A B VALUE = { V(VDROPvsIOUT) }
.ENDS

.SUBCKT PSRR VDD VSS A B PARAMS:

+ PSRRP_DC = -100
+ PSRRP_f3dB = 100k

+ PSRRN_DC = -90
+ PSRRN_f3dB = 90k

.PARAM PSRRP = {0-PSRRP_DC}
.PARAM PSRRN = {0-PSRRN_DC}
.PARAM FPSRRP = {PSRRP_f3dB}
.PARAM FPSRRN = {PSRRN_f3dB}

X1 VDD VSS A B 0 PSRR_DUAL_NEW PARAMS:
+ PSRRP = {PSRRP} FPSRRP = {FPSRRP}
+ PSRRN = {PSRRN} FPSRRN = {FPSRRN}
.ENDS

.SUBCKT RecoveryCircuit_DiodeIdeal NEG POS
G1 POS NEG VALUE = { IF ( V(POS,NEG) <= 0 , 0, V(POS,NEG)*0.01G ) }
R0 POS NEG 1000G
.ENDS

.SUBCKT Vinoffset POS NEG PARAMS:
+ TA = 25
+ VOS = 500u
+ DRIFT = 10u

E1 POS NEG VALUE = { DRIFT * TEMP + ( VOS - DRIFT * TA ) }
.ENDS

.SUBCKT Vinrange_DiodeIdeal NEG POS
G1 POS NEG VALUE = { IF ( V(POS,NEG) <= 0 , 0, V(POS,NEG)*100k ) }
R0 POS NEG 1000G
.ENDS

.SUBCKT Vnoise A B PARAMS:
+ X = { 1m }
+ Y = { 100n }
+ Z = { 5n }
X1 A B VNSE PARAMS: NLF = { Y/1n } FLW = { X } NVR = { Z/1n }
.ENDS

.SUBCKT VNSE 1 2 PARAMS: NLF = 10 FLW = 4 NVR = 4.6
.PARAM GLF={PWR(FLW,0.25)*NLF/1164}
.PARAM RNV={1.184*PWR(NVR,2)}
.MODEL DVN D KF={PWR(FLW,0.5)/1E11} IS=1.0E-16
I1 0 7 10E-3
I2 0 8 10E-3
D1 7 0 DVN
D2 8 0 DVN
E1 3 6 7 8 {GLF}
R1 3 0 1E9
R2 3 0 1E9
R3 3 6 1E9
E2 6 4 5 0 10
R4 5 0 {RNV}
R5 5 0 {RNV}
R6 3 4 1E9
R7 4 0 1E9
E3 1 2 3 4 1
C1 1 0 1E-15
C2 2 0 1E-15
C3 1 2 1E-15
.ENDS

.SUBCKT FEMT 1 2 PARAMS: NLFF = 0.1 FLWF = 0.001 NVRF = 0.1
.PARAM GLFF={PWR(FLWF,0.25)*NLFF/1164}
.PARAM RNVF={1.184*PWR(NVRF,2)}
.MODEL DVNF D KF={PWR(FLWF,0.5)/1E11} IS=1.0E-16
I1 0 7 10E-3
I2 0 8 10E-3
D1 7 0 DVNF
D2 8 0 DVNF
E1 3 6 7 8 {GLFF}
R1 3 0 1E9
R2 3 0 1E9
R3 3 6 1E9
E2 6 4 5 0 10
R4 5 0 {RNVF}
R5 5 0 {RNVF}
R6 3 4 1E9
R7 4 0 1E9
G1 1 2 3 4 1E-6
C1 1 0 1E-15
C2 2 0 1E-15
C3 1 2 1E-15
.ENDS

.SUBCKT PSRR_SINGLE VDD VSS VI VO GNDF PARAMS: PSRR = 130 FPSRR = 1.6
.PARAM PI = 3.141592
.PARAM RPSRR = 1
.PARAM GPSRR = {PWR(10,-PSRR/20)/RPSRR}
.PARAM LPSRR = {RPSRR/(2*PI*FPSRR)}
G1 GNDF 1 VDD VSS {GPSRR}
R1 1 2 {RPSRR}
L1 2 GNDF {LPSRR}
E1 VO VI 1 GNDF 1
C2 VDD VSS 10P
.ENDS

.SUBCKT PSRR_SINGLE_NEW VDD VSS VI VO GNDF PARAMS: PSRR = 130 FPSRR = 1.6
.PARAM PI = 3.141592
.PARAM RPSRR = 1
.PARAM GPSRR = {PWR(10,-PSRR/20)/RPSRR}
.PARAM LPSRR = {RPSRR/(2*PI*FPSRR)}
G1 GNDF 1 VDD VSS {GPSRR}
R1 1 2 {RPSRR}
L1 2 GNDF {LPSRR}

EA 101 GNDF 1 GNDF 1
GRA 101 102 VALUE = { V(101,102)/1e6 }
*ADD to fix floating node error
RA 102 GNDF 1e12
CA 102 GNDF 1e3
EB 1 1a VALUE = {V(102,GNDF)}

E1 VO VI 1a GNDF 1
C2 VDD VSS 10P
.ENDS

.SUBCKT PSRR_DUAL VDD VSS VI VO GNDF
+ PARAMS: PSRRP = 130 FPSRRP = 1.6
+ PSRRN = 130 FPSRRN = 1.6
.PARAM PI = 3.141592
.PARAM RPSRRP = 1
.PARAM GPSRRP = {PWR(10,-PSRRP/20)/RPSRRP}
.PARAM LPSRRP = {RPSRRP/(2*PI*FPSRRP)}
.PARAM RPSRRN = 1
.PARAM GPSRRN = {PWR(10,-PSRRN/20)/RPSRRN}
.PARAM LPSRRN = {RPSRRN/(2*PI*FPSRRN)}
G1 GNDF 1 VDD GNDF {GPSRRP}
R1 1 2 {RPSRRP}
L1 2 GNDF {LPSRRP}

G2 GNDF 3 VSS GNDF {GPSRRN}
R2 3 4 {RPSRRN}
L2 4 GNDF {LPSRRN}

E1 VO VI VALUE = {V(1,GNDF) + V(3,GNDF)}
C3 VDD VSS 10P
.ENDS

.SUBCKT PSRR_DUAL_NEW VDD VSS VI VO GNDF
+ PARAMS: PSRRP = 130 FPSRRP = 1.6
+ PSRRN = 130 FPSRRN = 1.6
.PARAM PI = 3.141592
.PARAM RPSRRP = 1
.PARAM GPSRRP = {PWR(10,-PSRRP/20)/RPSRRP}
.PARAM LPSRRP = {RPSRRP/(2*PI*FPSRRP)}
.PARAM RPSRRN = 1
.PARAM GPSRRN = {PWR(10,-PSRRN/20)/RPSRRN}
.PARAM LPSRRN = {RPSRRN/(2*PI*FPSRRN)}

G1 GNDF 1 VDD GNDF {GPSRRP}
R1 1 2 {RPSRRP}
L1 2 GNDF {LPSRRP}

EA 101 GNDF 1 GNDF 1
GRA 101 102 VALUE = { V(101,102)/1e6 }
*ADD to fix floating node error
RA 102 GNDF 1e12
CA 102 GNDF 1e3
EB 1 1a VALUE = {V(102,GNDF)}

G2 GNDF 3 VSS GNDF {GPSRRN}
R2 3 4 {RPSRRN}
L2 4 GNDF {LPSRRN}

EC 301 GNDF 3 GNDF 1
GRC 301 302 VALUE = { V(301,302)/1e6 }
*add to fix floating node error
RC 302 GNDF 1e12
CC 302 GNDF 1e3
ED 3 3a VALUE = {V(302,GNDF)}

E1 VO VI VALUE = {V(1a,GNDF) + V(3a,GNDF)}
C3 VDD VSS 10P
.ENDS

.SUBCKT CMRR_OLD VI VO VX GNDF PARAMS: CMRR = 130 FCMRR = 1.6K
.PARAM PI = 3.141592
.PARAM RCMRR = 1
.PARAM GCMRR = {PWR(10,-CMRR/20)/RCMRR}
.PARAM LCMRR = {RCMRR/(2*PI*FCMRR)}
G1 GNDF 1 VX GNDF {GCMRR}
R1 1 2 {RCMRR}
L1 2 GNDF {LCMRR}
E1 VI VO 1 GNDF 1
.ENDS

.SUBCKT CMRR_NEW VI VO VX GNDF PARAMS: CMRR = 130 FCMRR = 1.6K
.PARAM PI = 3.141592
.PARAM RCMRR = 1
.PARAM GCMRR = {PWR(10,-CMRR/20)/RCMRR}
.PARAM LCMRR = {RCMRR/(2*PI*FCMRR)}
G1 GNDF 1 VX GNDF {GCMRR}
R1 1 2 {RCMRR}
L1 2 GNDF {LCMRR}

EA 101 GNDF 1 GNDF 1
GRA 101 102 VALUE = {V(101,102)/1e6}
*ADD to fix floating node error
RA 102 GNDF 1e12
CA 102 GNDF 1e3
EB 1 1a VALUE = {V(102,GNDF)}

E1 VI VO 1a GNDF 1
.ENDS

.SUBCKT DLS 1 2 VDD_OLD VSS_OLD VDD_NEW VSS_NEW
E1 3 0 VALUE = { IF( V(1) < (V(VDD_OLD)+V(VSS_OLD))/2, V(VSS_NEW), V(VDD_NEW) ) }
R1 3 2 1
C1 2 0 1p
.ENDS

.SUBCKT DLSINV 1 2 VDD_OLD VSS_OLD VDD_NEW VSS_NEW
E1 3 0 VALUE = { IF( V(1) > (V(VDD_OLD)+V(VSS_OLD))/2, V(VSS_NEW), V(VDD_NEW) ) }
R1 3 2 1
C1 2 0 1p
.ENDS

.SUBCKT SWITCH_IDEAL A B C PARAMS:
+ Ron = 100m
+ Roff = 0.1G

G1 A B VALUE = { V(A,B) * 1 / ( Roff/2 * TANH( 0 - ( 20*V(C) - 5 ) ) + Roff/2 + Ron ) }
R1 A 0 1000G
R2 B 0 1000G
.ENDS

.MODEL VINRANGE_DIDEAL D N=1m
.MODEL RECOVERYCIRCUIT_DIDEAL D N=1m

.MODEL OUTPUTCIR_ISC_DIDEAL D N=0.1m
.MODEL OUTPUTCIR_VOHVOL_DIDEAL D N=1m
.MODEL DBASIC D

  • Hi Jason,

    Thanks for showing a fix to make the model in LTspice match characteristics of the TINA-TI model. 

    TI's models are designed for use in Pspice and TINA-TI (the simulators we use at TI), but are not necessarily released to be 'drop-in' models for LTspice.  As LTspice is software originally produced by Linear Technologies, we are not able to debug or advise using TI models in LTspice. However, we are able to support sharing resources which could assist with using TI models in generic spice software, whether it be Pspice or not. 

    If you have any other questions or issues arise as you continue, please reach out and I will help support as best I can.

    Thanks,

    Nick