Apply the pulse signal through a capacitor and a diode half bridge to the gate of a mosfet.
This will turn the mosfet on as long as the pulses are coming.
The mosfet will be off when the pulse train stops (hi or low doesn't matter)
The pulse voltage has to be large enough compared to the gate threshold of the mosfet. The 2N7002 has about 2.5V threshold ...
A high speed opamp will work. This is the fastest that I have in my stash. https://www.ti.com/lit/ds/symlink/lm6171.pdf Probably overkill.
It will pass a 1 \$\mu\$s squared pulse with good signal integrity, so a shaped pulse should be no problem.
This experiment has a gain of 2. You will need to reduce the value of R2 to get the 10/6 ratio that you desire.
The "operational" in "operational amplifier" means that it's designed to be very versatile at making circuits do various mathematical operations. In order to achieve this, op-amps, by themselves, have very high voltage gain -- usually \$10^5\$ or \$10^6\$. They are designed so that when you wrap them with negative feedback, the gain is ...
Because your circuit is missing negative feedback, the input is driving the op-amp into saturation. First at the high rail. Then at the low rail.
Edit: in your second picture, either your gain is too high, or your supply voltages are too low. Again, the reason for the near square wave output is saturation of the op amp.
The xor() must be inside the infinite loop. In particular inside the while (!PIR2bits.CCP2IF) loops.
In all cases if you are not using interrupts it is useless to use the capture compare for an internal function.
The output stage of the LM35 is famous for being a little moody… in my experience it often tends to oscillate, if the signal line is longer than 5-10cm (typical if externally mounted). Also it is somewhat weak, as you already noted.
Look with a scope at the output signal, if you see a sawtooth the LM35 is oscillating because of the excessive capacitive load (...
You will have to find the mode of ingress by experiments.
surface waves faster than water medium waves.
ground shift wire resonance.
ground conduction crosstalk (shared currents)
radiated differential loop crosstalk
radiated common mode crosstalk
a) If not already, use STP wire with common shield ground at the uC for send & receive circuits. ...
Addressing possible electromagnetic radiation from the transmitter:
Assuming that the received, unwanted pulse is coincident with the transmitted pulse, coupling would be speed-of-light electromagnetic coupling. Suppressing this radiation involves reducing the area of transient current in the MOSfet switch. An isolating inductor has been added to block AC ...