Unit 2
Unit 2
EMBEDDED SYSTEM
KOE-062
UNIT-2 EMBEDDED NETWORKING
PRESENTED BY:
Dr. SEEMA NAYAK (PROF & HEAD ECE)
Parallel Communication:
In parallel communication, all the bits of data are transmitted simultaneously on separate
communication lines.
Used for shorter distance.
In order to transmit n bit, n wires or lines are used.
More costly.
Faster than serial transmission.
Data can be transmitted in less time
Synchronous:
Transfers a block of data (characters) at a time.
Requires clock signal
Example: SPI (serial peripheral interface), I2C (inter integrated circuit).
Synchronous data transfer In program-to-program communication, synchronous communication requires that
each end of an exchange of communication respond in turn without initiating a new communication. A typical
activity that might use a synchronous protocol would be a transmission of files from one point to another. As
Dr. Seema
each transmission is received, a response is returned Nayak
indicating success or the need to resend.
Data Transmission: In data transmission if the data can be transmitted and received, it is a duplex
transmission.
Simplex: Data is transmitted in only one direction i.e. from TX to RX only one TX and one RX only
Half duplex: Data is transmitted in two directions but only one way at a time i.e. two TX's, two RX’s and one
line
Full duplex: Data is transmitted both ways at the same time i.e. two TX's, two RX’s and two lines
A Protocol is a set of rules agreed by both the sender and receiver on
• How the data is packed
• How many bits constitute a character
• When the data begins and ends
Dr. Seema Nayak
Dr. Seema Nayak
Baud Rate Concepts: Data transfer rate in serial communication is measured in terms of bits per second
(bps). This is also called as Baud Rate. Baud Rate and bps can be used inter changeably with respect to
UART.
Ex: The total number of bits gets transferred during 10 pages of text, each with 100 × 25 characters with
8 bits per character and 1 start & stop bit is: For each character a total number of bits are 10. The total
number of bits is: 100 × 25 × 10 = 25,000 bits per page.
For 10 pages of data it is required to transmit 2, 50,000 bits. Generally baud rates of SCI are 1200, 2400,
4800, 9600, 19,200 etc.
To transfer 2, 50,000 bits at a baud rate of 9600, we need: 250000/9600 = 26.04 seconds (27 seconds).
IO Bus : Any device that is compatible with a system's I/O bus can be added to the system (assuming an
appropriate device driver program is available), and a device that is compatible with a particular I/O bus can
be integrated into any system that uses that type of bus.
IO Bus : I/O devices communicate with the processor through an I/O bus, which is separate from the
memory bus that the processor uses to communicate with the memory system.
Embedded systems Networking : Embedded systems connected internally on same IC or systems at very
short, short and long distances can be networked using a type of the I/O buses- CAN, I 2C, USB, PCI, …
IO Bus for Networking vs. direct connections : Use of I/O bus, as opposed to direct connections between the
processor and each I/O device, very flexible, allowing a system to support many different I/O devices
depending on the needs of its users and allowing users to change the I/O devices that are attached to a
system as their needs change.
• A bus has a fixed bandwidth that must be shared by all of the devices on the bus.
• Even worse, electrical constraints (wire length and transmission line effects) cause buses to have less
bandwidth than using the same number of wires to connect just two devices.
• Essentially, there is a trade-off between interface simplicity and bandwidth
A bus has bandwidth of 2 Mb/s (can be used to transfer 2 Mb data in one s. If 10 devices are connected,
the 2 Mb/s is shared between the networked systems
Serial Bus :
A serial bus has very few lines and the number of lines as per the protocol
• A wide range of I/O devices without having to implement a specific interface for each I/O device. When
the I/O devices in the distributed embedded systems are networked at long distances of 25 cm and
above, all can communicate through a common serial bus.
Parallel Bus : Using a parallel I/O bus allows a computer or controller or embedded system to interface
with number of internal systems at very short distances without having to implement a specific interface
for each I/O device.
Firstly, the interface presupposes a common ground between the DTE and DCE. This is a reasonable
assumption where a short cable connects a DTE and DCE in the same room, but with longer lines and
connections between devices that may be on different electrical busses, this may not be true.
A signal on a single line is impossible to screen effectively for noise. By screening the entire cable one can
reduce the influence of outside noise, but internally generated noise remains a problem. As the baud
rate and line length increase, the effect of capacitance between the cables introduces serious crosstalk
until a point is reached where the data itself is unreadable.
Using low capacitance cable can reduce crosstalk. Also, as it is the higher frequencies that are the
problem, control of slew rate in the signal also decreases the crosstalk. The original specifications for RS-
232 had no specification for maximum slew rate.
RS422
Serial Communication RS422 is a Standard interfaces approved by the Electronic Industries Association (EIA),
and designed for greater distances and higher Baud rates than RS232. In its simplest form, a pair of
converters from RS232 to RS422 (and back again) can be used to form an "RS232 extension cord." Data rates
of up to 100K bits / second and distances up to 4000 Ft. can be accommodated with RS422. RS422 is also
specified for multi-drop (party-line) applications where only one driver is connected to, and transmits on, a
"bus" of up to 10 receivers. RS422 devices cannot be used to construct a truly multi-point network. A true
multi-point network consists of multiple drivers and receivers connected on a single bus, where any node can
transmit or receive data.
Dr. Seema Nayak
RS485
Serial Communication RS485 is an Electronics Industry Association (EIA) standard for multipoint
communications. It supports several types of connectors, including DB-9 and DB-37. RS-485 is similar to
RS-422 but can support more nodes per line RS485 meets the requirements for a truly multi-point
communications network, and the standard specifies up to 32 drivers and 32 receivers on a single (2-wire)
bus.
With the introduction of "automatic" repeaters and high-impedance drivers / receivers this "limitation"
can be extended to hundreds (or even thousands) of nodes on a network. The RS-485 and RS-422
standards have much in common, and are often confused for that reason. RS-485, which specifies bi-
directional, half-duplex data transmission, is the only EIA/TIA standard that allows multiple receivers and
drivers in "bus" configurations. RS-422,
on the other hand, specifies a single, unidirectional driver with multiple receivers.
Controller Area Network (CAN) is a serial network technology that was originally designed for the
automotive industry, especially for European cars, but has also become a popular bus in industrial
automation as well as other applications. The CAN bus is primarily used in embedded systems, and as its
name implies, is a network technology that provides fast communication among microcontrollers up to real-
time requirements, eliminating the need for the much more expensive and complex technology of a Dual-
Ported RAM.
CAN is a two-wire, half duplex, high-speed network system, that is far superior to conventional serial
technologies such as RS232 in regards to functionality and reliability and yet CAN implementations are more
cost effective.
• It reduces wiring since it is a distributed control and this ensures enhancing the system performance.
• Many CAN chip manufactures provided the data link layer and the physical layer interfaced to the
chip and all the software developer needs to do only is to develop the application coding.
• It provides the ability to work in different electrical environments and ensures noise-free
transmission.
• Traffic congestion is eliminated as the messages are transmitted based on their priority and it allows
the entire network to meet the timing constraints.
• It provides for error-free transmission as each node can check for errors during the transmission of
the message and send the error frame.
Synchronous and asynchronous communication protocols are well-defined standards and can be
implemented in either hardware or software. In the early days of embedded systems, Software
implementation of I2C and SPI was common as well as a tedious work and used to take long programs
Dr. Seema Nayak
SPI COMMUNICATION PROTOCOL
SPI is a common communication protocol used by many different devices. For example, SD card modules,
RFID card reader modules, and 2.4 GHz wireless transmitter/receivers all use SPI to communicate with
microcontrollers.
One unique benefit of SPI is the fact that data can be transferred without interruption. Any number of bits
can be sent or received in a continuous stream.
With I2C and UART, data is sent in packets, limited to a specific number of bits. Start and stop conditions
define the beginning and end of each packet, so the data is interrupted during transmission.
Devices communicating via SPI are in a master-slave relationship. The master is the controlling device
(usually a microcontroller), while the slave (usually a sensor, display, or memory chip) takes instruction
from the master. The simplest configuration of SPI is a single master, single slave system, but one master
can control more than one slave
THE CLOCK The clock signal synchronizes the output of data bits from the master to the sampling of bits
by the slave. One bit of data is transferred the frequency of the clock signal. SPI communication is always
initiated by the master since the master configures and generates the clock Any communication protocol
where devices share a clock signal is known as synchronous communication protocol. There are also signal.
For example, on, in both sides timing of data transmission. The clock signal in SPI can These two properties
work together to define when the bits are output and when they are Clock polarity can be set by the master
to allow for bits to be output and sampled on either the or falling edge of the clock cycle. Clock phase can be
set for output and sampling to occur on either the first edge or second edge of the whether rising /falling
SLAVE SELECT
3. The master sends the data one bit at a time to the slave along the MOSI line. The slave reads bits as they
are received:
DISADVANTAGES:
Uses four wires (I2C and UARTs use two)
No acknowledgement that the data has been successfully received (I2C has this)
No form of error checking like the pa Only allows for a single master.
DISADVANTAGES:
Slower data transfer rate than SPI
The size of the data frame is limited to 8 bits
More complicated hardware needed to implement than SPI