Measuring RF Time of Flight:
I would like to create a Time of Flight system with two RF log ICs that each output a pulse when an RF input is detected (5ns response time from each ICs)
I have a dream that a 600Mhz Teensy 4.0 might be able to resolve or measure time intervals down to 1/600,000,000, or 1.7ns per clock cycle.
I pray that there is some way to query the clock cycles elapsed between two rising or falling edge logic or analog inputs on a Teensy 4.0 and calculate the time of difference between a pulsed input on a first pin versus pulsed input on a second pin in nanoseconds, hopefully without stopping the counter. This is essentially a poor man's Time Interval Counter (TIC).
A few questions for the PJRC crew:
1) Is there an easy way to implement something like nanos() that is similar to millis() with nanosecond precision?
2) Does a timer exist in the ARM M7 that counts each clock cycle and which can be read out or buffered and later read out?
3) For the fastest measurements speed on an input pin, are interrupts the way to go or just use DigitalReadFast in a very short loop()?
4) In the Teensy 3.5 forum, Frank B mentioned using " cyclecounter, DWT_CYCCNT" to count clock cycles, is this more efficient?
5) To know the absolute time or arrival, is there an easy way to synch or reset the internal Teensy 4.0 clock to an external one pulse per second (PPS) input from a GPS?
Thanks,
-Jerry
I would like to create a Time of Flight system with two RF log ICs that each output a pulse when an RF input is detected (5ns response time from each ICs)
I have a dream that a 600Mhz Teensy 4.0 might be able to resolve or measure time intervals down to 1/600,000,000, or 1.7ns per clock cycle.
I pray that there is some way to query the clock cycles elapsed between two rising or falling edge logic or analog inputs on a Teensy 4.0 and calculate the time of difference between a pulsed input on a first pin versus pulsed input on a second pin in nanoseconds, hopefully without stopping the counter. This is essentially a poor man's Time Interval Counter (TIC).
A few questions for the PJRC crew:
1) Is there an easy way to implement something like nanos() that is similar to millis() with nanosecond precision?
2) Does a timer exist in the ARM M7 that counts each clock cycle and which can be read out or buffered and later read out?
3) For the fastest measurements speed on an input pin, are interrupts the way to go or just use DigitalReadFast in a very short loop()?
4) In the Teensy 3.5 forum, Frank B mentioned using " cyclecounter, DWT_CYCCNT" to count clock cycles, is this more efficient?
5) To know the absolute time or arrival, is there an easy way to synch or reset the internal Teensy 4.0 clock to an external one pulse per second (PPS) input from a GPS?
Thanks,
-Jerry