I used the 2 PIC comparators to make square waves from the sine waves of the transmitter and receiver, very nice, zero bias on the comparators, nice zero crossings, good symmetrical square waves, no noise.
As I did the math while in bed just before falling asleep, it turned out to be a factor of exactly 10 wrong. Well, what I am trying to say is that I expected to be able to count 370 increments of a counter between the rising edges of the created square wave at 360 degrees phase shift, but could only do 40 in the PIC. Something to do with clock speed, and even more so clock domains, the comparator outputs are synched to the 16 MHz processor clock, so you always have that (variable delay), plus instruction time to process things. I tried the interrupt version first, and then, to see if it was faster, just a simple loop. Not faster, about the same (the real time counter in the PIC is also synched to the processor clock domain, when using internal clock). What this means is that at a range of say 100 km/h (aprox.), the resolution is about 10 degrees or 1/36 of 100 so about 3 km/h. Usable but I like perfection.
Sure bigger faster processor, measure delays, go partly analog, sample and measure with PIC ADC. but there are many other factors too that need to go into the math so I started thinking.
Now to get a patent, with my objections to patents and especially software patents, and patent trolls, all men should invent should be available to all. So invent something never seen and never heard before,.
So here my train of thought:
'I also needed a way to measure the true air speed in my wind tunnel pipe (as reference). One way to do this is put a very light ball (pingpong ball?) in the pipe and see how long it takes to travel to the end, easier said then done, but that would, if the ball was light enough, be a measure of TRUE airspeed. No shit about pressure, altitude, density, temperature, what not.
So, small balls, and what is the smallest ball we electronic[s] wizards know: YES The electron! Now electrons do not travel well in air, normally, that is why our TV tubes are vacuum...
But you know lightning, they DO travel... especially charge.
So if I injected a high voltage spike into an insulation tube where the air blows through, should it not charge (any moisture 'cloud', or even to some extent ionize that air (no sparks just a x kV pulse) ). The charged particle (excess electrons) would then travel with the _air_ and a simple high impedance (MOSFET) input a bit further down wind will pick it up, first the EM at next to zero delay (light speed), but a bit later the arrival of the charged air (lightning cloud). And that is massless (to a low value of nothing), and travels at exactly the speed of the air, without regard to any other parameters, So, have not build it yet, busy day, thought of that this morning, but the idea hereby donated into the public domain, so here is prior art if you now run for that patent office. Of course the proof of the pudding is in the eating as they say in the UK, so will this work, take your bets! The circuit is almost identical to what I have now, coil, MOSFET, PIC delay measurement. maybe the weekend....