[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] Very basic PPS question:
From: |
Hal Murray |
Subject: |
Re: [gpsd-dev] Very basic PPS question: |
Date: |
Sat, 19 Oct 2013 21:27:07 -0700 |
address@hidden said:
> If the pulse needs to be "stretched", how is it going to capture the rising
> edge. If the pulse has to be long, then there will be lots of jitter in the
> time measurement.
I don't understand what you are trying to say.
"Stretched" means that you take a pulse that starts at T0 and lasts a short
time and turn it into one that starts at T0+ and lasts a long(er) time.
There are chips that do that. T0+ is a few ns after T0, not important on
this scale.
> It is best to have some kind of timer input capture, but failing that a
> high-priority (perhaps even non-maskable) edge interrupt on a GPIO pin that
> can store (and/or "set-to-.000") whatever counter-timer resource is being
> used for timing.
That's a different issue. If your hardware supports a counter/timer type
capture, then you can avoid the jitter in interrupt processing latency. The
delay in the interrupt processing isn't a problem, that can be corrected.
The problem is the jitter in the delay.
> It might be better to miss pulses than to recognize them very late.
Yup. The refclock corner of ntpd has a buffer of up to 64 samples. When
it's time to pass a batch of samples up to the next layer (the polling
interval), ntpd sorts that buffer and discards roughly 1/3 of the samples as
outliers, then takes the average of what's left. That works pretty well.
--
These are my opinions. I hate spam.