# Manchester encoding, self clocking question

#### bug13

Joined Feb 13, 2012
1,864
Hi team

How manchester self clock? refer to image, how does it tell where the two GREEN ARROW is not ZERO?

#### MrChips

Joined Oct 2, 2009
21,890
Manchester encoding is also known as phase-encoded.
The direction of the transition tells you if the data is 0 or 1.

Take a look at the bottom trace.
A rising edge identifies a 1.
A falling edge identifies a 0.

After that, you have to ignore any transitions that occur before a half bit width has expired, i.e. ignore the transitions you have indicated with the green arrows.

#### bug13

Joined Feb 13, 2012
1,864
Thanks guys @nsaspook and @MrChips

So referring to the image below, if I am at the receiving end, how can I tell the data is 1 1 1, but not 10101?? How can I tell how much time is one bit?

PS: Assuming the receiver don't know how many bit the transceiver are sending.

#### bug13

Joined Feb 13, 2012
1,864
Just an thought,

Does it normally send a known data stream first? Say send 32 bits of 1s to synchronize the signal so the receiver can work out the data rate?

#### MrChips

Joined Oct 2, 2009
21,890
You need to know the bit width (approximate).

Yes, you need to send a synchronizing byte. Any byte that begins with 10xxxxxx will do.
If you send 10101010, the receiver can figure out the bit width.

#### bug13

Joined Feb 13, 2012
1,864
You need to know the bit width (approximate).

Yes, you need to send a synchronizing byte. Any byte that begins with 10xxxxxx will do.
If you send 10101010, the receiver can figure out the bit width.
Great, that answer my question, thanks @MrChips

#### MrChips

Joined Oct 2, 2009
21,890
What I wrote with regards to the bit order can be misleading.
If the LSB is transmitted first then you want the synchronizing byte to be xxxxxx01.

#### Dodgydave

Joined Jun 22, 2012
9,468