0% found this document useful (0 votes)
8 views5 pages

I2c Bus& Can Bus

I2C (Inter-Integrated Circuit) is a serial communication protocol using two bi-directional lines (SDA for data and SCL for clock) and operates in master and slave modes. It transmits data in 9-bit packets that include start conditions, slave addresses, and acknowledgment bits. The CAN Bus is a message-based protocol designed for reliable communication between multiple Electronic Control Units (ECUs) without needing addressing schemas, utilizing a layered architecture for data transmission and error handling.

Uploaded by

kotra shankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

I2c Bus& Can Bus

I2C (Inter-Integrated Circuit) is a serial communication protocol using two bi-directional lines (SDA for data and SCL for clock) and operates in master and slave modes. It transmits data in 9-bit packets that include start conditions, slave addresses, and acknowledgment bits. The CAN Bus is a message-based protocol designed for reliable communication between multiple Electronic Control Units (ECUs) without needing addressing schemas, utilizing a layered architecture for data transmission and error handling.

Uploaded by

kotra shankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

I2C Bus

I2C stands for Inter-Integrated Circuit. It is a bus interface connection protocol


incorporated into devices for serial communication. It was originally designed by Philips
Semiconductor in 1982. Recently, it is a widely used protocol for short-distance
communication. It is also known as Two Wired Interface(TWI).

Working of I2C Communication Protocol :


It uses only 2 bi-directional open-drain lines for data communication called SDA and
SCL. Both these lines are pulled high.

Serial Data (SDA) – Transfer of data takes place through this pin.
Serial Clock (SCL) – It carries the clock signal.

I2C operates in 2 modes –

• Master mode

• Slave mode

Each data bit transferred on SDA line is synchronized by a high to the low pulse of each
clock on the SCL line.

According to I2C protocols, the data line can not change when the clock line is high, it
can change only when the clock line is low. The 2 lines are open drain, hence a pull-up
resistor is required so that the lines are high since the devices on the I2C bus are active
low. The data is transmitted in the form of packets which comprises 9 bits. The sequence
of these bits are –

1. Start Condition – 1 bit

2. Slave Address – 8 bit

3. Acknowledge – 1 bit
Start and Stop Conditions :
START and STOP can be generated by keeping the SCL line high and changing the
level of SDA. To generate START condition the SDA is changed from high to low
while keeping the SCL high. To generate STOP condition SDA goes from low to high
while keeping the SCL high, as shown in the figure below.

Repeated Start Condition :


Between each start and stop condition pair, the bus is considered as busy and no master
can take control of the bus. If the master tries to initiate a new transfer and does not want
to release the bus before starting the new transfer, it issues a new START condition. It is
called a REPEATED START condition.

Read/Write Bit :
A high Read/Write bit indicates that the master is sending the data to the slave, whereas
a low Read/Write bit indicates that the master is receiving data from the slave.

ACK/NACK Bit :
After every data frame, follows an ACK/NACK bit. If the data frame is received
successfully then ACK bit is sent to the sender by the receiver.

Addressing :
The address frame is the first frame after the start bit. The address of the slave with which
the master wants to communicate is sent by the master to every slave connected with it.
The slave then compares its own address with this address and sends ACK.

I2C Packet Format :


In the I2C communication protocol, the data is transmitted in the form of packets. These
packets are 9 bits long, out of which the first 8 bits are put in SDA line and the 9th bit is
reserved for ACK/NACK i.e. Acknowledge or Not Acknowledge by the receiver.

START condition plus address packet plus one more data packet plus STOP
condition collectively form a complete Data transfer.
CAN Bus:

Controller Area Network (CAN Bus) is defined as a message-based protocol that was
designed to provide reliable communication between multiple Electronic Control Units
(ECUs). It is a serial networking technology. Through a CAN bus,
various microcontrollers and devices can have real-time communication without the
need for a hosting computer. It does not need any kind of addressing schemas because
the protocol itself has unique identifiers providing the data about the urgency and
significance of the transmitted message. CAN bus is considered a half-duplex, high
speed, and two wired networking system which holds great dominance over traditional
networking systems like RS232. When compared with consistency and functionality,
CAN buses are most effective and provide enhanced broadcasting between ECUs.

The CAN bus employs a multi-master bus pattern for the transmission of frames between
various nodes and it can be able to manage error handling scenarios. The core allows the
user to establish a reliable and economic connection between multiple ECUs. The CAN
protocol seems to be a memory-mapped I/O device for the host processors having the
access to CAN core in handling either the frames transmission or reception.

CAN Layered Architecture:


The CAN communication protocol ISO 11898 defines how data is communicated
between multiple devices in the network. The physical medium which is defined by the
physical layer in the architecture is responsible for establishing actual communication.

Data – Link layer – This layer is used for establishing data transmission between multiple
nodes. Even holds the responsibility for identifying and removing the errors that take
place at the physical layer. This layer again consists of two sub-layers which are of:

MAC – Medium Access Control – This layer describes how various devices present in the
network can receive accessibility to the medium. Here, data signaling, error
identification, message encapsulation and decapsulation take place.

LLC – Logical Link Control – This layer offers logic for the data-link layer because it
manages flow controlling, multiplexing, acceptance filtering, recovery handling, and
overload warnings.

Physical Layer – This layer is useful in raw information transmission. It outlines the
properties for the parameters like timing, information rate levels, voltage ratings, and
connector. This ISO 11898 has mainly three portions.

PCS – Physical Coding Sublayer – It observes that when the functional connection has
been established and this layer is defined in Fast Ethernet, 10 Gigabit Ethernet, and
gigabit Ethernet standards. It performs encoding and decoding of information,
scrambling and descrambling, and rate variance compensation.

PMA – Physical Medium Attachment – It executes the framing of data and is responsible
for transmitting and receiving high-speed information based on the structure of the
transceiver channel. It also performs octet synchronization.

PMD – Physical Medium Dependent – It describes the particulars of transmission and


reception of every bit that takes place on the physical medium. It also has a transceiver
required for the medium.

MDI – Medium Dependent Interface – It defines the interface for the medium in the
network which is useful in carrying the transmission.

CAN Data Frame Format:

o SOF: SOF stands for the start of frame, which indicates that the new frame is
entered in a network. It is of 1 bit.
o Identifier: A standard data format defined under the CAN 2.0 A specification uses
an 11-bit message identifier for arbitration. Basically, this message identifier sets
the priority of the data frame.

o RTR: RTR stands for Remote Transmission Request, which defines the frame type,
whether it is a data frame or a remote frame. It is of 1-bit.

o Control field: It has user-defined functions.

1. IDE: An IDE bit in a control field stands for identifier extension. A dominant
IDE bit defines the 11-bit standard identifier, whereas recessive IDE bit
defines the 29-bit extended identifier.

2. DLC: DLC stands for Data Length Code, which defines the data length in a
data field. It is of 4 bits.

3. Data field: The data field can contain upto 8 bytes.

o CRC field: The data frame also contains a cyclic redundancy check field of 15 bit,
which is used to detect the corruption if it occurs during the transmission time.
The sender will compute the CRC before sending the data frame, and the receiver
also computes the CRC and then compares the computed CRC with the CRC
received from the sender. If the CRC does not match, then the receiver will
generate the error.

o ACK field: This is the receiver's acknowledgment. In other protocols, a separate


packet for an acknowledgment is sent after receiving all the packets, but in case
of CAN protocol, no separate packet is sent for an acknowledgment.

o EOF: EOF stands for end of frame. It contains 7 consecutive recessive bits known
End of frame.

You might also like