0% found this document useful (0 votes)
24 views18 pages

Communication Interfaces Overview

The document discusses various communication interfaces essential for embedded systems, categorized into onboard and external interfaces. Onboard interfaces include I2C, SPI, CAN, and Parallel interfaces, while external interfaces cover RS232, RS485, USB, Infrared, Bluetooth, Wi-Fi, ZigBee, GPRS, and GSM. Each interface is described with its features, applications, and operational principles.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views18 pages

Communication Interfaces Overview

The document discusses various communication interfaces essential for embedded systems, categorized into onboard and external interfaces. Onboard interfaces include I2C, SPI, CAN, and Parallel interfaces, while external interfaces cover RS232, RS485, USB, Infrared, Bluetooth, Wi-Fi, ZigBee, GPRS, and GSM. Each interface is described with its features, applications, and operational principles.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

35

UNIT-3
COMMUNICATION INTERFACE
Contents: Onboard Communication Interfaces-I2C, SPI, CAN, Parallel interface; External
communication interfaces-RS232 and RS485, USB, Infrared, Bluetooth, Wi-Fi, ZigBee,
GPRS, GSM.
INTRODUCTION
A communication interface (CI) is essential for an ES to communicate with its subsystems or
with external world. There are two types of CIs for an ES: Onboard CIs and External CIs.
Onboard Communication Interfaces:
Communication channels or buses used to connect various ICs and peripherals within the ES
are called Onboard Communication Interfaces. They are also called “Device/Board Level
Communication Interfaces”.
Examples:

1. Inter-Integrated Circuit (I2C or I2C) Bus


2. Serial Peripheral Interface (SPI) Bus
3. Controlled Area Network (CAN)
4. Parallel Interface

External Communication Interfaces:


They can be either wired media or wireless media and they can be a serial or parallel interfaces.
They are also called “Product Level Communication Interfaces”.
Examples:

1. RS-232C & RS-485


2. Universal Serial Bus (USB)
3. Infrared
4. Bluetooth
5. Wi-Fi
6. ZigBee
7. GSM
8. General Packet Radio Service (GPRS)
36

ONBOARD COMMUNICATION INTERFACES


1. INTER-INTEGRATED CIRCUIT (I2C)
I2C is a synchronous, bi-directional, half duplex, two-wire interface bus used for serial
communication.
An I2C is also called IIC or I2C. it was designed by Philips Semiconductors in 1982.
Originally it was used for connecting a μP/μC system and the peripheral ICs in TV sets. Now
it is a widely used protocol for short-distance communication.
I2C is used to connect microcontrollers, EEPROMs, I/O interfaces, and other peripheral
devices in an embedded system. A microcontroller is often used as the ‘master device’, and
peripheral devices are used as ‘slave devices’.
At the physical level it consists of two wires: SCL (clock line) and SDA (data line). SCL is
responsible generates clock pulses and SDA transmits the serial data across the devices.
Device connected to I2C bus acts either as ‘Master’ device or as ‘Slave’ device. I2C supports
multi masters on the same bus. A master/slave can act either as a transmitter or a receiver.
Master generates the clock pulses and also controls the communication. It initiates/terminates
data transfer, sends data and generates the necessary synchronizing clock pulses. Slave devices
wait for the commands from the master and respond upon receiving the commands.
Interface diagram in Fig. 1 illustrates the connection of master and slave devices on I2C bus.

Fig. 1: I2C Bus Interfacing


37

Sequence of operations for communicating with an I2C slave device:

1. First, master makes SCL = high and SDA = low. It is the ‘START’ condition for data
transfer.
2. Master sends 7-bit or 10-bit address of the slave on SDA line, and clock pulses on SCL
line for synchronization. The
3. Master sends data on the bus. It sends MSB first. This data is valid when clock pulse is
‘HIGH'.
4. Master sends Read bit ‘1’ or Write bit ‘0’ as per the need.
5. Slave receives it and sends acknowledge bit ‘1’ on SDA line.
6. Master receives the acknowledge bit.
7. If write operation is requested, master sends 8-bit data to slave on SDA line. slave sends
acknowledgement bit to master.
8. If read operation is requested, slave sends data to master on SDA line. Master sends
acknowledgement.
9. Master terminates the transfer by making SDA line high when SCL is high. It is STOP
operation.

