View previous topic :: View next topic |
Author |
Message |
chingB
Joined: 29 Dec 2003 Posts: 81
|
Decoding of Manchester Encoded Data |
Posted: Thu Aug 05, 2004 2:42 am |
|
|
Hi,
I was able to get a device that will output a manchester encoded data. I was able to check this using an oscilloscope and I notice their is a sync bits between each frame...
In one frame I also notice that it is of compose of 45bits of logic 1 and logic 0.
My question are: what would be a good approach in decoding? what interrupt should I use? Is it ok to use external interrupt with timer or CCPx with timer?
I guess many in these community have wild ideas in implementing manchester on a PIC18F452.
I need your suggestions and/or a sample code snippet for decoding manchester data.
BTW, I already search this forum and none of any help to me...
Thank you. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
|
dbotkin
Joined: 08 Sep 2003 Posts: 197 Location: Omaha NE USA
|
|
Posted: Thu Aug 05, 2004 8:19 am |
|
|
Decoding Manchester data doesn't appear to be terribly difficult until you try to include error handling for noisy links, etc. There is a Microchip app note dealing with the Keeloq, which communicated with Manchester encoded data. I used that ap note for the state diagrams, and translated the ASM source to C (that was a first for me!!) and got a Manchester-encoded RF link working both ways - send and receive.
The good news is, it works GREAT. The bad news is, it took me a couple of weeks to get it to that point, and I can't share the source. But it can be done, and Microchip TB045 is a very good resource. |
|
|
chingB
Joined: 29 Dec 2003 Posts: 81
|
|
Posted: Thu Aug 05, 2004 5:13 pm |
|
|
dbotkin wrote: | Decoding Manchester data doesn't appear to be terribly difficult until you try to include error handling for noisy links, etc. There is a Microchip app note dealing with the Keeloq, which communicated with Manchester encoded data. I used that ap note for the state diagrams, and translated the ASM source to C (that was a first for me!!) and got a Manchester-encoded RF link working both ways - send and receive.
The good news is, it works GREAT. The bad news is, it took me a couple of weeks to get it to that point, and I can't share the source. But it can be done, and Microchip TB045 is a very good resource. |
Would it be possible if u can give the exact filename of the document u get from microchip.com... such that I can search for it.
I'll try ur suggestions...
Thank u Mark and dbotkin.. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
|
Guest Guest
|
Manchester decoding |
Posted: Fri Aug 06, 2004 6:56 am |
|
|
Quote: | I was able to get a device that will output a manchester encoded data. I was able to check this using an oscilloscope and I notice their is a sync bits between each frame...
In one frame I also notice that it is of compose of 45bits of logic 1 and logic 0. |
chingB:
It sounds like you are using some type of encoder chip? Is there a decoder available for this encoder? If you haven't invested too much already and don't need really high data rate, there are some encoders and decoders made by Holtek. I think they handle erors by transmitting the same data multiple (3?) times and getting 2 out of 3 receptions to be the same, or something like that. Never used them but if I remember what I read correctly the data to be transmitted is input in parallel to the encoder, so it eats lots of pins unless you add a shift register.
Please let us know when you have finished converting the ASM to C from that Microchip app. note! Good luck!
BillT |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
|
Shep Guest
|
|
Posted: Thu Sep 30, 2004 4:23 pm |
|
|
Just spotted this.
I'm also in the process of constructing a Mancunian translator (all right our kid)
Haven't looked through all this yet, but my orginal thoughts were:
1:
Poll at regular intervals at least 8 times greater f then data stream
0x55 preamble to get exact timing
0x1D traning sequnce (3 0's & 3 1's appear in a row so no misfires)
adjust timing with edge detector (sweep an xored 0x0F over incomming stream)
etc.
or 2 what i'm thinking would be simpler and less computationally expensive:
Use interrupt on change
Time using preamble
16bit timer would give massive resolution and dynamic range: incomming stream could be decoded over a wide f
Any glitches or spikes could be filtered out
Thoughts? |
|
|
|