Hi there P_Bob,
Here's a spice subckt for the Zetex chip.
If your software wont handle the "RL"
parameter in the diode models used below
(Linear Tech Version 3 for example)
use the Linear Tech Switchcad3 subckt
that follows.
Here is the first:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">.subckt ZXSC300 1 2 4 5
*06/2002 MrAl
*1 is +Vcc
*2 is ground
*4 is Isense
*5 is Vdrive
V1 12 2 5
V2 14 2 3.3
V3 13 2 0.020
D1 8 9 DS2
R1 12 8 5k
C1 8 2 350p
R2 8 7 100k
B1 6 2 v=v(12)*(v(7)>v(14))
D2 6 7 DS3
D3 5 6 DS1
B2 9 2 v=v(12)*(v(4)<v(13))
R3 1 5 10k
.MODEL DS1 D (IS=1E-12 N=1 RS=50 AF=0 RL=1500)
.MODEL DS2 D (IS=1E-12 N=1 RS=5 AF=0 RL=10MEG)
.MODEL DS3 D (IS=1E-12 N=1 RS=55K AF=0 RL=10MEG)
.ends</pre><hr /></blockquote><font size="2" face="Verdana, Arial">Switchcad 3 wont handle the RL parameters in the
diode models above, so you have to add them
to the schematic. Also, the pin numbering
was changed because it didnt like the
unusual numbering in the original model.
Here's the model what works in Switchcad 3:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">.subckt ZXSC300 1 2 3 4
*06/2002 MrAl
*1 is +Vcc
*2 is ground
*3 is Isense
*4 is Vdrive
V1 12 2 5
V2 14 2 3.3
V3 13 2 0.020
D1 8 9 DS2
R1 12 8 5k
C1 8 2 350p ic=5v
R2 8 7 100k
B1 6 2 v=v(12)*(v(7)>v(14))
D2 6 7 DS3
D3 4 6 DS1
R3 4 6 1500
B2 9 2 v=v(12)*(v(3)<v(13))
R4 1 4 10k
.MODEL DS1 D (IS=1E-12 N=1 RS=50 )
.MODEL DS2 D (IS=1E-12 N=1 RS=5 )
.MODEL DS3 D (IS=1E-12 N=1 RS=55K )
.ends</pre><hr /></blockquote><font size="2" face="Verdana, Arial">I added the parallel resistors on the schematic
drawing for the diode models DS1 to DS3.
One final note:
The linear inductors usually used to test
the full circuit in the simulation environment
will almost always produce an inductor current
that is about 2 to 3 times LOWER then the
real life current will be. Using a nonlinear
inductor model provides a much more close
approximation to the real life circuit, but
it's very difficult to get to converge.
The inductor has to change inductance by
an amount depending on what the voltage across
the inductor is.
Any other prob's just yell.
Good luck with your LED circuits,
Al