Data rates supported by I2C:

 Standard mode: Data rate up to 100 Kbps


 Fast Mode: up to 400 Kbps
 High speed mode: up to 3.4 Mbps

Applications of I2C
 Reading some memory ICs.
 Accessing DACs and ADCs.
 Transmitting and controlling user-directed actions.
 Reading hardware sensors.
 Communicating with multiple microcontrollers.
2. SERIAL PERIPHERAL INTERFACE (SPI) BUS

SPI bus is a synchronous, bi-directional, full duplex, four-wire used for serial
communication.
38

The concept of SPI was introduced by Motorola. SPI is a single master multi-slave system. It
is possible to have more than one master. But only one master device should be active at any
given point of time. SPI requires 4 signal lines for communication. They are:

 Master Out Slave In (MOSI): It carries the data from master to slave device.
It is also known as Slave Input/Slave Data In (SI/SDI).
 Serial Clock (SCLK): It carries the clock signals.
 Master In Slave Out (MISO): It carries the data from slave to master device.
It is also known as Slave Output/Slave Data Out (SO/SDO).
 Slave Select (SS): It is an active low signal used to select the slave device.

The bus interface diagram shown in Fig. 2 illustrates the connection of master and slave devices
on the SPI bus.

Fig. 2: SPI Bus Interfacing


The master device generates clock signals and selects the required slave device by making its
select signal ‘LOW’. The data out line MISO of all the slave devices floats at high impedance
state, when not selected.
SPI devices contain the following registers for holding these configurations.

 Serial peripheral control register’ to hold configuration parameters like master/slave


selection, baudrate, clock signal control, etc.
39

 Status register to holds the status of various conditions for transmission and reception.

Working Principle:

 SPI works on the principle of ‘Shift Register’ (SR). The master and slave devices
contain a special SR for transmitting and receiving data. The size of the shift register is
device dependent. Normally it is a multiple of 8-bits.
 During transmission from the master to slave, the data in SR of master is shifted out to
the MOSI pin of the slave device. At the same time the shifted-out data bit from the SR
of slave enters the SR of the master device through MISO pin.
 In summary the SRs of master and slave devices form a circular buffer. Some devices
are configurable to select LSB/MSB as first bit to send.

When compared to I2C, SPI bus is most suitable for applications requiring transfer of
data in streams. The only limitation is SPI doesn’t support an acknowledgement
mechanism.
3. CONTROLLED AREA NETWORK (CAN)
CAN is a serial communication protocol used over a pair of wires. It is used in many real-
time applications. It was developed by Robert Bosch to provide communication among various
electronic components of vehicles.
Later it was extended to automation and industrial applications. CAN specification doesn’t
specify the layout and structure of the physical bus. But a device connected to CAN bus is able
to transmit on the physical bus.
CAN protocol defines data packet format and transmission rules ---

 To prioritize messages
 Guarantee latency times
 Handle transmission errors
 Retransmit corrupted messages
 Distinguish between a permanent failure of a node versus temporary errors

Important characteristics of CAN Protocol

o Used in cars, buses, trucks and aircrafts in (i) Safety systems like airbag control (ii)
Antilock Brake System (ABS) (iii) Navigational systems like GPS.
o Real-time support.
o Offers medium speed (up to 125 Kbps) and high speed (up to 1 Mbps) data transfer.
40

o Has 11-bit addresses


o Error handling mechanism

Error correction in CAN:


Error correction is typically done by a ‘retransmission and acknowledgement’ protocol.
Here transmitter sends a data packet and expects to receive an acknowledgement from the
receiver indicating that transmission is correct. If an acknowledgement is not received in a
specified time, the transmitter retransmits the data packet and waits for a second
acknowledgement.
Applications of CAN:

 Used in cars, buses, trucks and aircrafts in (i) Safety systems like airbag control (ii)
Antilock Brake System (ABS) (iii) Navigational systems like GPS.
 Elevator Controllers
 Photo Copiers
 Medical instruments
 Production line control systems

