This is my first time posting, and first time using this forum!
Overview
I have a project that needs a fast counting / timing circuit at its core. What needs to be counted is how many times an oscillator cycles between events. Yes, this is essentially a clock, but longer-term frequency drift is not a problem. As long as the jitter is less than 1% there shouldn't be much of a problem, but certainly the less jitter the better. The faster this can run, the better, although only up to the point that cost, stability and complexity are not compromised. I hope 50-Mhz will be pretty easy to hit, and maybe even as high as 500-Mhz? I would like to keep the cost of the components under $20. This is for a cryptography project that I am undertaking on my own time and budget, and I am making a prototype. Specifically this timer circuit will be a data source for a randomnumber generator. I know enough about circuits to ask the right questions, and am looking for help doing the actual design, and especially selecting the components. If this project goes somewhere I would be happy to offer credit and recognition if that is desired.
More Details
The aim is to count the number of one set of discrete events, the oscillator cycles, in between another discrete event, which in this case is the closings of a switch. Closing the switch will cause a rising edge, plateauing at +5 volts, (or +3.3, if that is better). Nothing should happen when the switch opens again, though the counter must be ready to observe the next rising edge.
There will be an oscillator, and two counters. I'm not sure if it matters if the counters are synchronous or asynchronous, I think either would work. The counters will pass back and forth the duty of counting, while the other one enters a rest state so that its pins may be read. Each counter should be 32-bit, so probably it would make sense to have two 16-bit counters working together (the circuit would then have four 16-bit counters in total). The counters do not need to reset, they can just overflow and keep on counting up from 0. They should stop counting upon every-other rising edge so the pins can be accurately read. In this case I will be using an Arduino pull the pin states. A potential improvement would be to have just one counter circuit hooked up to the oscillator. Upon a rising edge signal, a second chip would have to capture the state of the counter and hold it until the next rising edge, where it would again poll the pin states. There has to be some kind of buffer as the Arduino will not be able to read pins at anywhere near the speed of the oscillator. I tend to think the two-counter setup would function more reliably, but that is just an educated guess. This is a best-effort circuit, there will be no minimum interval between rising edges, and there may be partial rises and partial falls. It is perfectly acceptable that the circuit malfunctions under such conditions and fail to provide an accurate count, as long as it can 'reset itself' upon detecting a clean rising edge and begin functioning well again.
There are two attached diagrams, one shows the counting sequence timing, the other is a very rough schematic.
Thanks for any help, and please let me know if more info or details will be helpful. I live near Seattle and will be in Boston Nov. 1st, in case there are any 'locals' on this board.
Overview
I have a project that needs a fast counting / timing circuit at its core. What needs to be counted is how many times an oscillator cycles between events. Yes, this is essentially a clock, but longer-term frequency drift is not a problem. As long as the jitter is less than 1% there shouldn't be much of a problem, but certainly the less jitter the better. The faster this can run, the better, although only up to the point that cost, stability and complexity are not compromised. I hope 50-Mhz will be pretty easy to hit, and maybe even as high as 500-Mhz? I would like to keep the cost of the components under $20. This is for a cryptography project that I am undertaking on my own time and budget, and I am making a prototype. Specifically this timer circuit will be a data source for a randomnumber generator. I know enough about circuits to ask the right questions, and am looking for help doing the actual design, and especially selecting the components. If this project goes somewhere I would be happy to offer credit and recognition if that is desired.
More Details
The aim is to count the number of one set of discrete events, the oscillator cycles, in between another discrete event, which in this case is the closings of a switch. Closing the switch will cause a rising edge, plateauing at +5 volts, (or +3.3, if that is better). Nothing should happen when the switch opens again, though the counter must be ready to observe the next rising edge.
There will be an oscillator, and two counters. I'm not sure if it matters if the counters are synchronous or asynchronous, I think either would work. The counters will pass back and forth the duty of counting, while the other one enters a rest state so that its pins may be read. Each counter should be 32-bit, so probably it would make sense to have two 16-bit counters working together (the circuit would then have four 16-bit counters in total). The counters do not need to reset, they can just overflow and keep on counting up from 0. They should stop counting upon every-other rising edge so the pins can be accurately read. In this case I will be using an Arduino pull the pin states. A potential improvement would be to have just one counter circuit hooked up to the oscillator. Upon a rising edge signal, a second chip would have to capture the state of the counter and hold it until the next rising edge, where it would again poll the pin states. There has to be some kind of buffer as the Arduino will not be able to read pins at anywhere near the speed of the oscillator. I tend to think the two-counter setup would function more reliably, but that is just an educated guess. This is a best-effort circuit, there will be no minimum interval between rising edges, and there may be partial rises and partial falls. It is perfectly acceptable that the circuit malfunctions under such conditions and fail to provide an accurate count, as long as it can 'reset itself' upon detecting a clean rising edge and begin functioning well again.
There are two attached diagrams, one shows the counting sequence timing, the other is a very rough schematic.


Thanks for any help, and please let me know if more info or details will be helpful. I live near Seattle and will be in Boston Nov. 1st, in case there are any 'locals' on this board.