http://qs321.pair.com?node_id=11109300


in reply to Re: The most precise second (timer)
in thread The most precise second (timer)

Agreed. Even if you, say, used an Arduino with an external crystal for triggering interrupts you will have trouble hitting the exact timing. That is, unless you spend quite a lot on a very precise, temperature controlled and calibrated timing source.

If you want really precise, reproducable timing, you probably have to put your time critical stuff in an FPGA (or even better: ASIC) and hook that up to a very, very precise timing source, both for chip clock cycles and the external triggering interrupt. There are chip scale atomic clocks and things like that available for that purpose.

To make the data logging even more time stable, you also need to make sure your time critical code path is always the same, otherwise you introduce clock cycle count jitter. That means no conditionals from the start of the interrupt to having gathered all time critical data values in memory.

...basically, the more precision you want, the more specialized engineering you have to do. This can get expensive really, really fast. And there will always be compromises involved. It's the old mantra of "good/fast/cheap - pick any two of those".

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'