MODULE 4
EMBEDDED COMMUNICATION
Communication Interface
1. Onboard Communication Interfaces
a. I2C Bus
b. SPI Bus
c. UART
2. External Communication Interfaces
a. RS-232 C
b. USB
c. Bluetooth
d. Wi-Fi
e. ZigBee
[Link] Communication Interfaces (Device/Board level Communication
Interfaces):
(a) Inter Integrated Circuit (I2C) Bus:
It is a synchronous bi-directional half-duplex two wire serial interface bus.
• The I2C bus comprise of two bus lines:
✓ Serial Clock (SCL line) – responsible for generating synchronization clock
pulses
✓ Serial Data (SDA line) – responsible for transmitting
• I2C bus is a shared bus system to which many numbers of I2C devices can be
connected. Devices connected to the I2C bus can act as either 'Master' or 'Slave’.
• The 'Master' device is responsible for controlling the communication.
• 'Slave' devices wait for the commands from the master and respond.
• The synchronization clock signal is generated by the 'Master' device only.
• I2C supports multi masters on the same bus
• Both the bus lines should be pulled to the supply voltage using pull-up resistors. The
typical value of resistors used in pull-up is 2.2K.
The sequence of operations for communicating with an I2C slave device is listed below:
• The master device pulls the clock line (SCL) to 'HIGH'
• The master device pulls the data line (SDA) 'LOW
• The master device sends the address of the ‘slave’
• The master device sends the Read or Write bit
• The master device waits for the acknowledgement bit from the slave device
• The slave device with the address requested by the master device responds by sending
an acknowledge bit (Bit value 1) over the SDA line
• Upon receiving the acknowledge bit, the Master device starts the communication.
(b) Serial Peripheral Interface (SPI) Bus:
• The Serial Peripheral Interface Bus (SPI) is a synchronous bi-directional full duplex
four-wire serial interface bus.
• The concept of SPI was introduced by Motorola.
• SPI is a single master multi-slave system.
SPI requires four signal lines for communication. They are:
1) Master Out Slave In (MOSI) – Signal line carrying the data from master to slave device.
It is also known as Slave Input/SIave Data In (SI/SDI)
2) Master In Slave Out (MISO) – Signal line carrying the data from slave to master device.
It is also known as Slave Output (SO/SDO)
3) Serial Clock (SCLK) – Signal line carrying the clock signals
4) Slave Select (SS) – Signal line for slave device select. It is an active low signal
• Master selects the required slave device by asserting the corresponding slave select
signal 'LOW’.
• The serial data transmission through SPI bus is fully configurable
• SPI devices contain a certain set of registers which are Serial peripheral control register
& status register
• SPI works on the principle of 'Shift Register’
• The master and slave devices contain a special shift register for the data to transmit or
receive.
• The shift registers of 'master' and 'slave' devices form a circular buffer
(C) Universal Asynchronous Receiver Transmitter (UART):
• Universal Asynchronous Receiver Transmitter (UART) based data transmission is an
asynchronous form of serial data transmission.
• It doesn't require a clock signal to synchronize the transmitting end and receiving end
for transmission.
• Instead it relies upon the pre-defined agreement between the transmitting device and
receiving device.
• The serial communication settings for both transmitter and receiver should be set as
identical.
• The start and stop of communication is indicated through inserting special bits in the
data stream.
• If parity is enabled for communication, the transmitting device adds a parity bit. This
is for error checking
• The UART of the receiving device discards the 'Start', 'Stop' and 'Parity’ bit
[Link] Communication Interfaces (Product level Communication
Interfaces):
(a) RS232 C:
Recommended Standard number 232, revision C is a full duplex, wired, asynchronous serial
communication interface. RS-232 supports two different types of connectors:
a. DB-9: 9-Pin connector
b. DB-25: 25-Pin connector
• The RS-232 interface defines various handshaking and control signals for
communication
• There are Data Terminal Equipment (DTE) and Data Communication Equipment
(DCE) in RS 232.
• If no data flow control is required, only TXD and RXD signal lines and ground line
(GND) are required for data transmission and reception.
• If hardware data flow control is required for serial transmission, various control signal
lines of the RS- 232 connection are used appropriately.
• The Request to Send (RTS), Clear to Send (CTS), Data Terminal Ready (DTR) and
Data Set Ready (DSR) signals co-ordinate the communication between DTE and DCE.
• As per the EIA standard RS-232 C supports baud rates up to 20Kbps (Upper limit 19.2
Kbps).
• The commonly used baud rates by devices are 300bps, 1200bps, 2400bps, 9600bps,
11.52Kbps and 19.2Kbps.
(b) Universal Serial Bus (USB):
• Universal Serial Bus (USB) is a wired high-speed serial bus for data communication.
• The USB communication system follows a star topology with a USB host at the Centre
and one or more USB peripheral devices/USB hosts connected to it.
• USB transmits data in packet format
• The USB communication is a host initiated one.
• The USB host contains a host controller
• The physical connection between a USB peripheral device and master device is
established with a USB cable which supports communication distance of up to 5 meters
• USB interface has the ability to supply power to the connecting devices
• It can supply power up to 500 mA at 5 V.
• USB supports four different types of data transfers
• Control transfer: Used by USB system software
• Bulk transfer: Used for sending a block of data
• Isochronous data transfer: Used for real-time data communication.
• Interrupt transfer: Used for transferring small amount of data
(c) Bluetooth (BT):
– Bluetooth is a low cost, low power, short range wireless technology for data
and voice communication.
– Bluetooth operates at 2.4GHz of the Radio Frequency spectrum and uses the
Frequency Hopping Spread Spectrum (FHSS) technique for communication.
– It supports a data rate of up to 1Mbps and a range of 30 feet for data
communication.
– Bluetooth communication has two parts – a physical link part and a protocol
part.
– Each Bluetooth device will have a 48-bit unique identification number
– Bluetooth supports point-to-point and point-to-multipoint wireless
communication.
– The point-to-point communication follows the master-slave relationship.
– Bluetooth is the favorite choice for short range data communication in handheld
embedded devices.
(d) Wi-Fi:
– Wireless Fidelity is the popular wireless communication technique for
networked communication of devices.
– Wi-Fi follows the IEEE 802.11 standard.
– Wi-Fi is intended for network communication and it supports Internet Protocol
(IP) based communication.
• IP address and Wi-Fi router/Wireless Access Point are required for Wi-Fi based
communication.
• Wi-Fi router is responsible for restricting access to the network, assigning IP address
to the devices, routing data packets to the intended devices.
• Wi-Fi enabled devices will be having wireless adaptor.
• Wi-Fi operates at 2.4GHz or 5GHz of Radio spectrum.
(e) ZigBee:
• ZigBee is a low power, low cost, wireless network communication protocol based
on the IEEE 802.15.4-2006 standard.
• ZigBee is a Personal Area Network task group with low rate task group 4.
• It is a technology of home networking. ZigBee is a technological standard created for
controlling and sensing the network.
In the ZigBee terminology, each ZigBee device falls under any one of the following ZigBee
device categories:
– ZigBee Coordinator (ZC)/Network Coordinator
• The ZigBee coordinator acts as the root of the ZigBee network.
– ZigBee Router (ZR)/Full function Device (FFD)
• Responsible for passing information from device to another device or to
another ZR.
– ZigBee End Device (ZED)/Reduced Function Device (RFD)
• End device containing ZigBee functionality for data communication.
• It can talk only with a ZR or ZC and doesn't have the capability to act as
a mediator for transferring data from one device to another.
General Characteristics of Zigbee Standard:
1) Low Power Consumption
2) Low Data Rate (20- 250 kbps)
3) Short-Range (75-100 meters)
4) Network Join Time (~ 30 msec)
5) Support Small and Large Networks (up to 65000 devices (Theory); 240 devices
(Practically))
6) Low Cost of Products and Cheap Implementation (Open Source Protocol)
Controller Area Network (CAN):
• The Controller Area Network (CAN) is an asynchronous bus protocol used for
communication between the processor and the sensors or actuators.
• It was developed by Robert Bosch to be mainly used in the automobile sector but now
the usage of CAN is not just limited to this sector, instead it is used in many embedded
systems.
Features of CAN Standard
• The ability to self-diagnose and repair the data errors makes CAN used in many
embedded industries like medical electronics, automobiles etc.
• The CAN protocol is defined by the ISO standard. It defines the various layers of the
CAN as shown in the fig.
CAN message format:
• CAN defines a logic bit 0 as dominant bit and a logic bit 1 as recessive bit.
• Field description of standard CAN message is as follows:
1) SOF (Start of Frame): As the name says, this bit indicates start of frame.
2) Identifier: A 11-bit identifier, which is also used as a priority string with a ‘0’
having higher priority.
3) RTR (Remote Transmission Request): This bit indicates that a data is
required from a remote device.
4) IDE (Identifier Extension): This bit indicates that the identifier contains an
extension or not.
5) 𝒓𝟎 : Reserved bit
6) DLC (Data Length Code): This bit indicates the length of the data bytes
followed by this field.
7) Data: This is the data bytes field of 0 to 8 bytes
8) CRC (Cyclic Redundancy Check): It is an error checking code for the data.
9) ACK (Acknowledge): This bit is sent by the receiver to indicate, that error free
message was received
10) EOF (End of Frame): It indicates the end of frame
11) IFS (Interframe Space): It indicates the time required to transmit the data into
the buffer
RFID: Radio frequency identification
• Radio frequency identification system (RFID) is an automatic technology and aids
machines or computers to identify objects, record metadata or control individual target
through radio waves.
• A typically RFID system is consisted of tags (transmitters/ responders) and readers
(transmitters/receivers).
• The tag is a microchip connected with an antenna, which can be attached to an object
as the identifier of the object.
• The RFID reader communicates with the RFID tag using radio waves.
• RFID tags:
• also known as transponders (transmitter/ responder), are attached to the objects
to count or identify.
• Tags could be either active or passive.
• Active tags are those that have partly or fully battery powered, have the
capability to communicate with other tags, and can initiate a dialogue of their
own with the tag reader.
• Passive tags, on the other hand, do not need any internal power source but are
powered up by the tag reader.
• Tags consist mainly of a coiled antenna and a microchip, with the main purpose
of storing data.
• Reader:
• also known as transceiver (transmitter/receiver) made up of a radio frequency
interface (RFI) module and control unit.
• Its main functions are to activate the tags, structure the communication sequence
with the tag, and transfer data between the application software and tags.
• Application system:
• also called data processing system, which can be an application or database,
depending on the application.
• The application software initiates all readers and tags activities.
• RFID provides a quick, flexible, and reliable way for electronically detecting,
tracking and controlling a variety of items.
• RFID systems use radio transmissions to send energy to a RFID tag while the
tag emits a unique identification code back to a data collection reader linked to
an information management system.
• The data collected from the tag can then be sent either directly to a host
computer, or stored in a portable reader and up-loaded later to the host
computer.