Ertc Unit 1 - Part2
Ertc Unit 1 - Part2
Communication Interfaces
CHAPTER OBJECTIVES
Afier reading this chapter, you will be able to:
Appreciate the need for communication interfaces
e Learn the details of various serial communication interfaces
host will
The embedded system needs to send data to a host (a PC or a workstation). The
analyse of data and present the data through a Graphical User Interface.
. The embedded system may need to communicate with another embedded system to transmit/
receive data. Providing a standard communication interface is preferable rather han providing
proprietary interface.
Network interfaces
. A number of embedded systems may need to be networked to share data.
need to be provided in such a case.
150
For each of these interfaces, we will discuss the hardware details and the protocol stack that needs to
be implemented in software.
6.2 RS232/UART
nco22i a srandard developed by Electronic Industry Association (ELA). This is one of the oldest and
er widely used communication interfaces. The PC will have two RS232 ports designated as COM1
and COM2. Most of the micro-controllers have an on-chip serial interface. The evaluation boards of
the processors are also connected to the host system using RS232
pS222 is used to connect a DIE (Data lerminal Equpment) to a Data Circuit Terminating Equipment
(DCE). A DTE can be a PC,
be anodem, mouse, digitizer orserial printer or a plotrer. DCE can
a scanner. RS232
In Brief... the physical layer interface only. The interface specifies
ohysical, mechanical, elecrical, and specifications describe the
standard
RS232Communicationis used for serial communication. procedural characteristics for
serial between
RS 232 is a standard for
to serial
two devices for speeds up
up to rransmitted serially. The comnmunication, i.e. the bits are
115.2 Kbps over distances
full duplex, i.e. the data communication between rwo devices is in
100 mneters. ransfer can take place in both
directions.
Communication Interfaces
151
Data rate: The rate at which data communication takes place. The PC supports various data rates such
as 50, 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200 bps. The oscillator
in the RS232 circuitry operates at 1.8432 MHz and it is divided by 1600 to obtain the 15280 data
rate.
Data bits: Number of bits transmitted for each character. The character can have 5 or 6 or 7 or 8
bits. If you send ASCII characters, the number of bits is 7.
Start bit: The bit that is prefixed to the data bits to identify the beginning of the character.
Stop bits: These bits are appended to the data bits to identify che end of character. If the data bits
are 7 or 8, one stop bit is appended. If the data bits are 5 or 6, two stop bits are appended.
Parity: The bit appended to the character for error checking The parity can be even or odd. For even
parity, the parity bit (1 or 0) will be added in such a way that the total number of bits will be even.
For odd parity, the parity bit will make the total number of bits odd. If the parity is set to none
che Darity bit is ignored. For example, if the data bits are 1010110, the parity bit is Oif even parity
is used; and the parity bit is 1 if odd parity is used. At the receiving end, the device will calculate
the parity bit and if the received parity bit matches with the calculated parity bit, it can be assumed
thar rhe dara is without errors. But thiS IS not the reality. If two bits are in error, the receiver cannor
derect that there is an error!
Flow Control: If one of the devices sends data at a very fast rate and the other device cannot absorb
the data at that rate, flow control is used. Flow control is a protocol to stop/resume data transmission.
This protocol is also known as handshaking. If you are sure thar
there will be no flow control problem, there is no need for
In Brief... handshaking. You can do hardware handshaking in RS232 using two
signals: Request to Send (RTS) and Clear to Send (CTS). When a
The communication parameters device has data to send, it asserts RTS and the receiving device
to be set for serial asserts CTS. You can also do sofrware handshaking a device can
Communication are: data rate, send a request to suspend data transmission by sending the character
number of data bits, number of Control S(0x13). The signal to resume data transmission is sent
stop bits, parity and flow using the character Control Q (Ox1). This software handshaking is
control. also known as XON/XOFE
152
Notes.
be transmitted
Communication using RS232 involves lot of overhead due to the additional bits to and
for 7-bit data, the additional bits to be transmitted are 1 start bit, 1stop bit 1 parity bit.
6.2.3 UART
format, not in serial
The processors process the data in parallel Universal
In Brief.. format. To bridge the processor and the RS232 port, UART has
Asynchronous Receive Transmit (UART) chip is used.
section. Receive section
Universal Asynchronous Receive [wo sections: receive section and transmit
format and
Transmit (UART) chip converts receives the data in serial format, converts it into parallel
section takes the data in
the parallel data received from gives it to the processor. The transtmit
serial format.
the processor into serial
format parallel format from the processor and converts it into
The UART chip also adds the start bit, stop bits and parity bit.
and sends it to RS232 level necessarv
shifter. It also takes the serial
RS23) level shifter Many micro-controllerS have on-chip UART. However, the
data from the conversion has to be done to meet the voltage levels of
voltage level
and converts into parallel
RS232. This is achieved using a level shifrer as shown in Fig. 6.1.
format.
RS232
Level
UART Shifter Connector
to T00
hoD2 standard specifies a distance of 19.2 meters, However, vou can achieve distances up
meters using RS232 cables. The data rates supported will be dependent on the UART chip and the
clock used.
such as MAX
iMOst ofthe processOrs including Digital Sienal Processors have on-chip UART. Cs
3222, MAX 324l of Maxim can be used as level shifters.
2
2
5
6
7 7
8
20e 20
(a) (b)
Eig A2 Null Modem Cable Connections: (a) 25-pin Connectors (b) 9-pin Connectors
To make rwo devices communicate with each other using KS232 interface, vou need to connecr the
rNO PCs using a null modem cable and set the communicatton parameters on both the devices you
Can experiment with vartous parameters for serial communtcatton using the HyperTerminal programn
n Windows. Fig. 6.3 shows the screenshot to set the serial
sCreen, you need to do thecommunication
following:
parameters. To obrain thiN
" Click on Start Menu
In Brief..
. Go to Programs
and
Using a null modem cable . Go to Accessories
Hyperlerminal program, you .
can establish serial
Go to Communications
Communication between two . Go to HyperTerminal
Windows
machines running the . Double click on
operaling system. HYPERTRM.EXE
156
int fd;
fd = Open(/dev/ttyS0",0 RDWR | o NOCTTYONDELAY) ;
if (fd -1)
return (fd) ;
tcgetattr (fd,&settings) ;
cfsetispeed (&settings, B9600); // Set baud rate to 9600
cfsetospeed ( &settings, B9600);
int n;
n
write (fd, C, strlen (c) );
if (n<0)
ptr = array i
while( (nbytes read (fd, ptr, array + sizeof (array) -ptr-1)) > 0)
ptr += nbytes;
if((ptr[-1] ==
\n') | (ptr[-1] ==
\r'))
break;
*ptr = \0';
printf ("Received String: %s",array) ;
close (fd) ;
lnt ma in (void)
int fd;
fd port open();
port Config (fd) ;
World") ;
Write data(fd, " Hello
read data (fd);
port close ( fd) ;
return 0;
can find
opens che serial port. /dev/ttyS0 is the device file, You
The function port open (void)installation in the /dev directory and use that file name instead of
Linux
out the device file of your
ldev/ttyS0. is to contigure the port parameters.
fd)
Ihe function port config (int fd, char *c) is to write data onto the port. The pointer to a
(int
The function write data this function.
is passed from
character array'
158
The function read data (int fd) is to read the data from the port.
The function port close (int fd) closes che port.
The main(void) function calls the functions to open rhe port, configure the port paratmeters, wTIte the
data, read the data and then close the port.
You can compile this program using the following shell command.
Note that the $ sign is the system prompt.
In Brief... $gcc serialcom.c
Serial communication The file a.out will be created. You can execute this file by giving the
command
programming involves opening
the device file, configuring the $./a.out
port by setting the
Communication parameters, The message "Hello World" will be displayed on che Windows system.
reading/writing data and then You can type some text on the Windows system and it will be
closing the port. displayed on che Linux system.
6.3 RS422/RS485
RS422 standard for serial communication is used in noisy environments. Using this standard interface,
the distance berween two devices can be up to 1200 meters. Twisted copper cable is used as the
transmission medium. Unlike RS232 in which the voltage levels are measured with reference to local
ground, in RS422, voltage difference between the two copper wires represents the logic levels. Hence,
RS422 uses balanced transmission. Two channels are used for transmit and receive paths. As compared
to RS232, RS422 is better suited to work in noisy environments over
In Brief... longer distan ces because of balanced transtmission.
RS485 is a variation of RS422 to connect a number of devices in
In RS422 and RS485, twisted a network. An RS485 controller chip is used on each device. A
copper pair is used as network using RS485 protocols operates in a Master/Slave
transmission medium. The configuration. Up to 512 devices can be networked. Using one twisted
voltage difference between the pair, half-duplex communication can be achieved and using two tWisted
two wires represents logic levels, pairs, full-duplex communication can be achieved.
i.e. balanced transmission is
used and hence this Chips such as MAX3488 are used for RS422. MAX 3483 is an RS
transmission is immune to 485 controller for half-duplex communication and MAX 3491 is for
noise. full-duplx communication.
6.4 USB
Universal Serial Bus has gained im1nense popularity in recent years. Desktops, laptops, printers, display
asiiees video cameras, hard disk drives, CDROM drives, audio equipment etc. are now
ISB interface. Using USB, a number of devices can be networked using Master/Slaveavailable with
A bosr such as the PC, is desigrnated as a master. As showWn in Fig. 6.4, a number ofarchitecture.
nam of 127, can be connected in the form of an inverted tree. On the host.
devices, up
such as a PC.
Communication Interfaces
159
to connect up to 127 devices to to connect other USB devices. A USB device can be self-powered,
a host. A USB device can be or powered by the bus. USB can supply 500 mA current to the
self-powered, or it can be devices.
powered by the bus.
USB
Host
Controller
USBY
USB
Printer
Keyboard
USB Hub
USB
USB
Digital Camera
Scanner
Device classes: Each USB device has a unique ID (between 1and 127) and a device descriptor that
provides information about the device class and its properties. The
device classes are display, communication, audio, mass storage and
In Brief human interface (such as keyboards, front panel knobs, control pancls
in VCR, data gloves etc.).
USB1.1 supports data rates of Providing aUSB interface to an embedded system is just to integrate
12 Mbps and 1.5 Mbps. a USB chip such as USS-820D of Agere Systems. Maxim's MAX
USB2.0 supports 480 Mbps 3450E, 3451E and 3452E are some of the USB transceivers.
data rate. Communication is in
the form of packets. USB USB is a powerful, versatile and simple communication interface.
supports plug and play feature So, not surprisingly, many peripherals are now provided with a USB
as well as hot insertion.
interface. RS232 will be confined to the technology museums.
6.5 Infrared
Infrared interfaces are used in remote control units of TV, VCR, air-conditioner, etc. However rhese
interfaces are all based on proprietary protocols. Infrared Data Association (IrDA a non-profit
industry association (www.irda.org) founded in T993, released the specifications for low-cost infrared
communication between devices. Intrared nterfaces are now commonplace for a number of devices
Such as palmtops, cell phones, digital cameras, printers, keyboards, mice, LCD projectors. ATM
entds erc Infrared interface provides a loW-COSt, Short range,
berween two devices. The only drawback point-to-point communication
onerares in line of sight with infrared is thar it
In Brief.. through walls. It supportscommunication
only dara.
mode and it cannot penetrate
The block diagram of IrDA module is
Infrared is a low-cost, point
to-point communication protocol architecture is shown in Fig.shown in Fig. 6.5(a) and rhe
mechanism for short ranges.
6.5(a), the device will have an infrared 6.5 (b). As shown in Fig.
transceiver. The transmirter
Communication Interfaces 161
is a LED and the receiver is a photodiode. Agilent's HSDL-1001 can be used as a transceiver. For
low data rates, the processor of the embedded system itself can be used whereas for high data rates,
aifferent processor may be needed.
The data to be sent on the infrared link is packetized and encoded as per the IrDA protocols and sent
over the air to the other device. The receiving device will detect the signal, decode and depacketize
the data.
Transceiver
Processor UART / Packetizer Encoder I Decoder LED, Photodiode
Higher Layers
(Application, IrCOMM)
Physical Layer
(IrLMP)
In spite of its limitations such as short rane. low data rates and point-to-point communication,
Intrared IS a very popular communication interface for consumer items and office automation equlpment
because of its low cost.
Notes..
Intrared communication using irDA standards provides interoperability between IR ports suppled
by different manufacturers. The present IR ports of TVs, air-conditioners etc. do not suppon tiese
standard protocols.
Digital
Cemera
Transaction Layer
Bus Management
Resource
Data Link layer Management
Node Control
Physical Laver
Data link layer: The layer takes care of packet delivery, acknowledgements and addressing of the
devices.
Transactiòn layer: This layer handles the writing and reading of the data from the devices.
Management protocols: These protocols are used to manage the bus and chey run on each of the
devices. These protocols do the necessary resource management and control the nodes.
Many consumer appliances are being provided with IEEE 1394 interface. Note that this interface itself
is an embedded system.
6.7 Ethernet
Ethernet interface is now ubiquitous. It is available on every desktop and laptop. With the availability
of low-cost Ethernet chips and the asso ciated protocol stack, providing an Echernet interface is very
easy and useful to the embedded system. Through the Ethernet interface, the embedded system can
be connected to the LAN. So, a number of embedded systems in a man ufacturing unit can be
connected as a LAN; and, another node on the LAN, a desktop computer, can monitor all these
embedded systems. The data collected by an embedded system can be transferred to a database on che
LAN.
The Ethernet interface provides the physical layer and data link layer functionality. Above the data link
layer, the TCP/IP protocol srack and the application layer protocols will run. This protocol architecture
is shown in Fig. 6.7.
164
Application Layer
(SMTP FTP HTTP)
TCP Layer
IP Layer
Physical Layer
Notes.
In Ethernet, the data link layer is divided into two sub-layers-Medium Access Control (MAC)
sub-layer and Logical Link Control (LL) sub-layer. MAC sub-layer faciltates muliple nodes lo
access the medium using CSMA/CD protocol. LLC sub-layer defines the protocols for link
establishment, flow control and error ontrol.
AP
Motupot
Backbone
Network
AP
BSS
AP
Hotspot
BSS
Hotspot
Laptop
Random
backoff
DIFS
Medium Busy Frame
SIFS
DIFS
Access
Point
6.9 Bluetooth
A [ypical office cabin or a home or even a car is equipped with a number of electronic gadgets such
desktop, laptop, printer, modem, mobile phone, etc. These devices are interconnected through wires
for using a service (e.g. a print service) or for sharing information (e.g. transferring a file from desktop
to laptop). These devies form a Personal Area Network (PAN). When we bring two devices, say a
laptop and a mobile phone, close to cach other, these two can automatically form a network and
168
xchange data. For example, we can transfer the address book from the mobile phone to the laptop.
termed as ad-hoc
are
ne networks, formed spontaneously by comine closer of two or more devICes, any timne are not fixed
nerworks. In an ad-hoc nerwork. the topology and the nunber of nodes at
of nodes in the network may also
the topology may change dynamically with time: and the nunber such networks can be avoided if
Change With timc. All the headaches associated with administeringalso if one device can find out the
these devices are made to communicate throuch radio links and
can discover other devices). The
presence of othet devices and thcir capabilities (i.e. if one device
need for such PANs is evervwhere-in office cabins, at homes arnd also in cars.
Notable among them are Bluetooth, IrDA
A number of technologies have been proposed for PANS. wireless connectiVity to
and TEEE 802.ll. Bluetooth holds a great promise because it can provide
embedded systems at a very low cost.
The salient features of Bluetooth technology are:
as a cable connection. Since most of
" lt is a low-cost technology-its cost will soon be as low
the Bluetooth-enabled devices have to operate through a battery, the power consumption is also
verv low.
not controlled by any
" lt is based on radio transmission in the ISM band. ISM band is
Bluetootin radio systems.
government authority and hence no special approval is required to use
meters, though with
" It caters to short ranges. The range of a Bluetooth device is typically 10
higher power, the range can be increased to 100 meters.
large number of
" It is based on open standards formulated by a consortium of industries and a
equipment vendors are committed to this technology.
Bluetooth Special Interest Group (SIG) founded in February 1998 by Ericsson, Intel, IBM, Toshiba and
Nokia released version 1.0 of Bluetooth specifications in July 1999. Version 1.1 of Bluetooth
specifications was released in February 2001.
Most of clectronic devices can be Bluetooth-enabled. These include a PC, laptop, PDA, digital camera.
mobile phone, pager, MP3 player, headset, printer, keyboard, mouse, LCDprojector, domestic appliances
such as TV, microwave oven, music players etc. To make a device Bluetooth-enabled, a module
containing the Bluetooth hardware and firmware is attacked to the device. And, a piece of software
is run on the device. A Bluetooth-enabled device communicates with another Bluetooth-enabled device
over the radio medium to exchange information or transfer data.
Communcation Interfaces 169
Desktop
Call Phone
PM3 Player
Digital
Camera
Microwave Oven
Laptop
.e. the radio should provide a link which ensures rhar rhere will not be more than I error for every
1000 bits transmitted.
Operating range: Three classes of devices are defined in Bluetooth specifications:
devices Is T00 meters.
Class I devices transmit maximum of 100 mW The range of such
Class 2 devices transmit 10 mW. The range is 50 meters.
Class 3 devices transmit 1 mW. The range is l0 meterS.
Most of the commercially available devices have a transmittino power of l milliwatt and hence a range
of 10 meters.
Services supported: Both data and voice services are supported by Bluetooth devices. For vo1ce
communication, Synchronous Connection Orien ted (SCo links are used which support circuit switching
operation. For data communication, Asynchronous Connection Less (ACL) links are used which use
packet switching. The SCO links carry voice. TwO types of voice coding are defined in the specifications:
Pulse Code Modulation (PCM) based on G.71l standard at 64 Kbps and Continuously Variable Slope
Delta Modulation (CVSD) technigque also at 64 Kbps. There is no retransmission of votce packets it
they are lost or received in error.
For data services, devices exchange data in the form of packets. The receiving device acknowledges
errors, the packet
the packet or reports that the packet is received in error. If a packet is received with
is retransmited. It is also possble to broadcast packets by one device to al the other devices in the
network. However, in broadcast mode there is no acknowledgement or indication that the packet is
received with errors. The broadcasting device informs the receiving devices how many times a broadcast
packet will be transmitted so that at least once every device will receive the packet without errors.
Data rates: A Bluetooth device can support three synchronous voice channels and one asynchronous
data channel. For voice communication, 64 Kbps dara rate is used in both directions. For asynchronous
links, two types of channels are defined with different data rates. In asymmetric channel, data rates
are 723.2 Kbps in one direction and 57.6 Kbps in the other direction. In symmetric channel, data
rate is 433.9 Kbps in both directions.
Network topology: In a PAN, a set of devices form a small network called piconet. In a piconet, there
will be one Master and one or more Slaves. All the Slaves tune to the Master. The Master decides
che hop frequency sequence and all the Slaves tune to these frequencies to establish communication
links. Any device (desktop, mobile phone etc.) can be a Master or Slave. The Master/Slave terminology
is only for the protocols, the device capabilities are not defined by this terminology. It is also possible
for aMaster and Slave to switch roles--a Slave can become a Master. A piconet can have maximum
number of seven slaves which can actively communicate with the Master. In addition to these active
slaves, apiconet can contain many Slaves that are in parked mode. These parked devices are synchronized
wich che Master, bur Division
chey are not active on the channel. The communication berween the Master and
Duplex (TDD).
the Slave uses Time
:s 62shows the various topologies of a Bluetooth piconet. In Fig. 6.12(a), a piconet is
shown with
Master and one Slave. lt is a point-to-point communication mode. In Fig. 6.12(b), the piconet
iers of aMaster and a number of Slaves. It Is a point-to-multipoint
communication mode. Fig.
12 shows a scatternet which IS rorimea by a number of piconets. In this scatterner,
each piconer
OMasrer and a number of Slaves. 1he Master of a piconet can be a Slave in another piconet.
Communication Interfaces 171
Each piconet in the scatternet will have its own frequency hopping sequence and hence there will be
interference between two piconets. In a scatternet, even if the coverage areas of two plconets
overlap, there will be no interference.
M
M
Piconet
Piconet
Piconet
(c) Scatternet
Fia. 6.12: Bluetooth Piconet &
Scatternet
Communication between Master and Slave: The Master and Slave
communicate in the form of packets. Each packet is transmitted in
In Brief.. a time slot. Each time slot is of 625 microseconds duration. These
slors are numbered from 0 to 22-1. Master starts the transmission
Bluetooth-enabled devices form the slave
in even slots by sending apacket addressed to a slave and
a network known as piconet. in sends the packets in odd numbered slots. A packet generally occupies
a piconet, there will be one extends
master and up to seven active one time slot, but can extend up to five slots. If a packet
the entire
slaves. Communication between more than one slot, the hop frequency will be che same for
the master and slaves can be Dacket. If che Master starts the transmission in slot 0 using frequencv
point-to-point or point-to f1, the slave transmits in slot l using frequency f2, master transmirs
multipoint. in slot 2 using frequency f3, and so on.
172
STANDBY
PAGE INQUIRY
PAGE INQUIRY SCAN
SCAN
CONNECTION
modes. In hold mode, the device will stop receiving the data traffic for a specific amount of time
that other devices in the piconet can use che channel. Afer the cxpiry of the specific time, the
device will start listening to tratfic again. In sniff mode, aslave will be given an instruction like listen
with slot number S every T slots for a period of N slots. So, the device need not listen to
starting
all the packets, but only as specifird through the above parameters called sniff paraneters. The
connection can be in park mode when the device only listens to a beacon signal from the Master
occasionally, and it synchronizes with the Master but does not do any data transmission.
Atypical procedure for setting up a Bluetooth link can be:
The device sends an inquiry using a special inquiry hopping sequence.
contains the
e Inquiry scanning devices respond to the inquiry by sending a packet. This packet
information needed to connect to it.
responded to the inquiry.
The inquiring device requests a connection to the device that
Paging is used to initiate the connection with the selected device.
" The selected device that has entered the page scan state responds to the page.
synchronizes with the Master's timing and
" If the responding device accesses the connection, it
frequency hopping sequence.
given a 48-bit address containing
Bluetooth Addressing: Each Bluetooth module (the radio transceiver) ispart (UAP) with 8 bits and Non
address
three fields: LAP (Lower Address Part) with 24 bits, Upper
assigned by the manufacturer of the Bluetooth
Significant Address Part with 16 bits. This address is
assigned number. This address is unique to every
module and consists of company ID and company address is referred to as BD_ADDR.
Bluetooth device. In Bluetooth specifications, this active
3-bit address. In addition to the maximum of 7
Each active member in a piconet will have a
mode. The parked members also need to have
members, many more devices can be in 'parked exchange of packets. Parked member address
master can make them active for
addresses so that the
the BD ADDR of 48 bits or an 8-bit parked member address denoted by PM ADDR.
is either dors.
profiles: To ensure interoperability between devices mnanufactured by different ven
Bluetooth define the precise characteristics and protocols
Bluetooth SIG released the Bluetooth profiles' which
are-defined for headset, cordless phone, fax machine.
supported by these devices. The Blueooth profiles networking, file transfer, synchronization of data
dial-up
LAN Access Point, serial communication,
between two devices, etc.
Notes.
Bluetooth profles
interoperability of Bluetooth modules of different manufacturers,
To achieve devices and services.
are defined for different
Architecture
6.9.2 Bluetooth Protocol
comnplete protocol stack of Bluetooth system is given in Fig. 6.14.
The
174
Audio
SDP RFCOMM TCS
Voice
LMP L2CAP
SCO
ACL
Baseband & RF
Baseband and RF
The baseband layer is for establishing the links between devices based on the type of service required
ACL for data services and SCO for voice services. This layer also takes care of addressing and
managing the different states of the Bluetooth device. The RF portion provides the radio interface.
Timing accuracy intormation request: To ensure synchronization, the master can request the
slaves for timing accuracy information.
LMP lo
. LMP version: It needs to be ensured that both the devices use the same version of
achieve this, version number of the LMP protocol is exchanged.
Type of packets supported: As different Bluetooth-enabled devices may support different fea
tures, LMP features request and response are exchanged between the devices.
other devices will
Switching Master/Slave role: In apiconet, a device will act as a Master and messages.
the LMP
act as Slaves. The Master and the Slave in a piconet can switch roles using
The Master or the Slave can initiate the switching operation.
user-friendly name having a maximum of 248 bits
" Name request: Each device can be given a
through an LMP message and obtain the
in ASCII format. A device can request for the name
response.
" Detach: Messages exchanged to close a connection.
specified time when there is no data to send. This
" Hold mode: To place ACL link in hold for a
feature is mainly to save power.
not participate in data exchange.
" Park mnode: To be in synchronization with the Master but
Power control: To request for transmitting less power. This is useful particularly for class 1
"
devices which are capable of transmitting 100 mW power.
" Quality of Service (QoS) parameters exchange: In applications
that require good quality transmission link, quality of service
In Brief. parameters can be specified. These parameters include number
Link of repetitions for broadcast packets, delay and bandwidth allo
The important functions of
cation.
Management Protocol are: link
establishment and " Request SCO link: To request for an SCO link after the ACL
disconnecion, switching link is established.
between master and slave roles,
authentication, encryption and Multi-slot packet control: To control the procedure when data is
controlling quality of service sent in consecutive packets.
parameters. Link supervision: To monitor link when device goes our of range
(through a time-out mechanism).
completed, to establish the connection.
" Connection establishment: After pag1ng is successtully
ABluetooth device will implement the base band, RF and LMP/
layers in a hardware/firmware combination. A 16-bit processor
In Brief.... based system is used to implement these three layers of protocols.
However, to reduce the cost, single chip solutions are now available
To Bluetooth-enable a device, a which will reduce che cost to make a device Bluetooth-enabled.
Bluetooth module is attached to
the device. This module These three layers ensure establishment of a connection and managing
cortains the hardware and the connection for transfer of voice or data. But to ensure that the
-firmware that implements the whole application runs as per user requirements. we need lot of
baseband, RF and link other protocols.
management protocols.
176
Logical Link Control and Adaptation Protocol (L2GAP)functionality. L2CAP layer is only
link layer
LaCAP runs above the bascband and carties Aur the data
L2CAP data packets can be up to 64 Kilobytes long. L2CAP protocol runs on hosts
nut inks.
such as laptop, cellular phone or other wireless devices. ACL link is already
When L2CAP messages are exchanged berween two devices, it assumes that an
sequence. LZCAP does
established between wo devices. It also assumes that packets are delivered in
not support SCO links for volce communtcation.
not doany checksum calculation, Note thar I 2CAP does
L2CAP does not support multicasting
The functions of L2CAP layer are:
L2CAP a number of
P'rotocol multiplexing: In the protocol stack given in Fig, 6.14, above
be passed onto the correct
to
other protocols can be running. A packet received by L2CAP has
higher layer. This is protocol multiplexing.
Segmentation and reassembly: Baseband packets are limited in size. Large L2CAP packets are
segmented into small baseband packets and sent to the baseband layer. Similarly, the small
packets received from the baseband laver are reassembled and sent to higher layers.
Quality of Service: Quality of Service (QoS) parameters such as
delay can be specified, and this layer ensures that the QoS
In Brief... constraints are honored.
The functions of Logical Link L2CAP layer sends connection request and Q0S request messages
Control and Adaptation Protocol from the application programs chrough the higher layers. It receives
(L2CAP) are protocol from the lower layers the responses for these requests. The responses
multiplexing, segmentation and can be: connection indication, connection confirmation, connect
reassembly and ensuring that confirmation negative, connect confirmation pending, disconnection
the quality of service paramelers indication (from remote), disconnect confirmation, timeout indicarion
are honored.
and quality of service violation indication.
When a device wants to discover a service, the application software initiates the request (which is the
client) and the SDP client sends SDP request to the server (the device which can provide the required
service). SDP lient and server exchange SDP messages. Note that the server and client can be any
two devices-the server is the device that can provide the service being requested by the client.
The server maintains list of service records. Each record is identified by a unique 32-bit number.
Service record will have a number of attributes. The attributes can be service class ID list (type of
service), service ID, protocol description list (protocol used for using the service), provider name, Icon
URL (an iconic representation of the service), service name and service description. Each attribute will
have two components: attribute ID and attribute value.
For instance, consider a device (a laptop) that requires a print service. The laptop is a client looking
for a print service in a Bluetooth environment. The procedure for obtaining this service is as follows:
" Client sends a service search request specifying the print service class ID to che Server.
" provided.
Server sends a service search response to the client indicating that two print services are
" Client sends a service attribute request, protocol descriptor list to the server, asking for the
details of the service.
Server sends the response to the client indicating that PostScript
print service is provided.
In Brief... " If the client wants to use the service, it sends a command to
print the desired document.
Service Discovery Protocol (SDP)
provides the capability to
The SDP is the heart of the Bluetooth system as it provides the
discover the availability of capability to discover availability of services and the derails of the
services in aBluetooth network services along with the necessary information such as protocols to
and to access these services. access the service.
Notes..
Service Discovery Protocol (SDP) is the heart of any network that supports ad-hoc networking
of computers/devices. Sun Microsystems' Jini technology also has SDP that facilitates development
of 'administration-free' networking of devices.
RFCOMM
RFCOMM is a transport protocol to emulate serial communication (RS232 serial port) over L2CAP
Through RFCOMM,two devices can communicate using serial communication proto cols over Bluetooth
radio. To achieve this, RFCOMM emulates the 9 signals of RS 232. These signals are:
102 Signal Ground (GND)
103 Transmit Data (TD)
104 Received Dara (RD)
105 Request to Send (RTS)
106 Clear to Send (CTS)
178
Questions
1. Explain the RS 232 interface specifications.
2. Wrat are the advantages of USB over RS 232? protocol architecture of tEEE 1394.
the
3. Where is IEEE 1394 interface used? Explain
LAN.
4. Explain the protocol architecture of Ethernet
standard.
5. Give che broad specifications of Bluetooth
interface? What are its advantages and limitations?
6. What is IrDA
Exercises
required to
embedded system, study che additional memory
network-enable an
1. If you want to
port the protocol stack. kit architecture. Study the processing power
Bluetooth development reduced.
2. Study a commercially available device. Explain how the cost of a Bluetooth
module ca1 be
requirement of a Blueooth
Study how data can be synchronized between a palmtop computer
3. What is data synchronization?
and a desktop computer. svstem
is of the size of 5 square kilometers. You need to design a wireless its
4. An exhibition ground select a particular stall number,
on the pal1mtops. If you
that provides location information select a particular item (say TV), the stalls that have TVs
location should be displayed. If you
wireless system using Bluetooth.
should be displaved. Design the digital format
system has to obtain data from 20 sensors, convert the signals into
5. An embedded sampled
muliplex the digital data and transmit the data to a PC. If each signal is
using ADCs, ADC is 16 bits, suggest a suitable communication link
resolution of each
at 10 KHz and the
the PC.
between the embedded system and
has to record the telephone conversations of 2 channels. The recorded
6. An embedded system
have to be transterred on to a PC. Calculate the memory capaciry required in the
messages be transferred
embedded system and the periodicity with which the recorded messages have to
to the PC.