Simulation not working

I hope this message find you well. I am new to fritzing and trying to make the knight rider circuit for which need to make astable 555 timer. but program outputs this error
The simulator gave an error when loading the netlist. Probably some SPICE field is wrong, please, check them.
If the parts are from the simulation bin, report the bug in GitHub.

Errors:
stdout Note: No compatibility mode selected!
stdout Circuit: simulator netlist
stderr Error on line 2 or its substitute:
stderr c1 0 3 100 n ic=0
stderr unknown parameter (n)

Netlist:
Simulator Netlist
C1 0 3 100 n IC=0
R5 3 1 1k
XU2 2 5 7 8 2 1 3 0 UA555
R2 4 5 5.6k
C3 0 2 10u IC=0
R6A 1 2 {50/10050k}
R6B 6 2 {50k-50/100
50k}
DLED1 4 0 LED_GENERIC
VCC1 3_VCC1_aux 0 DC 9V
RVCC1 3_VCC1_aux 3 0.1

.SUBCKT UA555 32 30 19 23 33 1 21 999
* TR O R F TH D V GND
*
* Taken from ngspice examples: ngspice/examples/p-to-n-examples/555-timer-2.cir at master · imr/ngspice · GitHub and modified to include the ground. And this model has been…
* Taken from the Fairchild data book (1982) page 9-3
*SYM=UA555
*DWG=C:\SPICE\555\UA555.DWG
Q4 25 2 3 QP
Q5 999 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 999 32 11 QP
Q15 14 18 13 QP
R5 14 999 100K
R6 22 999 100K
R7 17 999 10K
Q16 1 15 999 QN
Q17 15 19 31 QP
R8 18 23 5K
R9 18 999 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 999 QN
Q21 25 22 999 QN
Q22 27 24 999 QN
R12 25 27 4.7K
R13 21 29 6.8K
Q23 21 29 28 QN
Q24 29 27 16 QN
Q25 30 26 999 QN
Q26 21 28 30 QN
D2 30 29 DA
R14 16 15 100
R15 16 26 220
R16 16 999 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

*Typ RED,GREEN,YELLOW,AMBER GaAs LED: Vf=2.1V Vr=4V If=40mA trr=3uS
.MODEL LED_GENERIC D (IS=93.1P RS=42M N=4.61 BV=9 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U)

.option savecurrents
.option interp
.OP
*.TRAN 1ms 100ms

Your best bet is to upload the sketch (the .fzz file, upload is 7th icon from the left in the reply menu) so someone that can help (likely @fai) can give you an answer.

Peter

type or paste code here

knightrider.fzz (38.5 KB)

have i posted the sketch properly

Yes, for me it just hangs Fritzing when simulated but the sketch loads correctly, I expect @fai (who wrote the simulator) will be the one to figure out what is wrong.

Peter

thankyou
i have one more question i have seen you replying to hundreds of question on the forum how do you do that?

I have been using Fritzing since 2016 and I am retired (and old!) so I have a lot of experience and more importantly time to do what I please.

Peter

I do not have my computer not to test, but it seems that the problem is related to the capacitor (there is a space between 100 and n). Could you tell to replace the capacitor with a different one?
In addition, you need to run Fritzing in debug mode and use the transitory simulation. See other posts in the forum simulating a 555.

I think one problem is likely your resistor value on the LED is too high. As it stands at 9V it will only put about 1ma through the LED and LEDs typically need 10 to 20 ma to light, About a 1K resistor should get you to 10ma.

That said I still can’t get simulation to work even in debug mode with transient selected (you need to start Fritzing with the -d flag to enable debug mode then select the transient mode (greyed out here because debug isn’t active)

in order to get transient mode. Success, the problem isn’t the cap but rather the pot. Its spice model must be incorrect. Replacing it with the one from core parts makes this all work this sketch (run in transient mode under debug) blinks the LED as expected. Note I also reduced the resistor to 1K I don’t know whether 5k6 would work differently (the led may not get enough current to light I expect.)

knightrider-newcap.fzz (40.7 KB)

Peter

could you show how it works does blink or not or should I use oscilloscope ?

I don’t have a way to make a video (and couldn’t upload it any way) but if you try the sketch I uploaded with Fritzing in debug mode and select transient mode you should see the LED blink at a fairly fast rate for the 10 seconds of the simulation. When you get that working you may want to change the series resistor back to 5k6 and see if the simulation still works.

Peter

I don’t want to keep bothering you but can you please if you may share me how you get the transient mode working i don’t understand where the terminal is it the windows terminal or does fritzing software has one? please share the commands used thankyou
Durgesh

OK here is the sequence I used (my DOS window path setting is obviously broken so I had to change to the Fritzing directory to start Fritzing) Open a DOS command window (AKA the terminal) then launch Fritzing with the -d flag (there probably is a way to specify the .fzz file too but I was too lazy to find it.) That will launch Fritzing:

when Fritzing starts File->Open and navigate to where the .fzz file is and double click on it to load it.

then click on the arrow in the simulate tab and select transient mode

click on simulate and you will get this message, click OK

and the simulation should start

and blink the LED.

Peter

1 Like

Thankyou very much i wouldn’t be happier best of luck to ya see ya

Durgesh

I had a look at the original file. There were two errors as @vanepp reported.

The first one in the capacitor C1. There is a space between 100 and n (“100 n”). That space confuses ngspice. But I am not sure how you managed to do that. I tried to add the space in a capacitor using the inspector and adding spaces is not allowed there.

The second issue is that potentiometer. The spice field seems ok, but that part needs two extra properties: the “knob status” a “max resistance”. Check other potentiomenters. I could not find that pot in the core parts. Let me know if it is a part that comes with Fritzing. If so, I will fix it.

No. It is in the temp parts bin for the sketch so is from the net somewhere. No apparent errors in core parts.

Peter

1 Like