Reputation: 331
I have a nand-based ring oscillator of about 1000 gates. One of the inputs to each nand is tied to a 1, except one gate which is tied to an enable pin (when enable goes high the ring oscillator is enabled).
I loaded the design on an fpga and got the output on an oscilloscope. The frequency that I get is about 40 MHz. However, if I pull enable low and back high, the frequency changes drastically. Every enable toggle it can go from 40 MHz to 9 MHz to 30 MHz and anywhere in between. I've even tried leaving enable high all the time and just turning the board on and off, the frequency changes then too.
Any ideas on what's going on/how to fix it? Could it be that I need to add more gates to the ring to increase delay?
Thanks!
Upvotes: 3
Views: 566
Reputation: 5857
The ring oscillator is not just an oscillator. It's a delay line, propagating anything that's fed to it.
Normally it would be a front of your oscillation signal, but right now it could be the noise from the bouncing contacts of a pushbutton.
You should at least debounce the button. Otherwise the ring oscillator will spin some random sequence of pulses from the button's contacts, affecting the observed frequency in some unpredicted way.
Upvotes: 3