A try at a phase difference detector. The display will show values from 0 to F as the phase difference between the two inputs changes from 0º to 180º.
We have two inputs, oscillating at the same frequency. We can change the phase of one of them to see what happens. The bottom input feeds into the second input which in turn drives an inverter. The output of this stage, thanks to the inverter, is the difference between the two inputs. This is a sine wave whose aplitude is proportional to the phase difference (not linearly, though...). Next we have an half-wave rectifier that outputs an (almost) DC voltage to the ADC, proportional (not linearly) to the phase difference. Then we have the display stuff. We use one of the oscillators as the clock input of the ADC.
To do: try to find a way to have a more linear output as a function of the phase difference. I could google it but I don’t wanna...