[time-nuts] [Solved] Looking for multiple PPS timestamp logging
Hal Murray
hmurray at megapathdsl.net
Mon Oct 3 18:59:21 UTC 2011
> I was thinking about the parallel port polling idea, but then my son wanted
> to measure the relation between temperature and XO frequency, so we needed
> microsecond resolution.
Why do you need microsecond resolution?
A junk XO will drift ballpark of 1 PPM per C. That's 86 ms per day or 3.6 ms
per hour.
What sort of resolution do you think you can get from a parallel port?
It might be fun to see how far you can push the parallel port.
How about a loop like this:
Initialization:
grab old time
grab old parallel port data
loop:
grab new time
grab new parallel port data
if data changed:
grab newer time
log change that happened somewhere between old time and newer time
old time = new time
old data = new data
goto loop
Post processing can filter out the occasional samples with a wide time window
because the scheduler ran some other job at the wrong time.
For extra credit... Suppose you are expecting PPS type signals and you know
roughly where they are located within a second. There is no point is
spinning when you aren't expecting something to happen. So you can sleep
until a bit before the next event. That will let the scheduler run other
jobs. Hopefully it will be nicer to you when you do want to run.
--
These are my opinions, not necessarily my employer's. I hate spam.
More information about the time-nuts
mailing list