You forgot one thing with the SERIN statement...
It will time-out ONLY when the pin stops seeing Data (by Data I mean ANY High/Low transition - valid or not) and remains in the CORRECT IDLE state for 250mS... if the signal is from a Radio Receiver the pin could be fluctuating through random noise... and it may also be idling in the WRONG state... all things covered in other threads earlier on the forum. Stick a scope on the PIC pin and see what you've got - it may not be such a clean signal which you expect.
As you get closer with your Transmitter, the signal-to-noise ratio improves to the point where you are actually getting a good clean signal out of your Receiver. Your Tx/Rx pair may well be specified for 100 metres... that means the Receiver will hear the Transmitter at 100 metres - it DOESN'T mean you'll get HIGH SPEED RELIABLE SERIAL COMMUNICATIONS at 100 metres without additional filtering and conditioning circuitry.
I refer you to my post at the start of the thread...
If life was so simple just keying a carrier 2400 times (or more) a second, manufacturers wouldn't have bothered spending millions developing FSK (and other) endoders/decoders, etc.
Bookmarks