Hi Tabsoft
No, but I had a moment of inspiration. Wouldn’t even need the interrupt, but it will help.
The idea is to sync it roughly, with port.0 interrupt, then turn off ext int and the clock will be somewhere close.
Then although port.0 int is disabled, the IO pin still works... so next, increment or decrement the so called “constant value”
until the timer cycle you check port.0 straight after the interrupt and find the GPS PPS pin is high.
Then subtract as many instructions from the constant value as it took to check port.0 after the timer reload.
For 10MHz pic, that might have it down to the 400ns instruction time, but I’m not sure of that.
Bookmarks