Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Spice and 555 Timer?

Status
Not open for further replies.

GrayFox

New Member
Hi,

I am fairly new to electronics and Spice. I have a "command line" version of Spice and would like to study the "555" timer in a Spice environment.

Any hints/examples on how to do this would be appreciated. Changing to a "nice" graphical version of Spice ( say PSpice ) is not an option.

--Jerry
 
crust said:
You can find 555 models for spice readily available. I believe I have one if you cant find one elsewhere.

I found one...but it croaks in my spice 3f5 r6 simulator...

I will PM my email or you can post here.

--Jerry
 
Here is the model that I use, it works fine in my spice (also command line). Note that you might have to adjust line breaks as a result of the posting.

(I noticed that it seemed that some of the lines where missing, probably because of the way I copied it. It is now corrected).

Code:
.
.SUBCKT UA555  34 32 30 19 23 33 1  21
*              G  TR O  R  F  TH D  V
Q4 25 2 3 QP
Q5 34 6 3 QP
Q6 6 6 8 QP
R1 9 21 4.7K
R2 3 21 830
R3 8 21 4.7K
Q7 2 33 5 QN
Q8 2 5 17 QN
Q9 6 4 17 QN
Q10 6 23 4 QN
Q11 12 20 10 QP
R4 10 21 1K
Q12 22 11 12 QP
Q13 14 13 12 QP
Q14 34 32 11 QP
Q15 14 18 13 QP
R5 14 34 100K
R6 22 34 100K
R7 17 34 10K
Q16 1 15 34 QN
Q17 15 19 31 QP
R8 18 23 5K
R9 18 34 5K
R10 21 23 5K
Q18 27 20 21 QP
Q19 20 20 21 QP
R11 20 31 5K
D1 31 24 DA
Q20 24 25 34 QN
Q21 25 22 34 QN
Q22 27 24 34 QN
R12 25 27 4.7K
R13 21 29 6.8K
Q23 21 29 28 QN
Q24 29 27 16 QN
Q25 30 26 34 QN
Q26 21 28 30 QN
D2 30 29 DA
R14 16 15 100
R15 16 26 220
R16 16 34 4.7K
R17 28 30 3.9K
Q3 2 2 9 QP
.MODEL DA D (RS=40 IS=1.0E-14 CJO=1PF)
.MODEL QP PNP (level=1 BF=20 BR=0.02 RC=4 RB=25 IS=1.0E-14 VA=50 NE=2)
+ CJE=12.4P VJE=1.1 MJE=.5 CJC=4.02P VJC=.3 MJC=.3 TF=229P TR=159N)
.MODEL QN NPN (level=1 IS=5.07F NF=1 BF=100 VAF=161 IKF=30M ISE=3.9P NE=2
+ BR=4 NR=1 VAR=16 IKR=45M RE=1.03 RB=4.12 RC=.412 XTB=1.5
+ CJE=12.4P VJE=1.1 MJE=.5 CJC=4.02P VJC=.3 MJC=.3 TF=229P TR=959P)
.ENDS
 
Thanks,

One last favor... would you have an elementary example that I can test the rascal with :)

( and the expected output ).


--Jerry
 
Code:
.SUBCKT UA555  34 32 30 19 23 33 1  21 
*              G  TR O  R  F  TH D  V

Hmmm, there does not seem to be any reference to "node" 33 in the definition of the subcircuit...

Jerry
 
Maybe this will help...

