Then I would do what I suggested. Use an AND gate to combine your 40Khz (or whatever freq) and SEROUT2 (idle low).
On the receive end, use a rail-rail output op-amp to filter and amplify the signal to past the clipping level. Use a 12F675
sitting in a tight loop that does nothing else but watches for an input pin to be high for half the period and then low for half the period of the ultrasonic signal.
It then sets an output pin high and goes back to sampling. When it fails the test, it sets the output bit low. Use SERIN2 to decode the output of the 12F675.
Bookmarks