Hi Hank

I'm sorry, I did not reply earlier. I thought you would find a way

Ok, I will not get into the code you wrote nor will I write some, but, this is how I do a phase comparison on my projects. A 16 bit timer is free running all the time. No start/stop sequences. Comparator interrupts too are always enabled. No need to start/stop them. Remember Timer always counts up and rolls over, so CurrTimer nearly always is > PrevTimer. On rollover, the result of CurrTimer-PrevTimer is still valid since the bits are limited to a word size. So, 1000-500 is still same as 465-65500 (+ 1) when you do the 16 bit subtract.

Define CurrTimer TMR1 ' alias CurrTimer as timer1
PrevTimer var word
FreqCount var word
PhaseCount var word

On comp1 interrupt
FreqCount = CurrTimer - PrevTimer ' timer ticks between 2 edges of the same input give time proportional to the frequency
PrevTimer = CurrTimer ' This is the new reference for phase measurement

On comp2 interrupt
PhaseCount = CurrTimer - PrevTimer ' gives the time between non shifted and shifted waves

Convert phasecount to corresponding time as
Phase(Degrees) = PhaseCount(uS)*180(degrees) / (180deg counts(us))

Convert freqcount to corresponding freq similarly

I hope this give you some hint. It's near bedtime and I can barely keep my eyes open. If you need some more hints, let me know, I'll try to help

This code is definitely not PBP as I've just put the ideas forth.

Regards