next up previous
Next: Learning Module Exercise Up: Input Capture Interrupts Previous: Receiver

Simplified Serial Communication Protocol

A protocol is an agreement between two parties about how the two parties should behave. A communication protocol is a protocol about how two parties should speak to each other. Serial communication protocols assume that bits are transmitted in series down a single channel. A serial protocol has to address the following issues

The IR link you'll be constructing is an asynchronous serial link and this means that these four issues must be agreed upon by both transmitter and receiver prior to sending any information.

In many serial protocols, the issue of how to detect the start of a transmission uses a special bit known as a start bit. Both transmitter and receiver assume that the channel is initially idle (i.e. zero volt logical level). A transmission is then signalled by setting the channel high for a specified length of time and then setting it low again. Transmission of information bits usually commences a specified interval of time after the falling edge of the start bit.

The issue of "when" to look for data bits must be agreed upon prior to establishing the link. Asynchronous serial protocols usually require that information bits be transmitted at regular time intervals. For instance if we have a 2400 kbaud modem, then both receiver and transmitter know that they should look for information bits arriving at a rate of 2400 thousand bits per second.

One possible way of formulating the protocol is to assume that the start bit is identified by a rising edge. Let's assume that the information and start bits are being transmitted at a rate of $1/T$ bits per second. The the first information bit will occur $3T/2$ seconds after the start bit's rising edge, and then every succeeding information bit can be read every $T$ seconds after the last bit was read. Figure 53 illustrates the proposed format for the serial frame of data.

Figure 53: IR Link's Proposed Data Frame
\begin{figure}\centerline{\psfig{file=figs/ir-serial-frame.eps,width=4in}} \end{figure}

Once you've recovered a series of bits, there is a natural question concerning the order of the transmitted bits. In other words if each transmission consists of a byte, then is the first bit received the most or least significant bit in that byte. The receiver and transmitter need to agree upon the bit order prior to transmission so the bits are properly interpreted.

Determining when a transmission should end can again use something like a stop bit of duration $T$ seconds to indicate the end of transmission. The stop bit makes sure that there is at least T seconds between the last information bit and the start bit of the next transmitted byte.

To summarize, the comm-protocol we advise you using in this learning module consists of the following agreements. In this protocol, the variable $T$ is a bit time interval agreed upon by the receiver and transmitter. We'll assume that $T$ equals 10 milliseconds.

The timing diagram for this serial protocol is shown in figure 53. The protocol itemized above is only a recommendation, a starting point. Feel free to change it if necessary.

next up previous
Next: Learning Module Exercise Up: Input Capture Interrupts Previous: Receiver
Bill Goodwine 2002-09-29