Serial Communication Protocols v0.1

Embed Size (px)

Citation preview

  • 8/3/2019 Serial Communication Protocols v0.1

    1/20

    SERIAL COMMUNICATION

    PROTOCOLSAn Overview

    Presenter Mrs. Anagha Shinde

    Guide Mrs. S.H.Rajput

  • 8/3/2019 Serial Communication Protocols v0.1

    2/20

    INDEX

    About Serial Communication

    Brief History

    Parallel Vs. Serial

    Typical HW Architecture

    Leading Serial Protocols

    RS232

    I2C

    SPI USB

    PCIe -Best of both worlds

    References

  • 8/3/2019 Serial Communication Protocols v0.1

    3/20

    ABOUT SERIAL COMMUNICATION

    In telecommunication and computer science, serial communicationis the process of sending data one bit at a time, sequentially, over acommunication channel or computer bus.

    The concept of serial communication is simple. The serial port sendsand receives bytes of information one bit at a time. Although this isslower than parallel communication, which allows the transmission of

    an entire byte at once, it is simpler and you can use it over longerdistances. 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, canextend as much as 1200m (4000ft).

    Serial communication is used for all long-haul communication andmost 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 innewer serial technologies have begun to outweigh the parallel bus'sadvantage of simplicity.

  • 8/3/2019 Serial Communication Protocols v0.1

    4/20

    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 ofthe 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.

  • 8/3/2019 Serial Communication Protocols v0.1

    5/20

    PARALLELVS. SERIAL

    A parallel link transmits several streams of datasimultaneously along multiple channels (e.g., wires, printedcircuit tracks, or optical fibres); a serial link transmits asingle 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 thecase that serial links can be clocked considerably faster thanparallel 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 cheaperto implement. Many ICs have serial interfaces, as opposed toparallel ones, so that they have fewer pins and are thereforeless expensive.

  • 8/3/2019 Serial Communication Protocols v0.1

    6/20

    PARALLELVS. SERIAL

    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-anetwork. 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 clearwinner. "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.

  • 8/3/2019 Serial Communication Protocols v0.1

    7/20

    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: Allowsfor 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.

  • 8/3/2019 Serial Communication Protocols v0.1

    8/20

    LEADING SERIAL PROTOCOLS

    SONET and SDH (high

    speed telecommunicationover optical fibers)

    InfiniBand (very high speed,

    broadly comparable in scopeto PCI) Morse code telegraphy

    T-1, E-1 and variants

    (telecommunication over

    copper pairs)

    MIDI control of electronic

    musical instruments

    RS-232 (low-speed,

    implemented by serial ports)

    MIL-STD-1553A/BDMX512 control of

    theatrical lightingRS-422 /RS-423 /RS-485

    CAN SDI-12 industrial sensorprotocol

    I C

    FireWire Serial Attached SCSI SPI

    Ethernet Serial ATA ARINC 818 Avionics Digital

    Video Bus

    Fibre Channel (high-speed,for connecting computers to

    mass storage devices)

    SpaceWire Spacecraft

    communication network

    HyperTransport

    LIN Universal Serial Bus (USB)PCI Express

  • 8/3/2019 Serial Communication Protocols v0.1

    9/20

    RS232

    TIA/EIA-232-F (typically referred to as RS-232) is a common interface that can befound on almost every personal computer.

    RS-232 is capable of moderate distances (Cable lengths of 30 feet )at speeds up to20Kbps.

    An RS-232 bus is capable of full-duplex communication between tworeceiver/transmitter pairs, named data terminal equipment (DTE) and datacommunication equipment (DCE). Each one has a transmit signal that is connectedto 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. Betweenthese voltages, the value is undefined.

    Many embedded systems that use the RS-232 bus either interface with PCs or PCperipherals such as modems. Other systems use RS-232 so that bus traffic can bemonitored easily with an inexpensive protocol analyzer or a PC equipped with twoserial ports.

    Almost every microcontroller vendor has product that include hardware support forRS-232.

  • 8/3/2019 Serial Communication Protocols v0.1

    10/20

    RS232

    A timing diagram for an RS-232 frame consisting of one start bit, 7 data bits, oneparity 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 tosignal the end of a frame. Parity is used to detect transmission errors. Thereceiver 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 checksthe parity of the received frame. If the parity is wrong, then the receiver knowsan error occurred in transmission and the receiver can request that thetransmitter re-send the frame.

    In cases where the probability of error is extremely small, then it is customary toignore the parity bit.

    The bit time is the basic unit of time used in serial communication. It is the timebetween each bit.

    The baud rate is the total number of bits (information, overhead, and idle) pertime that is transmitted over the serial link. So we can compute the baud rate asthe reciprocal of the bit time.

  • 8/3/2019 Serial Communication Protocols v0.1

    11/20

    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 InterIntegrated Circuits is a bi-directional 2-wire bus standard for efficient inter-ICcontrol.

    I C bus is a multi-master bus, which means more than one IC/device capable ofinitiating a data transfer can be connected to it. The device that initiates thecommunication is called MASTER, whereas the device being addressed by theMaster is called as SLAVE. It is the master device who always do generation ofclock 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.

  • 8/3/2019 Serial Communication Protocols v0.1

    12/20

    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' signalto all of the connected devices. All ICs on the bus will listen to the bus forincoming data.

    Then the MCU sends theADDRESS of the device it wants to access, along with

    an indication whether the access is a Read or Write operation. Having receivedthe 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 addressmatches, however, the chip will produce a response called theACKNOWLEDGEsignal.

    Once the MCU receives the acknowledge, it can start transmitting or receivingDATA. When all is done, the MCU will issue the STOP condition. This is a signalthat the bus has been released and that the connected ICs may expect another

    transmission to start any moment.

  • 8/3/2019 Serial Communication Protocols v0.1

    13/20

    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 bythe 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.

  • 8/3/2019 Serial Communication Protocols v0.1

    14/20

    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.

  • 8/3/2019 Serial Communication Protocols v0.1

    15/20

    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 otherperipherals. 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.

  • 8/3/2019 Serial Communication Protocols v0.1

    16/20

    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 hasmigrated into consumer electronics and mobile products.

    The standard USB

    plug

    Pin 1 VCC (+5 V)

    Pin 2 Data-

    Pin 3 Data+

    Pin 4 Ground

  • 8/3/2019 Serial Communication Protocols v0.1

    17/20

    VARIOUS VERSIONS USB:

    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 inJanuary1996. 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 high-

    capacity 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.

  • 8/3/2019 Serial Communication Protocols v0.1

    18/20

    PCIE BEST OF BOTH WORLDS

    PCI Express (Peripheral Component Interconnect Express), officiallyabbreviated as PCIe, is a computer expansion card standard designed to replace the

    older PCI and PCI-X, bus standards. PCIe has numerous improvements includinghigher maximum system bus throughput, lower I/O pin count and smaller physicalfootprint, better performance-scaling for bus devices, a more detailed error detectionand reporting mechanism, and native hot plug functionality.

    Conceptually, the PCIe bus is like a high-speed serial replacement of the olderPCI/PCI-X bus,an interconnect bus using shared address/data lines.

    Format specifications are maintained and developed by the PCI-SIG (PCI SpecialInterest Group), a group of more than 900 companies that also maintain theConventional 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 tothe problem of timing skew. Because signal paths across an interface have differentlengths, parallel signals transmitted simultaneously arrive at their destinations atslightly different times. Means the bits of a single word do not arrive at theirdestination PCIe is just one example of a general trend away from parallel buses toserial interconnects.

  • 8/3/2019 Serial Communication Protocols v0.1

    19/20

    REFERENCES

    "The I2C Specification," Version 2.1, Philips

    Semiconductors. Goldie, John, "Summary of Well Known Interface

    Standards," Application Note AN-216, NationalSemiconductor.

    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.pdf

    http://www.eetimes.com/discussion/beginner-s-corner/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/

  • 8/3/2019 Serial Communication Protocols v0.1

    20/20

    THANK YOU