Importing LM13700.sub causes problems

I have a LM13700 subcircuit file that runs well in LTSPICE. I copy&pasted it to QSPICE to autogenerate a symbol. I added some basic power supply, signal input and some components to run a .tran analysis.
Problem : Although I’ve placed a “.tran 5m” command, QSPICE says it’s missing it.
Obviously QSPICE has a problem with this subcircuit:
.SUBCKT LM13700 LIN INP INN IAB OUT VCC VSS BIN BUF
QN1 IAB VN2B VSS npnv 3
QN2 VN2B VN2B VSS npnv 3
QN3 VN3C IAB VN2B npnv 3
QN4 VP3B INN VN3C npnv 3
QN5 VP6B INP VN3C npnv 3
QN6 LIN LIN INN npnv 3
QN7 LIN LIN INP npnv 3
QN8 VN10B VN9B VSS npnv 3
QN9 VN9B VN9B VSS npnv 3
QN10 OUT VN10B VN9B npnv 3
QN11 VCC BIN VN12B npnv 15
QN12 VN12B VN12B BUF npnv 3
QN13 VCC VN12B BUF npnv 150
QP1 VP3B VP2B VCC pnpl 3
QP2 VP2B VP2B VCC pnpl 3
QP3 VN10B VP3B VP2B pnpl 3
QP4 VP6B VP5B VCC pnpl 3
QP5 VP5B VP5B VCC pnpl 3
QP6 OUT VP6B VP5B pnpl 3
.ends

.MODEL npnv NPN(
*==========================================================
+IS=1.1E-18 NF=1.005 BF=220 VAF=130 IKF=5e-03
+ISE=9.15E-15 NE=2
*==========================================================
+CJE=2E-12 CJC=2E-13 CJS=3E-12 TF=.6E-9 )

.MODEL pnpl PNP(
*==========================================================
+IS=1.1E-18 NF=1.8 BF=5 VAF=170 IKF=6e-03
+ISE=3E-15 NE=3
*==========================================================
+CJE=4E-12 CJC=6E-13 CJS=5E-12 TF=70E-9 )

.end
LM13700test1.qsch (6.5 KB)

Copy and Paste a netlist into forum message, please read this
Qspice Forum - New User to Basic User (File Upload) - QSPICE - Qorvo Tech Forum

LM13700-Correct.qsch (6.4 KB)

Your .subckt has a syntax issue with double .ends; I’m not sure how that occurred. Here is the correct syntax to use and run with the transient analysis. Have you checked your LTspice netlist to see if the .subckt you used has an extra .ends?

.SUBCKT LM13700 LIN INP INN IAB OUT VCC VSS BIN BUF
QN1 IAB VN2B VSS npnv 3
QN2 VN2B VN2B VSS npnv 3
QN3 VN3C IAB VN2B npnv 3
QN4 VP3B INN VN3C npnv 3
QN5 VP6B INP VN3C npnv 3
QN6 LIN LIN INN npnv 3
QN7 LIN LIN INP npnv 3
QN8 VN10B VN9B VSS npnv 3
QN9 VN9B VN9B VSS npnv 3
QN10 OUT VN10B VN9B npnv 3
QN11 VCC BIN VN12B npnv 15
QN12 VN12B VN12B BUF npnv 3
QN13 VCC VN12B BUF npnv 150
QP1 VP3B VP2B VCC pnpl 3
QP2 VP2B VP2B VCC pnpl 3
QP3 VN10B VP3B VP2B pnpl 3
QP4 VP6B VP5B VCC pnpl 3
QP5 VP5B VP5B VCC pnpl 3
QP6 OUT VP6B VP5B pnpl 3
.MODEL npnv NPN( IS=1.1E-18 NF=1.005 BF=220 VAF=130 IKF=5e-03 ISE=9.15E-15 NE=2 CJE=2E-12 CJC=2E-13 CJS=3E-12 TF=.6E-9 )
.MODEL pnpl PNP( IS=1.1E-18 NF=1.8 BF=5 VAF=170 IKF=6e-03 ISE=3E-15 NE=3 CJE=4E-12 CJC=6E-13 CJS=5E-12 TF=70E-9 )
.ends
1 Like

thanks for the hint !

thanks a lot, KSKelvin. This model is from Don Sauer, one of the LM13700 designers. Unfortunately his homepage is down. The LM13700 is available here, with the .end and ends. statements

Okay, your observation is indeed accurate. LTspice (and also Qspice) can actually read the .sub file (rename to .lib for forum upload) from the link you provided, with using .lib directive instead of embedded subckt into the symbol.

But if you copy and paste and auto-generate a symbol directly without any modifications, you will encounter an error because the auto-generated content includes .end in it. This error is specific to Qspice because only Qspice offers this embedded subcircuit feature for symbols.

It is uncommon to write a subcircuit in this manner, as the .model should typically be written into the .subckt.

LM13700-deanm1278.qsch (5.7 KB)
lm13700-deanm1278.lib (1.4 KB)

1 Like

Original website has been archived.
web.archive.org/web/20200201135238/http://www.idea2ic.com/LM13600/SpiceSubcircuit/LM13700_SpiceModel.html

I created a symbol and replicated the circuit in the archived website. It netlist included a R5 between OUT and BIN but not shown in circuit diagram, and therefore, this example with this R5 included.
This example and symbol can be download from this Github link
Qspice/Symbols-KSKelvin/community/idea2ic · KSKelvin-Github/Qspice

1 Like