On Wed, Apr 9, 2014 at 1:04 PM, Tom Harris <[email protected]> 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. -- Chris Albertson Redondo Beach, California _______________________________________________ time-nuts mailing list -- [email protected] To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts and follow the instructions there.
