Section 10.1 Data Transfer Protocol
Because only one bit is sent at a time in serial communication, a protocol must be established to define how data is sent and interpreted.
Data order describes the order in which data will be transmitted and received. A serial communication protocol must define if the MSB is sent first or if the LSB is sent first.
In synchronous (clocked) serial communication, a clock frequency must be defined. Other important details to establish are clock polarity and clock phase. Clock polarity establishes the value that any clock signal will have when itβs idle (in its off state). This could be a HIGH or LOW value. Clock phase establishes the edge that data will be sampled on which could either be the leading edge (the first edge of the clock after it becomes active) or the trailing edge (the second edge of the clock after it becomes active).
Subsection 10.1.1 Primary and Secondary Devices
Many serial protocols use a primary-secondary configuration. A primary device has unidirectional control over one or more other devices (secondary devices). In some serial communication protocols, the primary selects the active secondary device and also supplies a clock signal. Some serial protocols allow multiple primary devices. In addition, some protocols allow the roles of primary and secondary to be changed between message transmissions.
Note that the distinction between primary and secondary device does not refer to the direction that data will be sent. A primary device is equally capable of transmitting and receiving data. Secondary devices are also capable of both transmitting and receiving data.
Subsection 10.1.2 Simplex and Duplex
Simplex communication is capable of sending data in only one direction. Consider for example a radio. Information is broadcast to the radio receiver, but no information is transmitted back. It is simply a unidirectional flow of data.
A duplex communication system consists of two devices that can communicate with each other in both directions (i.e. as receivers and as transmitters).
In half-duplex communication, only one wire is present to send and receive data, therefore information can be sent in both directions, but only one direction at a time. Half-duplex communication can be considered similar to speaking on a walkie-talkie; one individual speaks at a time and indicates the end of their message by saying βover.β
In full-duplex communication, information can be sent in both directions simultaneously, which requires the use of one more wire than half-duplex communication. Full-duplex communication is possible using phones where two people can speak simultaneously (although limitations of humans may make it difficult for both parties to understand; this complication is not present in computing devices).
Subsection 10.1.3 Synchronization
In serial communication, data can be sent synchronously or asynchronously. Synchronous communication requires a clock signal to be provided by the primary device (which requires the existence of another wire to carry the clock signal). With synchronous communication, once \(n\)-bit data transfer is initiated, the receiver has to wait \(n\) clock cycles before the information has been fully clocked in.
In asynchronous communication,
START and STOP bits are required to signal to the receiver that transfer has been initiated and completed.
Subsection 10.1.4 Error Detection
An error detection protocol can be used to determine if an error occurred between transmission and reception of a signal. (Errors can occur due to electrical noise or can be due to malicious interference if someone can access and modify signals directly.) A robust description of error techniques is beyond the scope of this textbook. However, parity detection is a relatively simple manner of performing error detection and the basic properties will be described below. (A more detailed explanation is available in [16.20].)
Parity refers to the number of 1βs in a variable or data stream. Parity is odd if there is an odd number of 1βs, and even if there is an even number of 1βs. When using parity detection, the protocol will establish if even or odd parity will be used.
A parity bit will be added to the data stream to force the data to take on a particular parity (either even or odd). The transmitter will generate this parity bit. The receiver will detect the message parity to determine whether or not an error occurred.
If the parity detection circuitry calculates a parity thatβs different from what was established by the protocol, then an error definitely occurred during the transmission process. Parity checking cannot generate a false positive.
However, parity detection has a serious drawback. If an even number of bits are flipped in the transmission process, the detection logic will determine that the correct parity exists in the message. This corresponds to a false negative (it appears that there was no problem during transmission even though there was).
