Page 1 of 1

Source for Oscillation errors

Posted: Mon May 18, 2015 1:08 am
by dark32
Hey Forum,
First of all, I am new to electronics. I've designed a computer and while debugging it I ran into an oscillation error :o . I couldn't find the source (the project is huge) of the error and that is very irritating :x . Thus, I wanted feature that could tell what is the source of the error. It should at least specify in which circuit it has took place. I know how much it takes to edit the code than write code because I am a programmer myself. Anyway, if there is some other way to find out the source of the error then please tell me. Thanks in advance :) .

Re: Source for Oscillation errors

Posted: Mon May 18, 2015 10:36 am
by admin
When you building a huge project it is usually good idea to test different components separately, before trying them out together.
If this testing will not reveal the source of problem you can share your circuit here, so I or someone else will give it a try.

Re: Source for Oscillation errors

Posted: Mon May 18, 2015 8:15 pm
by dark32
Thanks for replying admin, I've tested most of the circuits individually and found another problem, the RAM doesn't write. I think it must be because of the fact that it writes on the rising edge of the clock while all my other components write when the clock is high. Oscillation error still occurs, I've included the logic circuit
Computer.CircuitProject
The Computer
(633.68 KiB) Downloaded 669 times
and you have to do the following for the error:
1. Set RAM values as:
Address Value
000 Random(not zero)
001 Random(not zero)
002 Random(not zero)
100 01
101 12
102 2E
2. Press the RSET button
3. Keeping turning the CLK button on and off

It will throw an oscillation error after about 40 clicks.
I am new to electronics and still in high school, as they don't happen to give electronics courses so I learn by myself.
Also, it would also be great if you can help with the RAM. I want it to write when clock is high instead of it rising from 0 to 1. I think that is what most RAM chips do.
Almost forgot to say, you've made a great piece of code! Keep up the good work Eugene.

Re: Source for Oscillation errors

Posted: Tue May 19, 2015 9:46 pm
by admin
I have looked at your computer. It is quite complicated and will take a lot of time for to figure out where the problem is. For you it will be much faster as only you know all the idea behind your design. I still think you need to build a few test circuits and check how all the parts work before you can find what is wrong with main circuit. Another suggestion is to try making simpler circuits it is very hard to follow logic in the web of wires. If you break it to smaller pieces, it will be easier to understand and debug. I am usually trying to keep circuit entirely visible on the screen in 100% zoom. For that matter it helpful to bundle wires. For example in your ALU instead of having A1-A8 you just have one pin A of 8 bit wide. To see some examples you can download sample circuits. There is a 16 bits computer there so you can see how to minimize your design.
As for your suggestion to point to where the oscillation occurred it is usually impossible to do as the oscillation can float around and so there is no any single point of failure.

Re: Source for Oscillation errors

Posted: Wed May 20, 2015 6:35 pm
by dark32
Hello again,
Thanks for replying admin.
The oscillation error disappeared by adding a register in the RAM input pin for reasons I don't know. But I encountered another error in the machine. I think it is more related to the software. One of the flip-flops of the program counter flips without the clock input. I've tried and tested them with probes.
You might want to see what is happening in the circuit yourself. This error only occurs when you set the ram address 100(10 row; 0 column) to 07. Push the reset button then keep clicking the clock button 12 times. As said earlier, the flip-flop flips without clock input. You can trace back the input from the program counter to the control matrix (to the Ce output). You'll shall see a 6 input AND gate which might be causing the problem. I've attached probes:
CLK is the clock input of the flip flop
Q is the output of the flip-flop
C6 is the input of the control matrix, when it goes high the flip-flop also goes high.
JKin the are the J-K input of the flip flop which are connected.
The circuit is a bit complicated, but it is my first circuit in this program. If you have any question regarding it please be free to PM me. I'll try to reply as soon as I can.

~Thanks,
dark32

Re: Source for Oscillation errors

Posted: Wed May 20, 2015 11:05 pm
by admin
I guess the problem with your flip-flops is they are clocked by level, not by front. I would suggest making all of them working by rear front, as they are much more stable. For example, you can build master-slave JK flip-flop and use it as a base implement all other flip flops you need.

Re: Source for Oscillation errors

Posted: Thu May 21, 2015 12:02 am
by dark32
Sorry Eugene. I don't think I can understand you :( . Can you please show me a circuit example.

Re: Source for Oscillation errors

Posted: Thu May 21, 2015 8:35 am
by admin
Sure, download the samples circuits. Open any of them and look at JK flip-flop. They are master-slave synchronized and so working when clock is failing from 1 to 0.
Here you can read a bit more details: http://www.circuitstoday.com/triggering-of-flip-flops
http://www.electronics-tutorials.ws/seq ... seq_2.html
https://tams-www.informatik.uni-hamburg ... /jkff.html