4. PARALLEL INTERFACE
Parallel Interface is used for communicating with peripheral devices which are memory
mapped to the host processor. Fig. 3 illustrates the interfacing of devices using parallel
interface.
41

Fig. 3: Parallel Interface bus


Important Features of Parallel Interface bus:

 Host processor has a parallel bus and control over read/write signals.
 Communication is controlled by ‘control signal interface’ between host and device.
 Read’ and ‘Write’ signals control the direction of data transfer It also provides control
signals.
 Each device connected to the processor is assigned a range of addresses.
 When the address selected is in this range, a decoder circuit activates the chip select
line. Thus, the device becomes active.
 Here, processor initiates the parallel communication. If device wants to initiate
communication, it sends an interrupt signal to the processor.
 Parallel data communication offers highest speed for data transfer.
 Width of the parallel interface can be 4-bit, 8-bit, 16-bit, 32-bit or 64-bits. It must match
with the width of the data bus of the processor
42

EXTERNAL INTERFACES
1. RS-232 C & RS-485
RS-232 C stands for Recommended Standard number 232, revision C. RS-232 and RS-232C
are almost same. The names are used interchangeably.
Important features of RS-232:

 RS-232 is a legacy, full duplex, wired and communication interface.


 It extends the UART communication signals for external data communication.
 It was developed by the Electronic Industries Alliance (EIA) in early 1960s.
 In addition to ‘Transmit’ and Receiver’ signal lines, RS-232 interface defines various
handshaking signals (e.g., RTS – Request to Send, CTS – Clear to Send) and control
signals for communication.
 RS-232 supports 2 different types of connectors, namely, DB-9 (9-Pin connector) and
DB-25 (25-Pin connector), as shown in Fig. 4 (a) and 4 (b).

Fig. 4 (a): DB-9Connector Interface

Fig.4 (b): DB-25 Connector Interface


 It supports data rates up to 1 Mbps and distance up to 50 ft.
 It supports only point-to-point communication. It is not suitable for multipoint
communication.

Applications of RS-232C:
43

 Most PCs had RS232 compatible serial ports. They were used to connect peripherals
such as keyboards, mice, and printers to the computers.
 It was most popular during the olden days before the advent of Bluetooth, USB, etc. It
is still popular in some legacy applications.

RS-485:

 It is also called ‘TIA-485’ or ‘EIA-485’.


 RS-485 standard allows for long cabling distances in electrically noisy environments.
 Uses balanced signalling.
 One transmitter can be connected up to 32 receiving devices on the bus.

Applications of RS-485:

 Defining the electrical characteristics of drivers and receivers in serial communications


systems.
 Building automation.
 Interconnecting security control panels and devices.
 Video surveillance systems.

Comparison of RS-232 and RS-485:


Feature RS-232 C RS-485
1. Signalling Single ended signalling Balanced signalling
2. Type of communication Point to point Multipoint
3. Mode of operation Simplex or full duplex Simplex or half duplex
4. Max. Cable length 50 feet 4000 feet
5, Max. data rate 1 Mbps 10 Mbps

2. USB
USB stands for Universal Serial Bus. It is a wired high-speed bus used for serial data
communication. It was released in 1995 by the USB core group members organizations.
“[Link]” is the standards body for defining and controlling the standards for USB
communication.
Important features of USB:
(i) Topology and hubs:
44

 It follows a tired-star topology with a USB host at the center and one or more peripheral
devices connected to it. In place of any peripheral device, we can connect another USB
which supports some more peripherals. This type of connection is called a hub.
 Host and peripherals are connected by using cables.
 USB cable supports a distance up to 5 meters.
 USB transmits data in packets with standard data format.

(ii) USB Host Controller (Interface):


The USB host controller is an interface which:

 Manages and controls driver software


 Manages bandwidth required by peripherals connected to the bus.
 Allocates electrical power to the USB devices. So, we don’t need AC power box for
many devices.
 Packetizes and formats data.

(iii) PID and VID:


