CHAPTER FOUR
EMBEDDED SYSTEMS COMMUNICATION INTERFACES
[Contributors: B.C. Orhionkpaiyo, C.C. Ethelbert, A.K. Lawal]
4.1 The Concept of Communication
Generally, the term communication refers to the transfer of information from a transmitter to at
least one receiver. The communication might be in one direction only (i.e. uni-directional, Figure 4.1) or
in both directions (i.e. bidirectional, Figure 4.2). If the communication is only in one direction, it is termed
simplex channel and if in both directions but not simultaneous, it is half duplex, and if the communication
is both direction and simultaneous, it is full duplex. When the transmission is from one transmitter to
several receivers, it is termed multicast, in which case, the communication is only in one direction.
Fig 4.1 Uni-directional transmission
Fig 4.2 Bi-directional transmission
During communication, data are transferred in one of two forms, serial or parallel form.
In serial communication, data transmission occurs bit by bit on a single communication line or channel
(Figure 4.3). This means that data bits are sent one after the other in a sequence or series (hence the
term 'serial'), while the receiving device collects and reassembles these bits into a complete message.
Serial communication requires fewer lines or wires which makes it easier and cheaper to implement. In
parallel communication (Figure 4.4), multiple bits (usually 8, 16, or 32 bits) are sent simultaneously over
multiple channels or cables in a single clock pulse. Each bit is transmitted over a dedicated cable. Data
transfer rate is faster in parallel communication and this makes it optimal for high data rate demands like
printers, scanners, and external drives
Fig 4.3 Serial Communication(message:11011001)
Page 1 of 12
Fig. 4.4 Parallel Communication(message:11011001)
Exercise:
1. Classify the type of communication in the following pairs of devices into simplex, half duplex
and full duplex
i. Keyboard and Monitor
ii. Walkie – Talkies
iii. Telephone A and Telephone B
iv. Computer and Printer
v. Video conferencing
vi. Bluetooth and LAN
2. Differentiate between serial and parallel communication and classify each into half duplex
and full duplex
Typical embedded systems interact with the user through input and output devices. The common
examples of user interface devices include keyboard, push buttons, and switches while LEDs, LCDs,
piezoelectric buzzers are common user interface output devices. However, some embedded systems do
not require any manual intervention for their operation instead they automatically sense the input
parameters from real world through sensors which are connected at input port. For example, embedded
system with control functionality contains both sensors and actuators. The sensors are connected to the
input port for capturing the changes in environmental variable while the actuators are connected to the
output port which is controlled according to the changes in input variable.
Page 2 of 12
Embedded systems consist of several components or subsystems (usually embedded as part of a
complete device which often include electrical/electronic hardware and mechanical parts) and these
components communicate with each other and with the external world through an interface.
Exercise:
1. Identify the embedded subsystem components of:
i. Washing machine
ii. Air Conditioner
iii. Mobile phone
2. State the difference between a Sensor and Actuator
The communication interface of embedded systems can be classified into two, namely, device/board
level communication interface also called onboard communication interface, and product level
communication interface also referred to as external communication interface. These two forms of
communication interfaces are discussed in this chapter.
4.2 Onboard Communication Interface
Onboard communication interfaces connect the components of the embedded system internally.
Examples of such interfaces include I2C (Inter-Integrated Circuit or I square C), SPI (Serial Peripheral
Interface), and CAN (Controller Area Network)
4.2.1 Inter-Integrated Circuit (I2C)
The I2C bus is a standard bidirectional interface that uses a controller, known as the master, to
communicate with slave devices. The I2C bus is designed for short distance communication within meter
range and a standard speed of 100kbs. The I2C bus has three speed grades: slow(under 100kbps), fast
(400kbps), and high-speed (3.4mbps). It is a simple low cost, serial communication bus protocol with a
relative low data rates. I2C bus is a shared bus system that a number of I 2C devices can be connected.
Devices connected to the I2C bus can act as either Master device or Slave device. The Master device
controls the communication by initiating or terminating data transfer, sending data and generating
necessary synchronization clock pulses while the slave device responds to the command from the master
device. Also, a master and slave devices can act as either transmitter or receiver but it is only the master
slave that can generate the synchronization clock signal. This means that both the SCL and SDA are bi-
directional transmission lines operating in half-duplex mode.
Page 3 of 12
The basic design of I²C has a 7-bit address space with 16 reserved addresses. This makes the
maximum number of nodes that can communicate on the same bus as 112. The design (Figure 4.5)
consists of two serial interface wires, namely, SCL (Serial clock) and SDA (Serial data). The SDA line
transmits the data across devices while the SCL generates the clock signal/pulses for synchronization.
Both SDA and SCL lines must be connected to Vcc through a pull-up resistor (Rpu). The pull-up resistor
(Rpu) on the line is responsible for pulling the bus voltage up to the power rail while the Vcc is the
voltage supplied to power devices connected to the I²C port.
I²C are not only used on single boards, but also to attach low speed peripheral devices and
components to a motherboard, embedded system, or cell phone.
Fig. 4.5: I²C Bus Connections
Figure 4.6 shows the picture of a cut out I²C module
Fig 4.6 I²C Module
4.2.2 Serial Peripheral Interface (SPI)
The Serial Peripheral Interface Bus (Figure 4.7) (also called four-wire serial bus) is a full duplex,
bidirectional, synchronous serial data link. It operates in master/slave mode where the master device
initiates the data frame. Multiple slave devices are allowed with individual slave select (chip select) lines.
The master must select only one slave at a time.
Data and control lines of the SPI consist of:
o Master Out Slave In (MOSI) also called Serial Data In (SDI).
o Master In Slave Out (MISO) also Called Serial Data Out (SDO).
o Serial Clock (SCLK or SCK): generated by the master for Synchronization.
Page 4 of 12
o Slave Select (SS) on the master and Chip Select (CS) on the slave
During each SPI clock cycle, a full duplex data transmission occurs:
the master sends a bit on the MOSI line; the slave reads it from that same line.
the slave sends a bit on the MISO line; the master reads it from that same line.
SPI is primarily used for short-range communication. It is used to send data between
Microcontrollers and small peripherals such as shift registers, sensors, and SD cards
Fig 4.7 Serial Peripheral Interface
4.2.3 Controller Area Network (CAN)
Controller Area Network was developed for microcontrollers and devices to communicate with
each other without a host computer. That is, in CAN, Electronic Control Units (ECUs) communicate with
each other without any host computer.
CAN is best suited for embedded control in harsh environment network applications such as
industrial automation, automotive, mobile machines, and others. It is a broadcast type of bus that does
not require explicit address in the messages. Each message contains a numeric value that controls its
priority on the bus, which may also serve as an identification of the contents of the message. The lower
the numerical value of the identifier, the higher the priority.
CAN is based on differential signaling and arbitration using CSMA/CA (Carrier-Sense Multiple
Access with Collision Avoidance). The devices that are connected by a CAN network are typically sensors,
actuators, and other control devices. These devices are not connected directly to the bus, but through a
host processor and a CAN controller.
If the bus is free and two or more nodes want to send messages at the same time, the message
with the more dominant ID (i.e. one with more zeroes) will overwrite other nodes with less dominant IDs,
so that eventually (after this arbitration on the ID) only the dominant message remains and is received
by all nodes.
Usually, all the Electronic Control Units (ECUs) are connected on a two-wire bus, consisting of a
twisted pair – CAN high (yellow in color), and CAN low (green). A modern car has over seventy ECUs
(such as one used for transmission, airbags, antilock braking, cruise control, audio systems, windows,
Page 5 of 12
doors, mirror adjustment, etc.) and each of them shares information with each other on the bus. Any
ECU on the CAN bus can broadcast information (such as sensor data) and all the ECUs on the network
gets this information and then checks the information to decide whether to accept it or ignore it (Figure
4.8).
Fig 4.8 CAN communication system
ECU consists of three primary elements (Figure 4.9):
Microcontroller: The MCU is the brain of the ECU - it interprets incoming CAN messages and
decides what messages to transmit. For example, a sensor might be programmed to measure
and broadcast oil temperature at 5 Hz
CAN controller: The controller is typically integrated in the MCU and ensures all communication
adheres to the CAN protocol (message encoding, error detection, arbitration etc.) - removing
complexity from the MCU
CAN transceiver: The CAN transceiver connects the CAN controller to the physical CAN wires,
converting controller data into differential signals for the CAN bus and vice versa. It also provides
electrical protection
Fig 4.9 Components of ECU
Page 6 of 12
Exercises
1. In a tabular form, compare the features of I2C, SPI, and CAN onboard communication
interfaces
2. List some appliances/devices where I2C, SPI, and CAN are used
3. Name the sensors, actuators, and other control devices in your car that are connected by a
CAN network
4.3. External Communication Interface
External interfaces connect the system to outside devices wirelessly or over wired networks.
Examples of embedded systems external communication interfaces include RS-232 (Recommended
Standard 232), USB (Universal Serial Bus), Bluetooth, Wi-Fi (wireless fidelity), Zigbee, GPRS, and GSM.
Some of these interfaces are connected via wires while some are wireless
4.3.1. RS-232 Interface
The RS-232 (Recommended Standard 232) is serial port hardware (also known as Comm port)
used to connect external devices based on EIA (Electronics Industry Alliance) protocol. The RS-232
protocol defines the purpose, signal voltages, signal timing, signal function, pin wiring and the mechanical
connections (i.e., either 25-pin DB-25 or 9-pin DB-9)(Figure 4.10)
RS-232 compatible devices are called either DTE (Data Terminal Equipment), which are the host
systems, or DCE (Data Circuit-terminating Equipment or Data communication Equipment) which are the
peripheral devices. DTE devices are the initiators of a serial communication, such as a PC or embedded
board. DCE is the device that the DTE wants to communicate with, such as an I/O device connected to
the embedded board
RS-232 is an Active LOW voltage driven interface i.e., it transmits positive voltage for a 0 bit,
negative voltage for a 1 bit. And the output signal level usually swings between +12 V and –12 V. The
high level is defined in between +5V to +12V, and a low level is defined in between –5V and –12V.
Page 7 of 12
Fig 4.10 RS-232C connections - DB-25 Connector
4.3.2 Universal Serial Bus (USB)
The USB is used to connect devices to a host controller such as personal computer. USB can
connect computer peripherals such as mice, keyboards, digital cameras, printers, personal media players,
flash drives, Network Adapters, and external hard drives. Unlike RS-232, USB connectors also supply
electric power; so many devices connected by USB do not need a power source of their own. It is a plug
and play interface. When a peripheral device is connected to a host computer by USB, the host machine
will automatically determine the kind of device and install a driver that lets it function. USB supports all
kinds of data, from slow mouse inputs to digitized audio and compressed video.
Portable computing devices such as handholds, cell phones and digital cameras that connect to
the PC as a USB peripheral benefit from having additional capability to connect to other USB devices
directly. For instance, users can perform functions such as sending photos from a digital camera to a
printer, PDA, cell phone, or sending music files from an MP3 player to another portable player, PDA or
cell phone. Wireless USB also exist using Ultra-Wide Band (UWB) radio platform developed by the
WiMedia Alliance.
USB device communication is based on pipes (logical channels). A pipe is a connection from the
host controller to a logical entity, found on a device, and named an endpoint. Because pipes correspond
one-to-one to endpoints, the terms are sometimes used interchangeably. A USB device can have up to 32
endpoints: 16 into the host controller and 16 out of the host controller. The USB standard reserves one
endpoint of each type, leaving a theoretical maximum of 30 for normal use (Figure 4.11).
Page 8 of 12
Fig 4.11 USB communication interface
USB comes in different types – USB type A, mini, micro, and type C USB (Figure 4.12)
Fig 4.12 Types of USB
USB has evolved over the years with different versions being developed with increased data
transfer rates. Table 4.1 summaries the different USB versions and their transfer rates.
Table 4.1 USB versions and Transfer Rates
USB Version Year Released Transfer Rate
USB 1.0 1996 12 mbps
USB 2.0 (Hi-Speed USB) 2001 480 megabits per second (Mbps) or
60 megabytes per second (MBps).
USB 3.0(Super Speed or Gen1) 2010 5.0 gigabits per second (Gbps) or
640 megabytes per second (MBps).
USB 3.1 (Super Speed+ or Gen2) 2013 10 Gbps
USB4, or USB 4.0 2022 40 Gbps40 Gbps
4.3.3 Bluetooth
Bluetooth was developed as an alternative to cables and wires to create a network without using
cables and wires. Bluetooth is a low energy consumption, short range, wireless communication interface
for data and voice communication. It operates in the 2.4 GHz ISM frequency band and uses Frequency
Hopping Spread Spectrum (FHSS) technique (a method of transmitting radio signals by rapidly switching
the carrier between different frequency channels). ISM bands (industrial, scientific, and medical) are
Page 9 of 12
parts of the RF (radio-frequency) spectrum reserved for general use by scientific, medical, and industrial
devices.
Bluetooth is widely used in applications like hands free headset, smartphone-to-smartphone data
transfer, wireless communication between smartphone and car-stereo system, cable-free connection
between PC and I/O modules like mouse, keyboard, printer, and embedded systems such as heart rate
monitors, smart watches, fitness trackers etc., and for building personal area networks. Bluetooth users
find it convenient to transfer ringtones, music files, pictures, media files, etc. to other neighboring
Bluetooth enabled devices such as smartphones and laptops. A Bluetooth-enabled device has a radio that
operates at Bluetooth frequency (2.4 GHz) and software that manages the connection data flow and
security to adhere to the Bluetooth Specification. Each Bluetooth device has a microchip embedded in it
that can send and receive radio signals. It can send both data and voice. Inside the chip is software
called a link controller that does the actual work of identifying other Bluetooth devices and sending and
receiving data.
A Bluetooth device can function as either master or slave. Communication can take place
between a master node and a slave node in either one-to-one or one-to-many manner. However, no
direct communication takes place between slaves . One master may communicate with up to seven slaves
to form a piconet (Figure 4.13). A piconet consists of up to eight Bluetooth-enabled devices. When a
piconet is established, one device (the primary or master device) sets the frequency-hopping pattern and
the other devices (the secondary or slave devices) synchronize their signals to the same pattern. Each
piconet has a different frequency-hopping pattern to differentiate its signals from the signals of other
piconets. As the number of piconets in an area increases, the number of collisions increases and
performance degrades. Two or more piconets can be connected to form a bigger network, called a
scatternet.
Fig 4.13 Piconet
Page 10 of 12
4.3.4 Wireless Fidelity (Wi-Fi)
Wi-Fi network is a half-duplex, wireless communication channel that operates at 2.4GHZ or 5GHZ
of radio spectrum like Bluetooth. The Wi-Fi architecture consists of a base station (Access Point) to which
wireless hosts are connected in order to access network resources. The base station is responsible for
sending and receiving data to and from the wireless host that is associated with the base station. The
connection between the host and the base station is the wireless communication link. This
communication link is responsible for data transport between the base station and the hosts.
Wi-Fi networking uses radio signals. These radio signals transmitted from Wi-Fi antennas are
picked up by Wi-Fi receivers, such as computers, cameras, media players, and cell phones that are
equipped with Wi-Fi cards. Whenever, a computer receives any of the signals within the range of a Wi-Fi
network, which is usually 300 — 500 feet for antennas and 100-150 feet for home routers, the Wi-Fi card
(Figure 4.14) reads the signals and thus creates an internet connection between the user and the
network without the use of a cord.
Fig 4.14 Wi-Fi card
Wi-Fi depends on a higher energy intake to offer a 100-meter range and 11 Mbps maximum
transmission rate. This speed makes Wi-Fi more than 10 times as fast as Bluetooth and similar to a high-
speed modem. For large file transfers and quick Internet access, Wi-Fi outperforms Bluetooth. The 100-
meter range makes Wi-Fi conducive to wireless local area networking. However, Wi-Fi depends on
proximity to infrastructure (i.e., access points) and because of its higher power requirements (which
makes it practical to have an electric socket nearby), the technology is best used within a building
environment.
Exercises:
1. In a tabular form, compare the features of RS-232, USB, Bluetooth, and Wi-Fi
2. Explain why Wi-Fi is described as half-duplex communication channel
3. Identify the challenges in the application of Bluetooth and Wi-Fi communication channels
4. Explain the following external communication interfaces
a. ZigBee
b. GPRS
c. GSM
Page 11 of 12
4.4 Laboratory Exercises
1. Visit the hardware laboratory (Lab3) and identify I2C and SPI components in the displayed
hardware devices. Write down the features that helped you to identify each of the
components.
2. Given a DB-25 Connector, identify the pin for each 25 slots. Outline the procedures for
setting up the connections.
3. Create a hotspot with your smartphone and allow two of your friends to connect to it. While
the three of you share data, each of them should move away from the location of your phone
that initiated the hotspot and notice the signal strength of the Wi-Fi as they go far away from
the hotspot. List your observations in terms of the signal strength and speed of sending data
at each point.
4. Given a Mifi and a CCTV Camera, you are required to connect the camera to the Wi-Fi
network. List out the procedures necessary for setting up the wireless connections of the
given CCTV camera
5. Create five groups consisting of eight students each. One student in each group should use
his/her smartphone as the master node and create a piconet.
a. Members of each group should move apart while sharing data and observe the
connection strength at each point.
b. Create two scatternets with two groups and three groups respectively linking their
piconets and try to share data. Compare the performance of the piconet with that of
the scatternet in terms of speed of shared data
c. Outline the procedures for setting up the piconet.
d. Identify and explain the communication technology used for creating the piconet
References
1. Kothari, D.P., Vasudevan, S.K., Sundaram, R.M.D., & Murali, N. (2015) Embedded Systems, (2nd
ed.). New Academic Science Limited, London
2. Chalmers (2006), Embedded systems Communication Interfaces with Emphasis on Serial
Protocols, Goteborg.
3. Marwedel, P. (2021). Embedded System Design: Embedded Systems Foundations of Cyber-
Physical Systems, and the Internet of Things, (4th ed.). Springer International Publishing,
Dortmund, Germany
4. https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial Visited 1st February 2025
5. https://tripplite.eaton.com/products/usb-connectivity-types-standards Visited 1st February 2025
6. https://www.computerhope.com/jargon/u/usb.htm Visited on 1st February 2025
Page 12 of 12