Yes, manchester encoding works but there are simpler methods for sending short data bursts which work better.
Sync bytes are a lousy idea. See the screenshot at http://davehouston.org/rf-noise.htm (the bottom of the page) to understand why.
A single, wide pulse acts both as a start-of-frame indicator and to set the receiver's AGC and dataslicer threshold. See the screenshots at the top of the above cited page for an example.
Byte balancing sends each byte twice with the second byte a bitwise complement of the first and immediately following the first. This addresses the dataslicer threshold drift noted by skimask and gives you built in error checking - if the two bytes do not sum to $FF there's an error. Leaving a fairly long gap between data bursts allows the receiver AGC to reset. You can see its effects in the slope of the pulse in the screenshots on the above cited page.
I've provided an example in the Code Examples forum. X-10 has used the NEC protocol for its RF devices for over 30 years. Even Philips, which uses manchester encoding in all of its protocols, prefaces them with a long pulse to denote start-of-frame.
One thing you haven't learned yet is to
Code:
put your code
in a form
that is more
readable
Bookmarks