Professional Documents
Culture Documents
I2c Bus
I2c Bus
I2c Bus
I2C BUS:
The name I2C is shorthand for Standard Inter-Integrated Circuit bus
I2C is a serial data protocol which operates with a master/slave relationship
Three I2C standards are:
1. Industrial 100 kbps I2C,
2.100 kbps SM I2C,
3.400 kbps I2C
2
I C Bus
The Bus has two lines that carry its signals- one line is for the clock and one is for bidirectional data.
There is a standard protocol for the I2C bus.
Device Addresses and Master in the I2C bus
Each device has a 7
Bit address using which the data transfers take place.
Master can address 127 other slaves at an instance.
Master has at a processing element functioning as bus controller or a microcontroller
with I2C
bus interface circuit.
Slaves and Masters in the I2C bus
Each slave can also optionally has I2C bus controller and processing element.
Number of masters can be connected on the bus.
Slaves and Masters in the I2C bus
Each slave can also optionally have I2C bus controller and processing element.
Number of masters can be connected on the bus.
However, at an instance, master is one, which initiates a data transfer on SDA (serial
data) line and which transmits the SCL (serial clock) pulses. From master, a data frame
has fields beginning from start bit.
CAN protocol:
There is a CAN controller between the CAN line and the host node.
CAN controller BIU (Bus Interface Unit)consisting of a buffer and driver
Method for arbitration - CSMA/AMP (Carrier Sense Multiple Access with Arbitration
on Message Priority basis)
Each Distributed Node Uses:
Twisted Pair Connection up to 40 m - for bi-directional data
Line, which pulls to Logic 1 through a resistor between the line and + 4.5V to +12V.
Line Idle state Logic 1 (Recessive state)
Uses a buffer gate between an input pin and the CAN line
Detects Input Presence at the CAN line pulled down to dominant (active) state logic 0
(ground ~
0V) by a sender to the CAN line
Uses a current driver between the output pin and CAN line and pulls line down to dominant
(active) state logic 0(ground ~ 0V) when sending to the CAN line Protocol defined start bit
followed by six fields of frame bits Data frame starts after first detecting that dominant state
is not present at the CAN line with logic 1 (R state) to 0 (D state transition) for one serial bit
interval
After start bit, six fields starting from arbitration field and ends with seven logic0s end-field
3 -bit minimum inter frame gap before next start bit (R D transition) occurs
frame.
- Second bit 'ACK delimiter' bit. It signals the endof ACK field.
- If the transmitting node does not receive anyacknowledgement of
data
frame within a specifiedtime slot, it should retransmit.
Sixth field of 7-bits
ETHERNET:
Ethernet is very widely used as a local area network for general-purpose
computing.Because of its ubiquity and the low cost of Ethernet interfaces,it has seen
significant use as a network for embedded computing.
Ethernet is particularly useful when PCs are used as platforms,making it possible to
use standard components,and when the network does not have to meet rigorous realtime requirements.
The physical organization of an Ethernet is very simple, as shown in below Figure.
Ethernet Organisation
The network is a bus with a single signal path; the Ethernet standard allows for several
different implementations such as twisted pair and coaxial cable.
Unlike the I2C bus,nodes on the Ethernet are not synchronizedthey can send their
bits at any time. I2C relies on the fact that a collision can be detected and quashed
within a single bit time thanks to synchronization.
But since Ethernet nodes are not synchronized, if two nodes decide to transmit at the
same time,the message will be ruined. The Ethernet arbitration scheme is known as
Carrier Sense Multiple Access with Collision Detection (CSMA/CD).
The algorithm is outlined in below Figure.
A node that has a message waits for the bus to become silent and then starts
transmitting. It simultaneously listens, and if it hears another transmission that
interferes with its transmission, it stops transmitting and waits to retransmit.
The waiting time is random,but weighted by an exponential function of the number of
times the message has been aborted.
Figure 8.16 shows the exponential backoff function both before and after it is
modulated by the random wait time. Since a message may be interfered with several
times before it is successfully transmitted,the exponential backoff technique helps to
ensure that the network does not become overloaded at high demand factors.
The random factor in the wait time minimizes the chance that two messages will
repeatedly interfere with each other.
The maximum length of an Ethernet is determined by the nodes ability to detect
collisions. The worst case occurs when two nodes at opposite ends of the bus are
transmitting simultaneously. For the collision to be detected by both nodes, each
nodes signal must be able to travel to the opposite end of the bus so that it can be
heard by the other node. In practice, Ethernets can run up to several hundred meters.
Figure 8.17 shows the basic format of an Ethernet packet. It provides addresses of both
the destination and the source. It also provides for a variable-length data payload.
The fact that it may take several attempts to successfully transmit a message and that
the waiting time includes a random factor makes Ethernet performance difficult to
analyze.
It is possible to perform data streaming and other real-time activities on
Ethernets,particularly when the total network load is kept to a reasonable level,but care
must be taken in designing such systems.
Ethernet was not designed to support real-time operations; the exponential backoff
scheme cannot guarantee delivery time of any data.
Because so much Ethernet hardware and software is available,many different
approaches have been developed to extend Ethernet to real-time operation; some of
these are compatible with the standard while others are not.
There are three ways to reduce the variance in Ethernets packet delivery time
suppress collisions on the network
reduce the number of collisions
or resolve collisions deterministically.
INTERNET:
The header and data payload are both of variable length. The maximum total length of
the header and data payload is 65,535 bytes.
An Internet address is a number (32 bits in early versions of IP, 128 bits in IPv6). The
IP address is typically written in the form xxx.xx.xx.xx.
The names by which users and applications typically refer to Internet nodes, such as
foo.baz.com,are translated into IP addresses via calls to a Domain Name Server, one
of the higher-level services built on top of IP.
The fact that IP works at the network layer tells us that it does not guarantee that a
packet is delivered to its destination.
Packets that do arrive may come out of order. This is referred to as best-effort routing.
Since routes for data may change quickly with subsequent packets being routed along
very different paths with different delays, real-time performance of IP can be hard to
predict.
When a small network is contained totally within the embedded system, performance
can be evaluated through simulation or other methods because the possible inputs are
limited.
Since the performance of the Internet may depend on worldwide usage patterns, its
real-time performance is inherently harder to predict.
The Internet also provides higher-level services built on top of IP.
The Transmission Control Protocol (TCP) is one such example. It provides a
connection oriented service that ensures that data arrive in the appropriate order, and it
uses an acknowledgment protocol to ensure that packets arrive.
Because many higherlevel services are built on top of TCP, the basic protocol is often
referred to as TCP/IP.
Figure 8.21 shows the relationships between IP and higher-level Internet services.