Does anyone know where I can find Manchester encoding/decoding routines for RS-232 communications using PIC microcontrollers?
Looking for Manchester Encoding Routines for PICs
May 06, 2004
4 Replies
There were some Manchester encoding/decoding code for AVR some time ago. Search the groups for Manchester + AVR
"Ron Ciren" wrote
formatting link
would likely be a good place to start. There are more than a few ways to generate a Manchester encoded stream from a PIC. Perhaps if you gave some more detail of the particular PIC (feature set) you are planning to use and more information about your requirements, we could give some better advice as to how to proceed.
I am getting some TWS-434 and RWS-434 RF modules in the mail soon and I understand from some preliminary web searches that something called "Manchester encoding" is required to make RF links reliable.
I will do a little testing when I get the modules to see how reliable they are without Manchester encoding. Hopefully I will be able to get along without it.
I want a radio l>
Hi ron -- I've used these units, and you'll definitely want to use Manchester encoding -- the performance will be significantly better than without.
Fortunately, Manchester encoding is pretty trivial to implement. For a description, see the following URL:
formatting link
All Manchester encoding really involves on the sending side is to send each bit followed by its complement. So a logical 1 is encoded as 1 0. A logical 0 is encoded as 0 1. Manchester encoding the start bit is optional, but recommended.
When sampling the RWS output on the receiving end, expect each data bit to be followed by its complement. So a 0 followed by a 1 is a logical 0. A l followed by a 0 is a 1. If you see a 1 1 or 0 0, you have an error.
That's really all there is to it. You should see a major improvement in range using this method, since the receiver circuitry is most sensitive to transitions in the incoming signal. Both reliability and range will be improved greatly.
Hope that helps -- tAfkaks
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required