Code:
.SUBCKT UA555  32 30 19 23 33 1  21 
*              TR O  R  F  TH D  V  
*
* Taken from the Fairchild data book (1982) page 9-3
*SYM=UA555
*DWG=C:\SPICE\555\UA555.DWG
Q4 25 2 3 QP
Q5 0 6 3 QP
Q6 6 6 8 QP
R1 9 21 4.7K
R2 3 21 830
R3 8 21 4.7K
Q7 2 33 5 QN
Q8 2 5 17 QN
Q9 6 4 17 QN
Q10 6 23 4 QN
Q11 12 20 10 QP
R4 10 21 1K
Q12 22 11 12 QP
Q13 14 13 12 QP
Q14 0 32 11 QP
Q15 14 18 13 QP
R5 14 0 100K
R6 22 0 100K
R7 17 0 10K
Q16 1 15 0 QN
Q17 15 19 31 QP
R8 18 23 5K
R9 18 0 5K
R10 21 23 5K
Q18 27 20 21 QP
Q19 20 20 21 QP
R11 20 31 5K
D1 31 24 DA
Q20 24 25 0 QN
Q21 25 22 0 QN
Q22 27 24 0 QN
R12 25 27 4.7K
R13 21 29 6.8K
Q23 21 29 28 QN
Q24 29 27 16 QN
Q25 30 26 0 QN
Q26 21 28 30 QN
D2 30 29 DA
R14 16 15 100
R15 16 26 220
R16 16 0 4.7K
R17 28 30 3.9K
Q3 2 2 9 QP
.MODEL DA D (RS=40 IS=1.0E-14 CJO=1PF)
.MODEL QP PNP (BF=20 BR=0.02 RC=4 RB=25 IS=1.0E-14 VA=50 NE=2)  
+ CJE=12.4P VJE=1.1 MJE=.5 CJC=4.02P VJC=.3 MJC=.3 TF=229P TR=159N)
.MODEL QN NPN (IS=5.07F NF=1 BF=100 VAF=161 IKF=30M ISE=3.9P NE=2       
+ BR=4 NR=1 VAR=16 IKR=45M RE=1.03 RB=4.12 RC=.412 XTB=1.5      
+ CJE=12.4P VJE=1.1 MJE=.5 CJC=4.02P VJC=.3 MJC=.3 TF=229P TR=959P)
.ENDS
**********
* Sample Test Circuit for the LM555 Timer: Astable Mode
* The LM555 timer model is designed for low frequency 
* applications, up to 100Hz. 
*INCLUDE IC.LIB
.TRAN 1MS 100MS 0 25US UIC
.OPTIONS LIMPTS=5001 ITL5=0 RELTOL=.0001
*ALIAS  V(1)=VOUT
*ALIAS  V(5)=VRESET
*ALIAS  V(6)=VCTRL
*ALIAS  V(4)=VCAP
.PRINT TRAN  V(1)  V(5)  V(6)  V(4) 
V2 2 0 PULSE 0 5
R3 2 3 1000
R4 3 4 5000
C3 4 0 .001M
X2 4 1 5 6 4 3 2 LM555 
.END
**********
* From Texas Intruments
* TLC555 TIMER MACROMODEL *
* 4/1/92 *
*  
.SUBCKT TLC555 1 2 3 4 5 6 7 8
* Node Connection
*  COMMON
*  |  TRIGGER
*  |  |  OUTPUT
*  |  |  |  RESET
*  |  |  |  |  CONTROL
*  |  |  |  |  |  THRESHOLD
*  |  |  |  |  |  |  DISCHARGE
*  |  |  |  |  |  |  | VDD
*  |  |  |  |  |  |  | |
*  1  2  3  4  5  6  7 8
EREF 15 1 8 1 .5
GSOURCE 8 3 8 26 12.5E-3
GSINK 3 1 26 1 67E-3
VD1 8 27 DC .8
VD2 28 1 DC .85
VREF 30 1 DC 1.2
C1 29 1 700E-15
RREF2 30 1 100E3
RREF 15 1 100E3
ROUT 3 1 100K
R1 6 1 500E9
R2 2 1 500E9
R3 8 5 75E3
R4 5 9 75E3
R5 9 1 75E3
R6 10 11 1E3
R7 13 14 1E3
R8 8 12 150E3
R9 4 8 500E9
R10 20 19 1E3
R11 16 17 1E3
R12 8 18 150E3
R13 8 21 150E3
R14 22 23 1E3
R15 8 26 150E3
R16 24 25 1E3
R19 7 1 500E9
R20 29 26 1E6
D1 1 11 DMOD
D2 12 11 DMOD
D3 12 14 DMOD
D4 1 14 DMOD
D5 18 17 DMOD
D6 1 17 DMOD
D7 18 19 DMOD
D8 1 19 DMOD
D9 21 14 DMOD
D10 21 25 DMOD
D11 1 23 DMOD
D12 18 23 DMOD
D13 26 25 DMOD
D14 1 25 DMOD1
D15 3 27 DMOD
D16 28 3 DMOD
E1 10 1 6 5 1000
E2 13 1 2 9 1000
E3 16 1 15 12 1000
E4 22 1 15 21 1000
E5 24 1 15 18 1000
E7 20 1 4 30 1000
M1 7 29 1 1 MOSMOD
.MODEL MOSMOD NMOS (LEVEL=1 KP=1 VTO=1 RD=5)
.MODEL DMOD D (RS=1E-6)
.MODEL DMOD1 D (RS=1E-6 IS=1E-9)
.ENDS
**********
I am very interested in the reason you can't use Spice with a GUI, including schematic capture. I use one that's totally free, no restrictions, and has a built-in NE555 model. If you are comfortable with command-line Spice, you would love it.
 