Each USB device contains a Product ID (PID) and a Vendor ID (VID), which are used for
loading the device drivers. These IDs are embedded into the USB chip by the USB device
manufacturer.
(iv) Types of data transfer supported by USB:

 Control transfer: Used to query, configure and issue commands to the USB device.
 Bulk transfer: Used to send a block of data to a device (e.g., transferring data to a
printer). It supports error checking and correction.
 Isochronous data transfer: Used for real-time data communication, where data is
transmitted as streams (e.g., frames in TV). It doesn’t support error checking and
retransmission of data.
 Interrupt transfer: Used for transferring small amounts of data (e.g.: data from mouse
and keyboard).

(v) Data rates supported by USB:

 USB 1.0/Low-Speed: 1.5 Megabits per second (Mbps)


 USB 1.1/Full-Speed: 12 Mbps.
 USB 2.0/Hi-Speed: 480 Mbps.
 USB 3.0/SuperSpeed: 5 Gbps.
45

 USB 3.1/SuperSpeed: 10 Gbps.

3. INFRARED (IrDA)

 IrDA stands for Infrared Data Association. It provides specifications for a set of
protocols for wireless infrared (IR) communications.
 Infrared technology is a serial, half duplex, wireless technology for data communication
between devices.
 Infrared waves are used for transmitting the data.
 IrDA standards have been used to install several low-cost, short-range communication
systems in laptops, printers, handheld PCs, and PDAs.
 The IrDA protocol contains Physical Layer, Media Access Control (MAC) and Logical
Link Control (LLC). The physical layer defines the physical characteristics of
communication like range, data rate, power, etc.
 It supports point-to-point and multipoint communications using line of sight
propagation.
 Its typical communication range is 10 cm to 1m. The range can be increased by
increasing the transmitting power of the IR device.
 It supports data rates ranging from 9600 bit/seconds to 16 Mbps.
 An Infrared LED is used as transmitting source, while a photodiode acts as receiver.
 Sometimes same device can be used as transmitter and receiver (e.g.: Mobile phone).
Then such device is called a transceiver.
 Certain devices always require unidirectional communication. So, they have separate
transmitter and receiver. For example, in TV remote control device, the remote-control
device contains the transmitter unit and TV contains the receiver unit.

Advantages of IrDA:

 Inexpensive, secure and fast.


 Easy to use the devices.
 Less power consumption.
 Good bandwidth.

Disadvantages:

 Uses line of sight propagation.


 Devices cannot be move around while transmission is in progress.
46

 Not suitable for long distance applications.

Applications of IrDA:

 IrDA is in use from the olden days of communication. The remote control of your TV
or VCD player use IrDA.
 It was the transmission channel in mobile phones before Bluetooth’s existence. Even
now, most of the mobile phone devices support IrDA.
 Popularly used in low-cost, short-range communication systems in laptops, printers,
handheld PCs, and PDAs.

4. BLUETOOTH

 It is a low-cost wireless technology used for data and voice communications.


 It operates at 2.4 GB and supports a data rate up to 1Mbps.
 It supports only a range of around 10 meters (30 feet).
 A Bluetooth device can function either as a master or as a slave.
 Each Bluetooth device will have a 48-bit unique address.
 Bluetooth supports point-to-point and multipoint communication.
 Bluetooth communication follows packet-based data transfer and uses Frequency
Hopping Spread Spectrum (FHSS) technique for communication.
 Piconet: When a network is formed with one master and many slaves, it is called
Piconet. A Piconet consists of one master and a maximum of 7 slave devices.
 Scatternet: Piconets can be combined to form a network called a scatternet. A slave in
one piconet may act as the master in another piconet.

Advantages of Bluetooth:

 Used for voice and data transfer.


 No interference from other wireless devices.
 Low power consumption.
 Easily upgradeable.
 Relatively low cost.

Disadvantages:

 It can sometimes lose its connection.


47

 It has low bandwidth as compared to Wi-Fi.


 Lower bandwidth.
 Due to security issues, it can be hacked.

Applications of Bluetooth: Bluetooth is popularly used in:

 Laptops, notebooks and PDAs


 Printers
 Wireless mice and keyboards
 Mobile phones
 Wireless headsets
 Hearing aids
 Fitness devices (Apple watches)
 Video games and toys
 MP3 players

