I2C and CAN Protocols
I2C and CAN Protocols
COMMUNICATION
PROTOCOLS
𝟐
𝐈 𝐂 & CAN
SERIAL BUS
COMMUNICATION
PROTOCOLS
𝟐
𝐈 𝐂 Protocol
Introduction to I2C
I2C is well known bus invented by PHILIPS.
The I2C Bus has two lines that carry its signals −
one line is for clock named as SCL and second is
for data named as SDL.
Idle
DATA DATA
Read Write
Get Send
DATA DATA
SERIAL BUS
COMMUNICATION
PROTOCOLS
CAN Protocol
Serial Communication
Distributed
Control Area Network (CAN)
Bus
Distributed Control Area Network
vs.
http://canbuskit.com/what.php
11
Message Oriented Transmission Protocol
Each node – receiver & transmitter
A sender of information transmits to all devices on the bus
All nodes read message, then decide if it is relevant to them
All nodes verify reception was error-free
All nodes acknowledge reception
12
Message Format
Each message has an ID, Data and overhead.
Data –8 bytes max
Overhead – start, end, CRC, ACK
13
Bus Arbitration
Arbitration – needed when multiple nodes try to transmit at the same time
Only one transmitter is allowed to transmit at a time.
A node waits for bus to become idle
Nodes with more important messages continue transmitting
14
Bus Arbitration
Message importance is encoded in message ID.
Lower value = More important
As a node transmits each bit, it verifies that it sees the same bit
value on the bus that it transmitted.
A “0” on the bus wins over a “1” on the bus.
Losing node stops transmitting, winner continues.
15
CAN protocol
There is a CAN controller between the CAN line and
the host node.
There are 5-fields in CAN data Frame Format and START & STOP Bits
1. Arbitration field
2. Control Field [Specifies the number of bytes of data to follow (0-8)]
3. Data Field
4. CRC Field [cyclic redundancy check code]
5. Acknowledge Field
Protocol defined First field in
frame bits
First field of 12 bits ─ “Arbitration field”.
ACK = '1 BIT' and receiver sends back '0' in this slot when
the receiver detects an error in the reception.
27
Self Study
USB Protocol…………………..!!!