Hmmm,

It looks like there is an extraneous ")" at the end of the line in the model defintion of the PNP.

I suspect that in the "main program" the subcircuit specified should be UA555 instead of LM555.

It took me a while to figure out that the "main program" had to come before the subckt's.

I got thousands of lines of output...

Thanks, it is late here and I am going to bed....

By the way the reason I don't have a GUI is that I am running plain Spice on my Mac.

--Jerry
 
Ron H said:
I am very interested in the reason you can't use Spice with a GUI, including schematic capture. I use one that's totally free, no restrictions, and has a built-in NE555 model. If you are comfortable with command-line Spice, you would love it.

What's it called? Where can I get it?
 
fat-tony said:
What's it called? Where can I get it?

Just in case someone is interested...

Almost all of the Spice software for the mac can be located at Berk Ozer's site:

**broken link removed**

Jerry
 
fat-tony said:
Ron H said:
I am very interested in the reason you can't use Spice with a GUI, including schematic capture. I use one that's totally free, no restrictions, and has a built-in NE555 model. If you are comfortable with command-line Spice, you would love it.

What's it called? Where can I get it?
Linear Technology's SwitcherCAD III.
 
GrayFox said:
Hmmm,

It looks like there is an extraneous ")" at the end of the line in the model defintion of the PNP.
I suspect that in the "main program" the subcircuit specified should be UA555 instead of LM555.

It took me a while to figure out that the "main program" had to come before the subckt's.

I got thousands of lines of output...

Thanks, it is late here and I am going to bed....

By the way the reason I don't have a GUI is that I am running plain Spice on my Mac.

--Jerry

Hi Jerry,

Yeah, you need to delete the extra ")", and you can change either the subcircuit call or the subcircuit name. They just have to match. It's obvious that whoever posted this did not actually run it. I didn't try to use this model. I copied it from a newsgroup. Caveat emptor! :(

Isn't it ironic that you don't have a decent Spice for the computer that originated (this may not be strictly true) the GUI? Why can't you run the Pspice demo version?
 
Ron,

All of the "nice" simulators seem to have abandoned the Mac :cry:

I am thinking of trying Virtual PC, VPC is an intel simulator that can run XP and almost all of the windows software ( albeit a bit more slowly).

I don't really have any more deskspace for another CPU :lol:

--Jerry
 
I found that the Pspice demo is aparently available for the MAC. This has to be better that text-based Spice, which I haven't used for over 10 years.
 
Ron H said:
I found that the Pspice demo is aparently available for the MAC. This has to be better that text-based Spice, which I haven't used for over 10 years.

I would appreciate any pointers to the location...

One big problem is that over the last two years the Mac has moved from a proprietary OS to a Unix based OS.

There is a "Classic OS" emulator in the system but older programs do not generally fair well.

--Jerry
 
GrayFox said:
Ron H said:
I found that the Pspice demo is aparently available for the MAC. This has to be better that text-based Spice, which I haven't used for over 10 years.

I would appreciate any pointers to the location...

One big problem is that over the last two years the Mac has moved from a proprietary OS to a Unix based OS.

There is a "Classic OS" emulator in the system but older programs do not generally fair well.

--Jerry
https://www.repairfaq.org/ELE/F_Free_Spice3.html
 
Cadence16.2

This is a gr8 software, where from the Design Entry CIS (Capture), you can draw the circuit diagram and do the simulation there itself. Capture has a plugin for PSpice, so you can directly do the simulation in Capture itself. No coding and other head-aches. :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top