5. WI-FI

Wi-Fi stands for wireless fidelity. It is a wireless technology used to connect computers,
laptops, smartphones and other devices to the internet. Wi-Fi follows the IEEE 802.11
standard.
Important Features of Wi-Fi:

 It is intended for network communication and it supports Internet Protocol (IP) based
communication, where each device is identified by a unique network address called ‘IP
address’.
 Wi-Fi based communications require an intermediate agent called Wi-Fi
router/Wireless access point (WAP) to manage the communications.
 Wi-Fi router is responsible for
 Restricting the access to a network
 Assigning IP address to a device on the network
 Routing data packets to the intended devices on the network.
48

 Wi-Fi enabled devices contain a wireless adaptor for transmitting and receiving data in
the form of radio signals through an antenna. The hardware part of it is known as Wi-
Fi Radio.
 Wi-Fi operates at 2.4 GHz or 5 GHz of radio spectrum and co-exists with other ISM
band devices like Bluetooth.
 Wi-Fi supports data rates ranging from 1 Mbps to 150 Mbps and access/modulation
method.
 Depending on the type of antenna and usage location (indoor/outdoor), Wi-Fi offers a
range of 100 to 300 feet.
 When its Wi-Fi radio is turned ON, Wi-Fi device searches Wi-Fi network in its vicinity
and lists out the Service Set Identifier (SSID) of the available networks. If the network
is security enabled, a password may be required to connect to a particular SSID.
 Wi-Fi employs different security mechanisms like Wired Equivalency Privacy (WEP),
Wireless Protection Access (WPA), etc., for securing the data communication.

Applications of Wi-Fi:

 Business applications
 Mobile applications
 Computer applications
 Automotive applications
 Video conference

6. ZIGBEE

ZigBee is a low-cost and low-power wireless communication technology based on a simple


protocol. It has been developed for Wireless Personal Area Networks (WPANs).
It uses mesh network topology, where every device in the network is connected to every other
device. Each device acts as a router and it increases the reliability of the entire network.
ZigBee device falls under anyone of the following device categories.

i. A ZigBee Coordinator (ZC) Which acts as the root of the ZigBee Network.
ii. A ZigBee Router (ZR) for passing information from a device to another device or
another ‘ZC’.
iii. ZigBee End Device (ZED) that contains ZigBee functionality for data communication.
It can talk only with a ZR or ZC.
49

Fig. 5 shows a ZigBee network model.

Fig. 5: ZigBee network model


ZigBee alliance ([Link]) is the monitoring organization for development,
standardization and certification of ZigBee standard.
Specifications of ZigBee:

o Standard: IEEE 802.15.4


o Frequency: It operates worldwide in the unlicensed bands-868 to 869.6 MHz, 902 to
928 MHz, and 2.4 to 2.484 GHz. For home automation, 2.4 GHz is used.
o Operating Range: Up to 100 meters
o Data Rate; 20 kbps to 250 kbps

Advantages of ZigBee

 Low-cost.
 Low power consumption.
 High efficiency (due to long battery life).
 Simple installation, monitoring and control

Disadvantages of ZigBee:

 Prone to network interferences and so less security


 Short range communication.
 Low data rate compared to Bluetooth and Wi-Fi.
 Implementation is costly.
50

Applications of ZigBee:

 Home automation: Controlling lighting, heating, ventilation, air conditioning and


electronic appliances
 Security and surveillance: Smoke detectors, water and gas leakage detectors, intruder
alarms, fire alarms, etc. in home/office.
 Industrial automation and control: Automatic meter reading, energy management,
security over power theft, remote temperature monitoring
 Medicine: Remote patient monitoring, medical data collection, healthcare devices
 Other applications: Fitness trackers, electronic shopping tags, RFIDs and asset
tracking.

7. GSM
The concept of GSM was conceived in Bell Laboratories in early 1970s. GSM stands
for Global System for Mobile Communication. GSM is a digital cellular 2G technology used
for transmitting voice and data over mobile network. It also provides roaming service,
i.e., your GSM phone number can be used in another GSM network. GSM is also the name
of a standardization group to create a common European mobile telephone standard.

