I'm brand new to the Arduino community, and most of my projects prior have been for fun (making an LED blink, a buzzer, etcetera) and I'm starting my first "real" project.
I'm hoping to use an Arduino to timestamp pulses and transmit them via serial to a computer. The problem is that the timestamps need to be as precise as possible -- utilizing the full speed of the clock to achieve 63 ns resolution would be ideal. I'd like to do better than micros() can afford me.
The pulses come in the form of a 6V square wave that lasts 500 ns (from what I've read, 6 V will actually fry the input pins .. so I'll handle that, too). I'd like to be able to handle count rates up to 100,000 per second.
The final hiccup is that I'd like to log these pulses as being "ON" when another, separate pin is high, and "OFF" when that same other pin is low (I'm looking at the correlation between two signals); this pin will see a square wave of 5V that lasts around 4 milliseconds in the on cycle, and the same in the off cycle.
Proposed Solution (pending your vicious critique):
I got my hands on a copy of the Arduino cookbook, and in Chapter 18, the author talks about using hardware timing at length.
Example 18.7 is pretty damn applicable to what I'm after, I think-- the author sets Timer1 to clock on the rising edges of an input pulse (1,1,1 for CS12 / CS11 / CS10), and then resets & polls the counter every second, and transmits at 9600 baud the total count accumulated in each second using delay(1000).
Can this be adapted to far higher speeds? Say -- to transmit the count each microsecond?
This isn't exactly what I want, but I could still work with it-- ideally, I'm after just the timestamp being broadcasted itself (since the pulses are essentially indistinguishable). Thoughts here?
Thanks in advance,