Serial Communication Protocols v0.1
Serial Communication Protocols v0.1
Serial Communication Protocols v0.1
INDEX
About Serial Communication Brief History Parallel Vs. Serial Typical HW Architecture Leading Serial Protocols
In telecommunication and computer science, serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. The concept of serial communication is simple. The serial port sends and receives bytes of information one bit at a time. Although this is slower than parallel communication, which allows the transmission of an entire byte at once, it is simpler and you can use it over longer distances.
For example, the IEEE 488 specifications for parallel communication state that the cabling between equipment can be no more than 20m (65ft) total, with no more than 2m (6.5ft) between any two devices; serial, however, can extend as much as 1200m (4000ft).
Serial communication is used for all long-haul communication and most computer networks, where the cost of cable and synchronization difficulties make parallel communication impractical. Serial computer buses are becoming more common even at shorter distances, as improved signal integrity and transmission speeds in newer serial technologies have begun to outweigh the parallel bus's advantage of simplicity.
BRIEF HISTORY
Perhaps the very 1st usage of serial data transfer in communication protocols was for electrical telegraphs by Samual Morse in 1837. RS232 (Recommended standard 232) was one of the most popular serial protocol in beginning of PC era (1960s) and has remained so till 2000. Universal Serial Bus (USB) introduced in 1995 is one of the most successful wireless protocol with more than 2 billion USB ports shipped till date. Today Serial protocols are dominant in all segments Consumer, Medical, Avionics, Industrial, Automotive and Space.
A parallel link transmits several streams of data simultaneously along multiple channels (e.g., wires, printed circuit tracks, or optical fibres); a serial link transmits a single stream of data. Although a serial link may seem inferior to a parallel one, since it can transmit less data per clock cycle, it is often the case that serial links can be clocked considerably faster than parallel links in order to achieve a higher data rate. A number of factors allow serial to be clocked at a higher rate:
Clock skew between different channels is not an issue (for unclocked asynchronous serial communication links). A serial connection requires fewer interconnecting cables (e.g. wires/fibres) and hence occupies less space. The extra space allows for better isolation of the channel from its surroundings. Crosstalk is less of an issue, because there are fewer conductors in proximity.
In many cases, serial is a better option because it is cheaper to implement. Many ICs have serial interfaces, as opposed to parallel ones, so that they have fewer pins and are therefore less expensive.
There are many different reasons to use a serial interface in embedded systems. One of the most common is the need to interface with a PC, during development and/or in the field. Most PCs have some sort of serial bus interface available to connect peripherals. For embedded systems that must interface with a computer, a serial interface is often easier to use than the ISA or PCI expansion bus. Serial buses can also provide for inter-processor communication-a network. This allows large tasks that would normally require larger processors to be tackled with several inexpensive smaller processors. Serial interfaces allow processors to communicate without the need for shared memory. This isn't to say that parallel buses have no use. For operational fetches, address and data buses, parallel buses have always been the clear winner. "Memory-mapping" peripherals has been a technique commonly used for systems with address and data buses. This tendency allows parallel access to off-chip peripherals. However, with many microcontrollers with no external address/data bus available for designs, memory-mapping is not an option.
TYPICAL HW INTERFACE
Serializer: Takes parallel data and transforms it into a serial stream. Deserializer: Takes serial stream and changes it into parallel data. Clock Manager: Manages various clocking needs including clock multiplication, clock division, and clock recovery. Transmit/ Receive FIFO: Allows for storing of incoming/received data. Clock Correction and Channel Bonding: Allows for correction of the difference between the transmit clock and the receive clock. Also allows for skew correction between multiple channels. Line Encoder: Encodes the data into a more line-friendly format. This usually involves eliminating long sequences of non-changing bits. May also adjust data for an even balance of ones and zeros. Line Decoder: Decodes from line encoded data to plain data. Receive Line Interface: Analog receive circuitry includes differential receiver. Transmit Line Interface: Analog transmission circuit often allows varying drive strengths.
PCI Express
RS232
TIA/EIA-232-F (typically referred to as RS-232) is a common interface that can be found on almost every personal computer. RS-232 is capable of moderate distances (Cable lengths of 30 feet )at speeds up to 20Kbps. An RS-232 bus is capable of full-duplex communication between two receiver/transmitter pairs, named data terminal equipment (DTE) and data communication equipment (DCE). Each one has a transmit signal that is connected to the receive signal on the other end. As such, there is a pin difference between the two sides. (Your PC is a DTE, while the connected peripheral is DCE.) Each transmitter sends data by varying the voltage on the line. A voltage higher than 3V is a binary zero, while a voltage less than --3V is a binary one. Between these voltages, the value is undefined. Many embedded systems that use the RS-232 bus either interface with PCs or PC peripherals such as modems. Other systems use RS-232 so that bus traffic can be monitored easily with an inexpensive protocol analyzer or a PC equipped with two serial ports. Almost every microcontroller vendor has product that include hardware support for RS-232.
RS232
A timing diagram for an RS-232 frame consisting of one start bit, 7 data bits, one parity bits and two stop bits is shown below in figure. The start bit is used to signal the beginning of a frame and the stop bit is used to signal the end of a frame. Parity is used to detect transmission errors. The receiver and transmitter have already agreed upon which type of parity check (even or odd) is being used. When the frame is received, then the receiver checks the parity of the received frame. If the parity is wrong, then the receiver knows an error occurred in transmission and the receiver can request that the transmitter re-send the frame. In cases where the probability of error is extremely small, then it is customary to ignore the parity bit. The bit time is the basic unit of time used in serial communication. It is the time between each bit. The baud rate is the total number of bits (information, overhead, and idle) per time that is transmitted over the serial link. So we can compute the baud rate as the reciprocal of the bit time.
I2C
Almost 30 years ago, in the early 1980's Philips designed & developed I C bus, for easy communication between Integrated Circuits (especially in TV circuits), which reside on the same circuit board. The name I C translates into Inter Integrated Circuits is a bi-directional 2-wire bus standard for efficient inter-IC control. I C bus is a multi-master bus, which means more than one IC/device capable of initiating a data transfer can be connected to it. The device that initiates the communication is called MASTER, whereas the device being addressed by the Master is called as SLAVE. It is the master device who always do generation of clock signals, which means each master generates its own clock signals when transferring data on the bus. The two bi-directional lines, which carry information between the devices connected to the bus, are known as Serial Data line (SDA) and Serial Clock line (SCL). The typical voltages used are +5 V or +3.3V.
I2C
The basic design of I C has a 7-bit address space with 16 reserved addresses, which makes the maximum number of nodes that can communicate on the same bus as 112.
First, the MCU will issue a START condition. This acts as an 'Attention' signal to all of the connected devices. All ICs on the bus will listen to the bus for incoming data. Then the MCU sends the ADDRESS of the device it wants to access, along with an indication whether the access is a Read or Write operation. Having received the address, all IC's will compare it with their own address. If it doesn't match, they simply wait until the bus is released by the stop condition. If the address matches, however, the chip will produce a response called the ACKNOWLEDGE signal. Once the MCU receives the acknowledge, it can start transmitting or receiving DATA. When all is done, the MCU will issue the STOP condition. This is a signal that the bus has been released and that the connected ICs may expect another transmission to start any moment.
SPI
SPI is a serial bus standard established by Motorola and supported in silicon products from various manufacturers. It is a synchronous serial data link that operates in full duplex. Devices communicate using a master/slave relationship, in which the master initiates the data frame. When the master generates a clock and selects a slave device, data may be transferred in either or both directions simultaneously. SPI specifies four signals: clock (SCLK); master data output, slave data input (MOSI); master data input, slave data output (MISO); and slave select (SS). Figure shows these signals in a single-slave configuration. SCLK is generated by the master and input to all slaves. MOSI carries data from master to slave. MISO carries data from slave back to master. A slave device is selected when the master asserts its SS signal.
SPI
In fact, as far as SPI is concerned, data are always transferred in both directions. It is up to the master and slave devices to know whether a received byte is meaningful or not. So a device must discard the received byte in a "transmit only" frame or generate a dummy byte for a "receive only" frame. In addition to the 1Mbps data rate, another advantage to SPI is if only one slave device is used, the /SS line can be pulled low and the /SS signal does not have to be generated by the master. A disadvantage to SPI is the requirement to have separate /SS lines for each slave. For small, low-pin-count microcontrollers, a multi-slave SPI interface might not be a viable solution.
USB
Universal Serial Bus (USB) is a set of interface specifications for high speed wired communication between electronics systems peripherals and devices with or without PC/computer. The USB was originally developed in 1995 by many of the industry leading companies like Intel, Compaq, Microsoft, Digital, IBM, and Northern Telecom. The major goal of USB was to define an external expansion bus to add peripherals to a PC in easy and simple manner. USB offers users simple connectivity. It eliminates the mix of different connectors for different devices like printers, keyboards, mice, and other peripherals. That means USB-bus allows many peripherals to be connected using a single standardized interface socket. It supports all kinds of data, from slow mouse inputs to digitized audio and compressed video. USB also allows hot swapping. The "hot-swapping" means that the devices can be plugged and unplugged without rebooting the computer or turning off the device. That means, when plugged in, everything configures automatically. So the user needs not worry about terminations, terms such as IRQs and port addresses, or rebooting the computer. Once the user is finished, they can simply unplug the cable out, the host will detect its absence and automatically unload the driver. This makes the USB a plug-and-play interface between a computer and add-on devices.
USB
Other benefits of USB are low cost, expandability and outstanding performance. It also provides power to the bus, enabling many peripherals to operate without the added need for an AC power adapter. The USB has already replaced the RS232 and other old parallel communications in many applications. USB is now the most used interface to connect devices like mouse, keyboards, PDAs, game-pads and joysticks, scanners, digital cameras, printers, personal media players, and flash drives to personal computers. Generally speaking, USB is the most successful interconnect in the history of personal computing and has migrated into consumer electronics and mobile products.
The standard USB plug Pin 1 Pin 2 Pin 3 Pin 4 VCC (+5 V) DataData+ Ground
As USB technology advanced the new version of USB are unveiled with time. Let us now try to understand more about the different versions of the USB. USB1.0: USB 1.0 is the original release of USB having the capability of transferring 12 Mbps, supporting up to 127 devices. was introduced in January1996. The data transfer rate of this version can accommodate a wide range of devices, including MPEG video devices, data gloves, and digitizers. This version of USB is known as full-speed USB. USB2.0: USB 2.0 specification was standardized at the end of 2001. This standardization of the new device-specification made backward compatibility possible.Supporting three speed modes (1.5, 12 and 480 megabits per second), USB 2.0 supports low-bandwidth devices such as keyboards and mice, as well as high-bandwidth ones like high-resolution Web-cams, scanners, printers and highcapacity storage systems. USB 2.0, also known as hi-speed USB. USB3.0: USB 3.0 released by Intel and its partners in August 2008. It is also called as Super-Speed USB having a data transfer rate of 4.8 Gbit/s (600 MB/s). That means it can deliver over 10x the speed of today's Hi-Speed USB connections. USB 3.0 is also a backward-compatible standard with previous USB technologies. USB OTG: One of the biggest problems with USB is that its host controlled. For example: Many USB digital cameras can download data to a PC, but it is unable to connect them directly to the USB printer or to a CD Burner. To combat these problems, USB On-The-Go (OTG) was created in 2002. USB OTG defines a dual-role device, which can act as either a host or peripheral, and can connect to a PC or other portable devices through the same connector.
PCI Express (Peripheral Component Interconnect Express), officially abbreviated as PCIe, is a computer expansion card standard designed to replace the older PCI and PCI-X, bus standards. PCIe has numerous improvements including higher maximum system bus throughput, lower I/O pin count and smaller physical footprint, better performance-scaling for bus devices, a more detailed error detection and reporting mechanism, and native hot plug functionality. Conceptually, the PCIe bus is like a high-speed serial replacement of the older PCI/PCI-X bus,an interconnect bus using shared address/data lines. Format specifications are maintained and developed by the PCI-SIG (PCI Special Interest Group), a group of more than 900 companies that also maintain the Conventional PCI specifications. PCIe 3.0 is the latest standard for expansion cards that is available on mainstream personal computers.
Capacity Per lane (each direction): v1.x: 250 MB/s (2.5 GT/s) , v2.x: 500 MB/s (5 GT/s) , v3.0: 1 GB/s (8 GT/s) 16 lane slot (each direction): v1.x: 4 GB/s (40 GT/s) , v2.x: 8 GB/s (80 GT/s) , v3.0: 16 GB/s (128 GT/s) Multichannel serial design increases flexibility by allocating slow devices to fewer lanes than fast devices.
Serial bus : The serial format was chosen over a traditional parallel format due to the problem of timing skew. Because signal paths across an interface have different lengths, parallel signals transmitted simultaneously arrive at their destinations at slightly different times. Means the bits of a single word do not arrive at their destination PCIe is just one example of a general trend away from parallel buses to serial interconnects.
REFERENCES
"The I2C Specification," Version 2.1, Philips Semiconductors. Goldie, John, "Summary of Well Known Interface Standards," Application Note AN-216, National Semiconductor. http://www.eeherald.com/section/design-guide/esmod7.html http://www.sata-io.org - Serial ATA organisation http://www.xilinx.com/publications/archives/books/serialio.p df http://www.eetimes.com/discussion/beginner-scorner/4023908/Introduction-to-Serial-Peripheral-Interface http://www.icron.com/media/articles/usb-popularity.php http://www.usb.org/home http://www.i2c-bus.org/ http://www.pcisig.com/specifications/pciexpress/
THANK YOU