Important features of GSM:


 Type of switching: GSN uses a circuit-switched network.

 Frequencies: It operates in the mobile communication bands 900 MHz and 1800
MHz.

 Access methods: Combines TDMA and FDMA.

 Modulation: Gaussian Minimum Shift Keying (GMSK) modulation

 Data rate: Up to 9.6 Kbps

 Channel spacing: 200 KHz


 Compatibility: It is compatible with ISDN and other telephone company services.

 GSM devices: Mobile telephones, PCMCIA cards, embedded radio modules, and
external radio modems.

GSM Services:
 Teleservices: Telephony, Videotext, Facsimile and SMS

 Data services: Send and receive data through a GSM phone.

 Supplementary Services: Conferencing, Call waiting, Call Holding, Call Forwarding,


Number Identification.

Advantages of GSM:
51

 Worldwide connectivity and extensive coverage.


 GSM signals don't have any deterioration.
 No roaming charges on international calls.
 The mobile phone works based on the SIM card. Thus, user can easily change his
phone.
 It can be easily integrated with other wireless technologies such as CDMA and LTE.
 Ability to use repeaters.
 More talk time due to the pulse nature of transmission.
Disadvantages of GSM:
 It has the problem of interference (e.g., Interference in hearing aids). As a result,
many locations, such as hospitals, airports and petrol pumps require cell phones
to be turned off.
 Needs repeaters to increase coverage.
 Low data rate (9.6 Kbps).
 No end-to-end encryption of user data.
 Several incompatibilities within the GSM standards.
8. GENERAL PACKET RADIO SERVICE (GPRS)
GPRS is a packet-based wireless communication technology used in 2G and 3G cellular
networks. In this, data is divided into packets at the transmitting end and transmitted across the
mobile network like GSM. At the receiver end, the packets are received and assembled to
recover the original information.
GSM vs GPRS: GSM is a digital cellular 2G technology used for transmitting mobile voice
and data services globally. GPRS is basically an up-gradation of the GSM. It uses Time
Division Multiple Access (TDMA) to share the channel.
Important Features of GPRS:

 GPRS technology is faster than GSM (Data rate of GSM is about 9.6 Kbps, while that
of GPRS is about 14.4 to 115.2 Kbps).
 GPRS provides 124 channels with 200 KHz spacing.
 It provides an uninterrupted connectivity to the internet for mobile phones and
computers. Moreover, services will be easy and quick to access.
 It provides voice and data services globally.
52

 Eight different users could share the same uplink and downlink channels. Each is
divided into eight time slots. These time slots are dynamically allocated to various users
as and when needed.
 GPRS is also known as GSM-IP (Global-System Mobile Communications-Internet
Protocol). It supports Internet Protocol (IP), Point to Point Protocol (PPP) and X.25
protocols for communication.
 It uses one or more frequency-bands the radio supports (850, 900, 1800, 1900 MHz).
 The GPRS specifications are written by the European Telecommunications Standard
Institute (ETSI).
 GPRS is an old technology and it is being replaced by new techniques like EDGE
(Enhanced data rates for GSM evolution), HSDPA (High Speed Downlink Packet
Access), etc. which offer higher bandwidths for communication.

GPRS services:

 SMS-messaging & broadcasting services


 Multimedia messaging service (MMS)
 Mobile services: Provides constant voice and data communications, while on
the move.
 Push-to-talk over cellular: A push button is used to switch from voice reception
mode to transmit mode like in walkie talkie.

Advantages of GPRS:
 Provides high data rate than GSM.
 Un-interrupted internet access
 Fast connection set up.
 Supports bursty applications like email, broadcasting, web browsing, etc.
 High bandwidth.
 Used for point to point and multipoint communications.
 Users send or receive voice calls while browsing the internet or downloading data.
Thus, users can have both voice call and data call together.

Disadvantages of GPRS:

 Speed is much lower in reality.


 The data rates are slower when compared to the latest technologies.

You might also like