Manchester encoding » History » Version 1

ABDALLAH, Hussein, 03/14/2016 10:22 PM

1 1 ABDALLAH, Hussein
h1. Manchester encoding
2 1 ABDALLAH, Hussein
3 1 ABDALLAH, Hussein
The encoding in Manchester technique is established when we add the correct transitions to the message signal in relation to the data that will be transmitted. Several steps are used. The first one is to fix the data rate, then the mid-bit time which correspond to ½ of the data rate period.
4 1 ABDALLAH, Hussein
Below, we are going to use an example in order to clarify the principle of decoding in Manchester code.
5 1 ABDALLAH, Hussein
6 1 ABDALLAH, Hussein
We choose to use a data rate of 5 KHz. So, the bit period in this case is T = 1/f = 1/5000 = 200 micro second. Dividing by 2, we obtain the mid-bit value which is 100 Micro-second.
7 1 ABDALLAH, Hussein
Once we do that, now we will encode a data which is 0XC5 (for example). This data correspond to 11000101.
8 1 ABDALLAH, Hussein
So we use a timer to interrupt at each 100 micro second, we need also to track which ½ bit period are we sending. 
9 1 ABDALLAH, Hussein
Once we finish this, we can easier encode the data.
10 1 ABDALLAH, Hussein
11 1 ABDALLAH, Hussein
1. Begin with the output signal high. 
12 1 ABDALLAH, Hussein
2. Check if all bits have been sent, If yes, then go to step 7 
13 1 ABDALLAH, Hussein
3. Check the next logical bit to be coded 
14 1 ABDALLAH, Hussein
4. If the bit equals “1”, then call ManchesterOne(T) 
15 1 ABDALLAH, Hussein
5. Else call ManchesterZero(T) 
16 1 ABDALLAH, Hussein
6. Return to step 2 
17 1 ABDALLAH, Hussein
7. Set output signal high and return
18 1 ABDALLAH, Hussein
19 1 ABDALLAH, Hussein
Implementation of ManchesterOne(T) 
20 1 ABDALLAH, Hussein
21 1 ABDALLAH, Hussein
1. Set the output signal low 
22 1 ABDALLAH, Hussein
2. Wait for mid-bit time (T) 
23 1 ABDALLAH, Hussein
3. Set the output signal high 
24 1 ABDALLAH, Hussein
4. Wait for mid-bit time (T)
25 1 ABDALLAH, Hussein
5. Return 
26 1 ABDALLAH, Hussein
27 1 ABDALLAH, Hussein
Implementation of ManchesterZero(T) 
28 1 ABDALLAH, Hussein
29 1 ABDALLAH, Hussein
1. Set the output signal high
30 1 ABDALLAH, Hussein
2. Wait for mid-bit time (T) 
31 1 ABDALLAH, Hussein
3. Set the output signal low
32 1 ABDALLAH, Hussein
4. Wait for mid-bit time (T) 
33 1 ABDALLAH, Hussein
5. Return
34 1 ABDALLAH, Hussein
35 1 ABDALLAH, Hussein
By doing these steps, we encode the data into a Manchester message signal at the desired data rate. Otherwise, the accuracy of the data rate and the duty cycle will depend on the clock source and the method used to create the wait times.