Robert Baer said:
I see no way to add an arbitrary device and use X to call its use.
Not even if it happens to be a zener defined with a .SUBCKT ..
Good thing i kept my DOS version of TopSpice!
Hello Robert,
LTspice can handle subcircuits of course.
Maybe you haven't correctly setup your subcircuit or symbol.
There are in general differences between the SPICE varieties
when it comes to parameter passing to subcircuits.
LTspice is mostly compatible to PSPICE regarding parameters.
Why haven't you posted your LTspice schematic and subcircuit?
Now I have to make some guess what you have done wrong.
I have assumed that you try to use Z-diode subcircuit models
from ONSEMI. They provide two models for each Z-diode.
Prefer to use the PSPICE compatible models(.lib) and not the
SPICE3 models(.sp3) from ONSEMI, because SPICE3 has a different
syntax for the model statement of resistors. Normally you don't
have or need .model statements for resistors.
PSPICE:
RBV 6 0 MDRBV 1749.5
..MODEL MDRBV RES TC1=-0.000940267
SPICE3:
RBV 6 0 1749.5 MDRBV
..MODEL MDRBV R TC1=-0.000940267
LTspice allows you to have the tempco in the same line.
RBV 6 0 1749.5 TC1=-0.000940267
I have made an example for you with a Z-diode(4.7V) from ONSEMI.
It is defined with a subcircuit. The only important thing with
the ONSEMI library is to use the PSPICE compatible ".lib"
file and not the SPICE3(.sp3) file.
Save the attached schematic file with name "zdiode_test.asc"
and save the model file as "bzx84b4v7lt1.lib".
Please keep both files in the same directory.
I have also attached a few instructions how to change symbols
which are designed for models so that they can be used for
subcircuits. So you don't have to draw an extra symbol.
Best regards,
Helmut
------ INSTRUCTIONS FOR SUBCIRCUIT( ZENER-)DIODES ------
1. Add a diode to the schematic.
2. Move the cursor over the placed diode.
Press <Ctrl>RightMouseButton
Change Prefix D to X
OK
Now this diode expects a ".SUBCKT ..." definition, because of the X.
3. Change the value D of the diode in your schematic to bzx84b4v7lt1.
4. Place the subcircuit definition in the schematic or load it from a file.
In the ladder case add a ".include bzx84b4v7lt1.lib" to the schematic.
Save the subcircuit definition file "bzx84b4v7lt1.lib" in the same directory
where your schematic has been saved.
------------------------------------------------------------
Schematic: zdiode_test.asc
Version 4
SHEET 1 1488 1540
WIRE -240 192 -240 128
WIRE -240 320 -240 272
WIRE -160 128 -240 128
WIRE 16 128 -160 128
WIRE 160 128 96 128
WIRE 160 192 160 128
WIRE 160 320 160 256
FLAG -240 320 0
FLAG 160 320 0
FLAG -160 128 vp
FLAG 160 128 vz
SYMBOL voltage -240 176 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value PULSE(0 10 5n 5n 5n 1u 2u)
SYMBOL res 0 144 R270
WINDOW 0 32 56 VTop 0
WINDOW 3 0 56 VBottom 0
SYMATTR InstName R1
SYMATTR Value 100
SYMBOL zener 176 256 R180
WINDOW 0 -20 72 Left 0
WINDOW 3 5 -5 Right 0
SYMATTR InstName D1
SYMATTR Value bzx84b4v7lt1
SYMATTR Prefix X
TEXT -248 16 Left 0 !.tran 10u
TEXT -256 -24 Left 0 !.include bzx84b4v7lt1.lib
Model from ONSEMI: bzx84b4v7lt1.lib
..SUBCKT bzx84b4v7lt1 2 1
**************************************
* 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 Dec 11, 03
* MODEL FORMAT: PSpice
* anode cathode
*node: 2 1
* Forward Section
D1 2 1 MD1
..MODEL MD1 D IS=5.21532e-16 N=1 XTI=1 RS=0.5
+ CJO=1.3e-10 TT=1e-08
* Leakage Current
R 1 2 MDR 1e+07
..MODEL MDR RES TC1=0 TC2=0
* Breakdown
IZG 4 2 0.12
R4 4 2 2000
D3 2 4 MD3
..MODEL MD3 D IS=2.5e-12 N=2.70127 XTI=0 EG=0.1
D2 5 4 MD2
..MODEL MD2 D IS=2.5e-12 N=8.46982 XTI=0 EG=0.1
EV1 1 5 6 0 1
IBV 0 6 0.001
RBV 6 0 MDRBV 1749.5
..MODEL MDRBV RES TC1=-0.000940267
*-- PSpice DIODE MODEL DEFAULT PARAMETER
* VALUES ARE ASSUMED
*IS=1E-14 RS=0 N=1 TT=0 CJO=0
*VJ=1 M=0.5 EG=1.11 XTI=3 FC=0.5
*KF=0 AF=1 BV=inf IBV=1e-3 TNOM=27
..ENDS bzx84b4v7lt1