PDA

View Full Version : Manchester coding question



oneohthree
- 2nd May 2007, 04:06
I have been using manchester coding, $55 as the preamble and $aa as the leader bit for PIC to PIC RF transmission and everything is working. I would like to know the technical reason why I am using manchester coding and $55 as the preamble.

rhino
- 2nd May 2007, 05:44
This thread has some pretty good information in it.
http://www.picbasic.co.uk/forum/showthread.php?t=4285

oneohthree
- 2nd May 2007, 07:30
I just want to confirm my code, am I using the GE Thomas Convention where "1" is "10" or am I using the IEEE convention where "1" is "01" because it seems like I'm encoding it the IEEE convention way but at serout I invert it so it becomes the GE Thomas Convention.

Include "Modedefs.bas"
main:
u var byte : counter var byte : encode var byte : u = %1101

'Manchester encoding
For counter = 0 to 3
If u.0[counter]=0 Then
encode.0[counter*2]=0 : encode.0[counter*2+1]=1 'If it is a zero make the first bit 0 and second bit 1
Else
encode.0[counter*2]=1 : encode.0[counter*2+1]=0 'If not then make first bit 1 and second bit 0
EndIf
Next counter
serout PORTB.0, n2400, [ $55 , $55 ,$55, $55, $aa , encode ] '
goto main

rhino
- 2nd May 2007, 15:24
uggg.... you're making my brain hurt! Just kidding! ;)
I can see why you would want clarification for documentation. The way it is coded appears to be the GE method. Physically, if I remember correctly, since it in inverted it idles high. So electrically I think it becomes the other method. Maybe I'm way off here..... gonna need some verification from someone smarter than me.

skimask
- 2nd May 2007, 16:40
I just want to confirm my code, am I using the GE Thomas Convention where "1" is "10" or am I using the IEEE convention where "1" is "01" because it seems like I'm encoding it the IEEE convention way but at serout I invert it so it becomes the GE Thomas Convention.

I wouldn't think it would matter a whole lot as long as you're using the same thing at both ends. And if the TX and RX like one combo better than the other, well, there ya go... Can't really say for sure, I haven't tried both ways.

oneohthree
- 2nd May 2007, 17:15
I know that it is working and that it doesn't really matter but I want to check my oscilloscope readings correspond with the correct convention.

languer
- 2nd May 2007, 21:25
I would like to know the technical reason why I am using manchester coding and $55 as the preamble.
Well, this is sure a strange question. I would think you would know why you are using it, since you have it in your code. I think the link rhino provided is good. But if you absolutley must know and have no clue why it is in your code, I would look at http://www.ottawarobotics.org/articles/rf/rf.html.


I know that it is working and that it doesn't really matter but I want to check my oscilloscope readings correspond with the correct convention.
Another strange one, how about using MPLAB (or the simulator of your choice) and see how the code runs. Then, compare this to what you see in the oscilloscope and see what happens. They should match, and you should be able to tell how the bits are done and how the code treats them.

I agree with skimask, I do not think it matters (as long as it is the same in both TX and RX).

mychangl
- 5th May 2007, 15:52
Just wonder, when we use manchester code ?
:-P

Ioannis
- 5th May 2007, 17:28
Have you read any of the above replies?

Have you visited the links?

If you did and did not understood anything, come back to ask. The link http://www.ottawarobotics.org/articles/rf/rf.html at the 2.1 MANCHESTER ENCODING - The art of balancing a serial stream discusses a lot...

Ioannis

Ioannis
- 5th May 2007, 17:35
Have you read any of the above replies?

Have you visited the links?

If you did and did not understood anything, come back to ask. The link http://www.ottawarobotics.org/articles/rf/rf.html at the 2.1 MANCHESTER ENCODING - The art of balancing a serial stream discusses a lot...

Ioannis