Digital encoding for serial links
All digital serial communications share one thing in common; they all send a series of ones and zeros. From this point, the differentiating factor becomes the level of the signal, the organization of the data, how the data is encoded, and how the data is synchronized. In a design that is sensitive to component availability and overall cost, it's highly desirable that serial data is transferred with a minimum number of wires and is built from readily available components.
Non-Return to Zero (NRZ): One of the simplest ways to transmit digital data is by having a separate clock and data line. In this approach, a clock signal of constant frequency is synchronized with its corresponding data. Depending upon the preference of the designer, the data is either latched on the rising or falling edge of the clock. Figure 1 illustrates a typical NRZ implementation.
View the full-size image
In this example the binary string "1010011" is being transmitted. Each bit is identified on the rising edge of the clock signal. As simple as this process is, you need to consider at least three fundamental drawbacks:
1. An additional line must support the clock signal. This is required to latch the data accurately. Depending upon the quality and length of the transmission line, additional circuitry may be required to provide the proper drive capability.
2. The second problem occurs if you decide to eliminate the clock signal. In this scenario the receiver will require an internal clock that is in near-perfect synchronization with the transmitter. Any phase shift between the transmitter and the receiver can cause bit errors to occur. This may seem a trivial matter. However, when the clock frequency becomes high enough, the sensitivity to phase differences between the transmitter and receiver becomes more significant.
3. A third limitation occurs when an NRZ transmission contains a long string of ones or zeros, as shown in Figure 2. This can make the synchronization between the transmitter and receiver even more sensitive to bit encoding errors. Since the line is in one state for a relatively long period of time, there are no transitions. Without transitions on the data line, it becomes impossible to see where a bit boundary is located. This can result in erroneous data encoding.
View the full-size image
The next section describes an encoding scheme that addresses these issues and provides a unique alternative to the traditional method of data transmission.
Manchester encoding
Manchester encoding offers distinct advantages over other digital encoding schemes. It has become a popular standard for low-cost radio frequency communication of digital data. Even Ethernet employs Manchester encoding that was used to deliver this article to your computer (if you're reading this online). So what exactly is Manchester encoding and how can it be used effectively in a low-cost embedded systems design?
Manchester encoding was first developed back in the late 1940s at the University of Manchester in Manchester, England. Given the time period and location, one with a proclivity for history might be inclined to believe its development was perhaps a by-product of research done by an obscure World WarII code-breaker at England's infamous Bletchley Park.
In reality, Manchester encoding was the result of research done at the University of Manchester into phase modulation techniques used for reading and writing digital data onto a magnetic storage device. Since that time, Manchester encoding has gained wide acceptance as the modulation scheme for low-cost radio-frequency transmission of digital data.
One of the most significant characteristics of Manchester encoding is its unique way of representing digital data. Rather than representing data based on a particular level, Manchester encoding uses transitions (see Figure 3) to identify a binary one or zero. In more traditional encoding schemes, a separate clock signal determines when to sample the data line. Manchester encoding uses one signal to identify the data.