Michel Tremblay's recent thought provoking thread on synchronizing a PIC to within one instruction to an external clock makes me wonder if it is possible to sample an arbitrary wave form with single cycle resolution. The best I think you can do (without using external hardware) is two cycle resolution. For example, assuming that our sample is at PORTB <0> the following code will work: buffer0 EQU 0x20 ;RAM buffer buffer1 EQU buffer0+1 ;Allocate enough for all the bits . ;to be collected . . SAMPLE RRF PORTB ;Sample PortB <0> by shifting it into C RRF buffer0,F ;Save the sample in RAM RRF PORTB RRF buffer0,F RRF PORTB RRF buffer0,F RRF PORTB RRF buffer0,F RRF PORTB RRF buffer0,F RRF PORTB RRF buffer0,F RRF PORTB RRF buffer0,F RRF PORTB RRF buffer0,F ;Now have 8 samples RRF PORTB ;Start on the next 8 samples RRF buffer1,F RRF PORTB RRF buffer1,F etc... for six more samples, and repeat the pattern... Does anyone else have any better ideas? Scott P.S. Michel, I didn't know you wanted a phase locked loop! But I like the "synch" solution none-the-less.