[time-nuts] First success with very simple, very low cost GPSDO, under $8
albertson.chris at gmail.com
Wed Apr 9 19:35:17 EDT 2014
On Wed, Apr 9, 2014 at 1:04 PM, Tom Harris <celephicus at gmail.com> wrote:
> Another point with the software is that your handler for the PPS just reads
> the counter. This gives an offset between the PPS edge and the value read,
> as your software takes time to respond to the interrupt and read the
> counter. In your code, it doesn't matter as you only have one interrupt.
Actually there are two interrupts. One is for PPS and the other is
for overflow of the 16-bit counter. This over flow happens about 76
times per seconds.
> However, if you have another interrupt enabled, this could run after the
> PPS pulse but before the handler runs, giving you a very rare jitter.
> A better way would be to use the input capture feature to read the timer
> into a capture register. Then the interrupt handler has until the next edge
> to read the capture register.
Do you know how to do this. I don't see any way to capture the timer
value other then reading it with software. The timer capture register
is 16 bits and is set atomically after each timer increment but I
don't see a way to make an external interrupt pin capture a timer.
The two interrupts do bump into each other about roughly every 100
seconds but I can detect that. I think I'll just ignore that second.
Redondo Beach, California
More information about the time-nuts