SlideShare a Scribd company logo
1 of 45
Download to read offline
Main Features:
o CAN stands for Controller Area Network
o Serial communication protocol
o Supports real time control
o High level of error handling.
o Multi-Master Multi-Slave communication.
o Message based protocol .
CAN Application:
o Motor vehicles
o Utility vehicles
o Industrial automation.
o Other applications for CAN are:
trains, medical equipment, building automation,
household appliances, and office automation.
Automotive
Industrial
o Initially developed for motor
vehicles by Robert Bosch
GmbH, Germany, starting
1983, also holding the CAN
license.
o CAN is internationally
standardized by ISO and
SAE in 1986 .
CAN History:
CAN
Spec
ISO/OSI
SAE
Physical Layer
Data Link Layer
Application Layer
...
CAL, CANopen (CiA),
DeviceNet (ODVA),
SDS (Honeywell)
7
2
1 }CAN
o The original CAN specifications (Versions 1.0, 1.2 and 2.0A) specify
an 11 bit message identifier.
o 16 messages with the lowest priority (2032-2047) are reserved.
CAN History:
Identifier
11 bits
CRC
Field
Data Field
(0..8 Bytes)
Control
Field
ACK
Field
End
of Frame
Start of
Frame
Standard CAN
Extended CAN
o CAN specification Version 2.0B updated to meet the SAE J1939
standard .
o 29-bit identifier is made up of the 11-bit identifier ("Base ID") and the
18-bit Extended Identifier ("ID Extension").
o CAN v2.0B still allows message identifier lengths of 11 bits to be
used.
CAN History:
Identifier
29 bits
CRC
Field
Data Field
(0..8 Bytes)
Control
Field
ACK
Field
End
of Frame
Start of
Frame
CAN Specification :
o 2.0A :
Considers 29 bit ID as an error
o 2.0B Passive:
Ignores 29 bit ID.
o 2.0B Active :
Handles both 11 and 29 bit ID.
V2.0B
Active CAN
Tx/Rx OK Tx/Rx OK
Frame with
11 bit ID
V2.0B
Passive CAN
V2.0A CAN
Frame with
29 bit ID
ToleratedTx/Rx OK
Tx/Rx OK
Bus
ERROR
Three Types of CAN Modules :
Care when
mixing
protocol
versions !
CAN properties :
CAN-Bus
(logical)
CAN
Nodes
e.g.
ABS
e.g.
EMS
Node A Node n
o Multi Master Concept
o Number of nodes not limited by protocol
o No node addressing, Message identifier
specifies contents & priority
o Easy connection/ disconnection of nodes
o Broadcast capability
o Sophisticated error-detection and error
handling mechanisms
o Non-Return-to-Zero bit coding
Signal to
transmit a“0”
Signal to
transmit a“1”
HIGH
LOW
HIGH
LOW
CAN properties :
o High data transfer rate of 1000 kbps at a
maximum bus length of 40 meters
o Twisted wire pair is the bus medium
used for CAN.
o Multiple Access/Collision Detection
with Non-Destructive Arbitration.
CAN properties :
o The bus can have one of two complementary
logical:
o Dominant(„0‟)
o Recessive(„1‟).
o During simultaneous transmission of
‟dominant‟ and ‟recessive ‟bits, the resulting
bus value will be ‟dominant‟.
A B C BUS
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
CAN properties :
A B C BUS
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
Node A Node B Node C
5V
Bus State: recessive (High)
R T
recessive
R T
recessive
R T
recessive
1 1 1
CAN properties :
A B C BUS
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
Node A
CAN-Bus
(single logical
bus line)
Node B Node C
5V
Bus State: dominant
R T
dominant
R T
recessive
R T
recessive
0 1 1
Bus Arbitration :
o CAN protocol handles bus accesses according to :
“Carrier Sense Multiple Access with Arbitration on Message Priority”
(CSMA/CD w/AMP).
o It avoids collisions of transmit messages simultaneously
o Arbitration priories the massages using the identifier .
o It isn‟t permitted for different nodes to send messages with the same
identifier as arbitration could fail leading to collisions and errors.
CAN properties :
Node X
Node A
Node B
Node C
Transmit
Request
Rest of
Frame
Arbitration
phase
Node A
Node B
Node C
Node B loses Arbitration Node C loses Arbitration
Start
Bit
CAN Bus
Identifier Field
Bus Arbitration :
CAN properties :
Bus Arbitration :
CAN properties :
o NRZ if there are no edges, receivers
lose track of bits.
o Periodic edges allow receiver to
resynchronize to sender clock
o Bit stuffing is used to ensure
synchronization of all bus nodes.
Bit Stuffing :
CAN properties :
o When five consecutive bits of the
same polarity transmitted:
Transmitter insert one additional bit of
the opposite polarity.
o The receiver checks the number of
bits with the same polarity
Removes the stuff bits again from the
bit stream. "destuffing".
Bit Stuffing :
CAN properties :
o Hard Synchronization:
• CAN synchronize the message transfer
for each node with the leading edge of
SOF bit.
o Re-synchronize
• With each recessive to dominant edge.
SOF ID10 ID9 ID8 ID7
All nodes synchronize on
leading edge of SOF bit
(Hard Synchronization)
Re-
sync
Re-
sync
Re-
sync
Re-
sync
Synchronization:
CAN properties :
CAN Frames
Remote
Frame
Inter-
frame
Space
Data
Frame
Overload
Frame
Error
Frame
Standard CAN Frames
11 1
Standard Data Frame Inter Frame Space
dominant
recessive
1 1 1 4 0...64 15
StartofFrame
IdentifierField
DataField
DataLenghtCode
CRCSequence
CRCDelimiter
ACKDelimiter
ACKSlot
EndofFrame
Intermission
BusIdle
Arbitration
Field
Control
Field
CRC
Field
Acknowledge
Field
IDEBit(D)
RTRBit(D)
(reserved(D))
1 7 311
CAN Frames
Standard Data Frame
RTR: Remote Transmission Request
IDE :Identifier Extension
CRC :Cyclic Redundancy
CAN FramesCAN Frames
Standard Data Frame
o SRR (Substitute Remote Request) :replace for the RTR .
o r0 and r1: reserve for future applications.
Standard Data Frame Inter Frame Space
dominant
recessive
1 11 1 1 1 4 0...64 15 1 1 1 7 3
Standard Remote Frame Inter Frame Space
dominant
recessive
1 11 1 1 1 4 15 1 1 1 7 3
CAN Frames
Remote Frame
CAN Frames
Data and Remote Frame scenario
Data Frame; Identifier 'oil_tmp';
contains desired information ~~~~
~~~~~
Remote Frame; Identifier 'oil_tmp'Node A
Node B
(oil temp.-
sensor)
How hot is the oil ?
115°C
115 °C !
CAN Frames
Error Frame
Overload Frame
o Generated due to internal conditions of
a receiver, which requires a delay of
the next DATA or REMOTE frame.
Inter-Frame space
o There are 5 error detection mechanisms:
CAN Error Detection:
ACK
Error
Form
Error
Stuff
Error
Bit
Error
CRC
Error
o Calculated and received CRC checksum must match.
CAN Error Detection:
CRC
CAN_H
Node A Node B
CAN_L
Received
CRC Checksum:
Calculated
CRC Checksum:
Transmitted
CRC Checksum:
Calculated
CRC Checksum:
1234h
Idle
Receive
Transmit
Idle
Receive
Transmit
CRC Sequence
Data Frame
1234h
1234h 1234h match
o Otherwise Frame was not received correctly (CRC Error)
CAN Error Detection:
CRC
mismatch
CAN_H
Node A Node B
CAN_L
Received
CRC Checksum:
Calculated
CRC Checksum:
Transmitted
CRC Checksum:
Calculated
CRC Checksum:
1234h
Idle
Receive
Transmit
Idle
Receive
Transmit
Error Frame
1235h
1234h 1234h
o No Dominant Bits allowed in:
• –CRC Delimiter
• –ACK Delimiter
• –End of Frame
• –Inter-frame space
o Otherwise Form Error is generated
CAN Error Detection:
Frame Check
o Each Node transmits a bit must be
able to read back it correctly.
o Dominant bits are allowed to
overwrite recessive bits only in the
arbitration phase and ACK slot.
o Otherwise, a bit error should be
issued.
CAN Error Detection:
Bit Monitoring
o 6 consecutive bits with same
polarity are not allowed between
Start Of Frame and CRC Delimiter
o Otherwise Bit Stuffing Error.
CAN Error Detection:
Bit Stuffing
o A frame must be acknowledged
by at least one other node.
o Otherwise ACK Error.
CAN Error Detection:
Acknowledgment (ACK)
o Detected errors are made public to all other nodes via Error Frames.
o The transmission of the erroneous message is aborted and the frame is
repeated as soon as possible.
CAN Error Handling:
CAN_H
Node A Node CNode B
Error Frame
Error
detected
Error
reco-
gnized
Error
reco-
gnized
Data Frame
Idle
Receive
Transmit
Idle
Receive
Transmit
Idle
Receive
Transmit
CAN_L
o CAN node has three error states
• Error active
• Error passive
• Bus off
o State is according to the value of
their internal error counters.
o the error counters are updated according specific rules:
• For each error on reception or transmission,
 Error counters are incremented.
• For each successful transaction,
 Error counters are decremented .
CAN Error Handling:
Node Error State
o The error-active Node state:
• State after reset.
• Receive and transmit messages.
• Transmit active Error Frames ,
• Both error counters are smaller than or equal
to 127.
Reset
REC<=127
and
TEC<=127
Error
active
Error Handling:
Node Error State
o the error-passive node state/;
• Either the receive or the transmit error counter reach to128.
• Messages can still be received and transmitted.
• After transmission ,the node must suspend transmission.
 Must wait 8 bit times longer than error-active nodes before
it may transmit another message.
• Passive Error Frames can be transmitted
• If both error counters go below 128 again
 Node switches back to the error-active state.
Error
passive
REC>127
or
TEC>127
Error Handling:
Node Error State
o The bus-off state
• Transmit error counter exceeds the value
of 255.
• All bus activities are stopped which
makes it temporarily.
• Messages can be neither received nor
transmitted.
• To return to the error active state and to
reset error counter :
 CAN node has to be reinitialized.
Error Handling:
Node Error State
Reset
TEC>255
Re-Initialization only
Bus
off
o Error Frame consists of 2 fields
• Error Flag field
• Error Delimiter field.
o Error Delimiter :
• Consists of 8 recessive bits and allows the bus nodes to restart bus
communications cleanly after an error.
o There are two forms of Error Flag fields.
o Form of the Error Flag field depends on the “error status” of the node
that detects the error.
Error Handling:
Error Frame:
o If “error-active” node detects a bus error :
• Node interrupts transmission by generating an “active error flag”.
• “Active error flag” is composed of six consecutive dominant bits.
• This bit sequence actively violates the bit stuffing rule.
• All other stations recognize the resulting bit stuffing error and in turn generate
Error Frames themselves.
• Error Flag field therefore consists of between six and twelve consecutive
dominant bits (generated by one or more nodes).
Error Handling:
Error Frame:
o If a “error passive” node detects a bus error:
• Node transmits an “passive Error Flag”.
• “Passive Error Flag” consists of six consecutive recessive bits,
• Error Frame consists of 14 recessive .
• Unless the bus error is detected by master node, the transmission of an Error
Frame by an “error passive” node will not affect any other node on the network.
• If the bus master node generates an “error passive flag” then this may cause
other nodes to generate error frames due to the resulting bit stuffing violation.
Error Handling:
Error Frame:
o CAN chips Dividing into:
o Basic-CAN devices
o Full-CAN devices.
o It‟s possible to use both Basic-CAN and Full-CAN devices in the
same network.
CAN Devices
o Only basic functions concerning the filtering and management of
CAN messages are implemented in hardware.
o Provides one transmit buffer and one or two receive.
o CAN receiver accept message which filtering certain CAN identifiers
are stored in the receive buffer.
CAN Devices
Basic-CAN devices:
o Only two buffers for the reception of messages the host controller is
quite busy reading and storing the incoming messages before they get
overwritten by the following ones which results in a quite high CPU
load.
o The answering of Remote Frames with the corresponding Data Frame
has to be handled by the host controller.
o Basic-CAN devices should only be used at low baudrates and low bus
loads with only a few different messages.
CAN Devices
Basic-CAN devices:
CAN Devices
Full-CAN devices
Host CPU
CPU load
low high

Status/Control
Registers
Message
Object 1
CAN
Protocol
Controller
Acceptance
Filtering
Host
Inter-
face
Message
Object 2
Message
Object n
...
Receive
Buffer(s)
CAN
Bus
BusInterface
o Provide the whole hardware for convenient acceptance filtering and
message management.
o For each message to be transmitted or received these devices have so
called message objects which contains all information regarding the
message (e.g. identifier, data bytes etc.).
o During the initialization, the host CPU defines which messages are to
be sent and which are to be received.
CAN Devices
Full-CAN devices
o Only if the CAN controller receives a message whose identifier
matches with one of the identifiers of the programmed (receive-)
message objects the message is stored and the host CPU is informed
by interrupt.
o Remote Frames can be answered automatically by the Full-CAN
controller with the corresponding Data Frame.
o the CPU load is strongly reduced compared to the Basic-CAN
solution.
o Using Full CAN devices, high baudrates and high bus loads with
many messages can be handled.
CAN Devices
Full-CAN devices
o http://www.engineersgarage.com/article/what-is-controller-
area-network?page=3
o http://www.nxp.com/news/press-releases/2013/12/nxp-releases-
smallest-most-efficient-can-system-basis-chips-for-in-vehicle-
networks.html#!
CAN :

More Related Content

What's hot

What's hot (20)

Control Area Network
Control Area NetworkControl Area Network
Control Area Network
 
Controller Area Network(CAN)
Controller Area Network(CAN)Controller Area Network(CAN)
Controller Area Network(CAN)
 
CAN- controlled area network
CAN- controlled area networkCAN- controlled area network
CAN- controlled area network
 
CAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus ProtocolCAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus Protocol
 
Controller area network protocol
Controller area network protocolController area network protocol
Controller area network protocol
 
Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)
 
Controller area network (can bus)
Controller area network (can bus)Controller area network (can bus)
Controller area network (can bus)
 
Controller area network
Controller area networkController area network
Controller area network
 
Controller area network -ppt
Controller area network -pptController area network -ppt
Controller area network -ppt
 
Local Interconnect Network
Local Interconnect NetworkLocal Interconnect Network
Local Interconnect Network
 
Can Bus communication Protocol
Can Bus communication ProtocolCan Bus communication Protocol
Can Bus communication Protocol
 
Lin bus
Lin busLin bus
Lin bus
 
CAN F28x
CAN F28xCAN F28x
CAN F28x
 
Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)
 
Ca npp t
Ca npp tCa npp t
Ca npp t
 
Can overview
Can overviewCan overview
Can overview
 
A SEMINAR REPORT ON CAN BUS PROTOCOL
A SEMINAR REPORT ON CAN BUS PROTOCOLA SEMINAR REPORT ON CAN BUS PROTOCOL
A SEMINAR REPORT ON CAN BUS PROTOCOL
 
Canbus
CanbusCanbus
Canbus
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
LIN protocol description
LIN protocol descriptionLIN protocol description
LIN protocol description
 

Similar to Can bus

Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3Ankur Rastogi
 
Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3Ankur Rastogi
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacingRAMPRAKASHT1
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Kshitij Singh
 
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterUniversal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterTejas Shetye
 
I2C-Bus Design and Verification Specs
I2C-Bus Design and Verification SpecsI2C-Bus Design and Verification Specs
I2C-Bus Design and Verification SpecsMostafa Khamis
 
final_of_can_bus_ (1).ppt
final_of_can_bus_ (1).pptfinal_of_can_bus_ (1).ppt
final_of_can_bus_ (1).pptZiadAlfawadleh1
 
7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptx7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptxusamamaqsod1
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemsRaghunath reddy
 
CONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptxCONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptxVairaPrakash2
 

Similar to Can bus (20)

Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3
 
Can network development using arm cortex m3
Can network development using arm cortex m3Can network development using arm cortex m3
Can network development using arm cortex m3
 
UNIT 2b.pptx
UNIT 2b.pptxUNIT 2b.pptx
UNIT 2b.pptx
 
CAN_Introduction.docx
CAN_Introduction.docxCAN_Introduction.docx
CAN_Introduction.docx
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
Role of CAN BUS in automotives
Role of CAN BUS in automotivesRole of CAN BUS in automotives
Role of CAN BUS in automotives
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1
 
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterUniversal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
 
I2C-Bus Design and Verification Specs
I2C-Bus Design and Verification SpecsI2C-Bus Design and Verification Specs
I2C-Bus Design and Verification Specs
 
pbchwp
pbchwppbchwp
pbchwp
 
CAN.ppt
CAN.pptCAN.ppt
CAN.ppt
 
CAN BUS.ppt
CAN BUS.pptCAN BUS.ppt
CAN BUS.ppt
 
CAN BUS.pptx
CAN BUS.pptxCAN BUS.pptx
CAN BUS.pptx
 
final_of_can_bus_ (1).ppt
final_of_can_bus_ (1).pptfinal_of_can_bus_ (1).ppt
final_of_can_bus_ (1).ppt
 
7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptx7.MODBus and CANBus.pptx
7.MODBus and CANBus.pptx
 
Computer Networks
Computer NetworksComputer Networks
Computer Networks
 
Mast content
Mast contentMast content
Mast content
 
communication interfaces-Embedded real time systems
communication interfaces-Embedded real time systemscommunication interfaces-Embedded real time systems
communication interfaces-Embedded real time systems
 
CONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptxCONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptx
 
can bus theory solution
can bus theory solutioncan bus theory solution
can bus theory solution
 

More from محمدعبد الحى (15)

Iso26262 component reuse_webinar
Iso26262 component reuse_webinarIso26262 component reuse_webinar
Iso26262 component reuse_webinar
 
Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32 Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32
 
Embedded Systems in Automotive
Embedded Systems in Automotive Embedded Systems in Automotive
Embedded Systems in Automotive
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
CPU Architecture
CPU ArchitectureCPU Architecture
CPU Architecture
 
8 bit microcontroller
8 bit microcontroller8 bit microcontroller
8 bit microcontroller
 
Matlab workshop
Matlab workshopMatlab workshop
Matlab workshop
 
Timers
TimersTimers
Timers
 
Interrupts
InterruptsInterrupts
Interrupts
 
Uart
UartUart
Uart
 
Sw testing
Sw testingSw testing
Sw testing
 
Rtos
RtosRtos
Rtos
 
Dio
DioDio
Dio
 
Micro controller
Micro controllerMicro controller
Micro controller
 
Day1
Day1Day1
Day1
 

Recently uploaded

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 

Recently uploaded (20)

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 

Can bus

  • 1. Main Features: o CAN stands for Controller Area Network o Serial communication protocol o Supports real time control o High level of error handling. o Multi-Master Multi-Slave communication. o Message based protocol .
  • 2. CAN Application: o Motor vehicles o Utility vehicles o Industrial automation. o Other applications for CAN are: trains, medical equipment, building automation, household appliances, and office automation. Automotive Industrial
  • 3. o Initially developed for motor vehicles by Robert Bosch GmbH, Germany, starting 1983, also holding the CAN license. o CAN is internationally standardized by ISO and SAE in 1986 . CAN History: CAN Spec ISO/OSI SAE Physical Layer Data Link Layer Application Layer ... CAL, CANopen (CiA), DeviceNet (ODVA), SDS (Honeywell) 7 2 1 }CAN
  • 4. o The original CAN specifications (Versions 1.0, 1.2 and 2.0A) specify an 11 bit message identifier. o 16 messages with the lowest priority (2032-2047) are reserved. CAN History: Identifier 11 bits CRC Field Data Field (0..8 Bytes) Control Field ACK Field End of Frame Start of Frame Standard CAN
  • 5. Extended CAN o CAN specification Version 2.0B updated to meet the SAE J1939 standard . o 29-bit identifier is made up of the 11-bit identifier ("Base ID") and the 18-bit Extended Identifier ("ID Extension"). o CAN v2.0B still allows message identifier lengths of 11 bits to be used. CAN History: Identifier 29 bits CRC Field Data Field (0..8 Bytes) Control Field ACK Field End of Frame Start of Frame
  • 6. CAN Specification : o 2.0A : Considers 29 bit ID as an error o 2.0B Passive: Ignores 29 bit ID. o 2.0B Active : Handles both 11 and 29 bit ID. V2.0B Active CAN Tx/Rx OK Tx/Rx OK Frame with 11 bit ID V2.0B Passive CAN V2.0A CAN Frame with 29 bit ID ToleratedTx/Rx OK Tx/Rx OK Bus ERROR Three Types of CAN Modules : Care when mixing protocol versions !
  • 7. CAN properties : CAN-Bus (logical) CAN Nodes e.g. ABS e.g. EMS Node A Node n o Multi Master Concept o Number of nodes not limited by protocol o No node addressing, Message identifier specifies contents & priority o Easy connection/ disconnection of nodes o Broadcast capability o Sophisticated error-detection and error handling mechanisms o Non-Return-to-Zero bit coding Signal to transmit a“0” Signal to transmit a“1” HIGH LOW HIGH LOW
  • 8. CAN properties : o High data transfer rate of 1000 kbps at a maximum bus length of 40 meters o Twisted wire pair is the bus medium used for CAN. o Multiple Access/Collision Detection with Non-Destructive Arbitration.
  • 9. CAN properties : o The bus can have one of two complementary logical: o Dominant(„0‟) o Recessive(„1‟). o During simultaneous transmission of ‟dominant‟ and ‟recessive ‟bits, the resulting bus value will be ‟dominant‟. A B C BUS 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1
  • 10. CAN properties : A B C BUS 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 Node A Node B Node C 5V Bus State: recessive (High) R T recessive R T recessive R T recessive 1 1 1
  • 11. CAN properties : A B C BUS 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 Node A CAN-Bus (single logical bus line) Node B Node C 5V Bus State: dominant R T dominant R T recessive R T recessive 0 1 1
  • 12. Bus Arbitration : o CAN protocol handles bus accesses according to : “Carrier Sense Multiple Access with Arbitration on Message Priority” (CSMA/CD w/AMP). o It avoids collisions of transmit messages simultaneously o Arbitration priories the massages using the identifier . o It isn‟t permitted for different nodes to send messages with the same identifier as arbitration could fail leading to collisions and errors. CAN properties :
  • 13. Node X Node A Node B Node C Transmit Request Rest of Frame Arbitration phase Node A Node B Node C Node B loses Arbitration Node C loses Arbitration Start Bit CAN Bus Identifier Field Bus Arbitration : CAN properties :
  • 14. Bus Arbitration : CAN properties :
  • 15. o NRZ if there are no edges, receivers lose track of bits. o Periodic edges allow receiver to resynchronize to sender clock o Bit stuffing is used to ensure synchronization of all bus nodes. Bit Stuffing : CAN properties :
  • 16. o When five consecutive bits of the same polarity transmitted: Transmitter insert one additional bit of the opposite polarity. o The receiver checks the number of bits with the same polarity Removes the stuff bits again from the bit stream. "destuffing". Bit Stuffing : CAN properties :
  • 17. o Hard Synchronization: • CAN synchronize the message transfer for each node with the leading edge of SOF bit. o Re-synchronize • With each recessive to dominant edge. SOF ID10 ID9 ID8 ID7 All nodes synchronize on leading edge of SOF bit (Hard Synchronization) Re- sync Re- sync Re- sync Re- sync Synchronization: CAN properties :
  • 19. 11 1 Standard Data Frame Inter Frame Space dominant recessive 1 1 1 4 0...64 15 StartofFrame IdentifierField DataField DataLenghtCode CRCSequence CRCDelimiter ACKDelimiter ACKSlot EndofFrame Intermission BusIdle Arbitration Field Control Field CRC Field Acknowledge Field IDEBit(D) RTRBit(D) (reserved(D)) 1 7 311 CAN Frames Standard Data Frame RTR: Remote Transmission Request IDE :Identifier Extension CRC :Cyclic Redundancy
  • 20. CAN FramesCAN Frames Standard Data Frame o SRR (Substitute Remote Request) :replace for the RTR . o r0 and r1: reserve for future applications.
  • 21. Standard Data Frame Inter Frame Space dominant recessive 1 11 1 1 1 4 0...64 15 1 1 1 7 3 Standard Remote Frame Inter Frame Space dominant recessive 1 11 1 1 1 4 15 1 1 1 7 3 CAN Frames Remote Frame
  • 22. CAN Frames Data and Remote Frame scenario Data Frame; Identifier 'oil_tmp'; contains desired information ~~~~ ~~~~~ Remote Frame; Identifier 'oil_tmp'Node A Node B (oil temp.- sensor) How hot is the oil ? 115°C 115 °C !
  • 23. CAN Frames Error Frame Overload Frame o Generated due to internal conditions of a receiver, which requires a delay of the next DATA or REMOTE frame. Inter-Frame space
  • 24. o There are 5 error detection mechanisms: CAN Error Detection: ACK Error Form Error Stuff Error Bit Error CRC Error
  • 25. o Calculated and received CRC checksum must match. CAN Error Detection: CRC CAN_H Node A Node B CAN_L Received CRC Checksum: Calculated CRC Checksum: Transmitted CRC Checksum: Calculated CRC Checksum: 1234h Idle Receive Transmit Idle Receive Transmit CRC Sequence Data Frame 1234h 1234h 1234h match
  • 26. o Otherwise Frame was not received correctly (CRC Error) CAN Error Detection: CRC mismatch CAN_H Node A Node B CAN_L Received CRC Checksum: Calculated CRC Checksum: Transmitted CRC Checksum: Calculated CRC Checksum: 1234h Idle Receive Transmit Idle Receive Transmit Error Frame 1235h 1234h 1234h
  • 27. o No Dominant Bits allowed in: • –CRC Delimiter • –ACK Delimiter • –End of Frame • –Inter-frame space o Otherwise Form Error is generated CAN Error Detection: Frame Check
  • 28. o Each Node transmits a bit must be able to read back it correctly. o Dominant bits are allowed to overwrite recessive bits only in the arbitration phase and ACK slot. o Otherwise, a bit error should be issued. CAN Error Detection: Bit Monitoring
  • 29. o 6 consecutive bits with same polarity are not allowed between Start Of Frame and CRC Delimiter o Otherwise Bit Stuffing Error. CAN Error Detection: Bit Stuffing
  • 30. o A frame must be acknowledged by at least one other node. o Otherwise ACK Error. CAN Error Detection: Acknowledgment (ACK)
  • 31. o Detected errors are made public to all other nodes via Error Frames. o The transmission of the erroneous message is aborted and the frame is repeated as soon as possible. CAN Error Handling: CAN_H Node A Node CNode B Error Frame Error detected Error reco- gnized Error reco- gnized Data Frame Idle Receive Transmit Idle Receive Transmit Idle Receive Transmit CAN_L
  • 32. o CAN node has three error states • Error active • Error passive • Bus off o State is according to the value of their internal error counters. o the error counters are updated according specific rules: • For each error on reception or transmission,  Error counters are incremented. • For each successful transaction,  Error counters are decremented . CAN Error Handling: Node Error State
  • 33. o The error-active Node state: • State after reset. • Receive and transmit messages. • Transmit active Error Frames , • Both error counters are smaller than or equal to 127. Reset REC<=127 and TEC<=127 Error active Error Handling: Node Error State
  • 34. o the error-passive node state/; • Either the receive or the transmit error counter reach to128. • Messages can still be received and transmitted. • After transmission ,the node must suspend transmission.  Must wait 8 bit times longer than error-active nodes before it may transmit another message. • Passive Error Frames can be transmitted • If both error counters go below 128 again  Node switches back to the error-active state. Error passive REC>127 or TEC>127 Error Handling: Node Error State
  • 35. o The bus-off state • Transmit error counter exceeds the value of 255. • All bus activities are stopped which makes it temporarily. • Messages can be neither received nor transmitted. • To return to the error active state and to reset error counter :  CAN node has to be reinitialized. Error Handling: Node Error State Reset TEC>255 Re-Initialization only Bus off
  • 36. o Error Frame consists of 2 fields • Error Flag field • Error Delimiter field. o Error Delimiter : • Consists of 8 recessive bits and allows the bus nodes to restart bus communications cleanly after an error. o There are two forms of Error Flag fields. o Form of the Error Flag field depends on the “error status” of the node that detects the error. Error Handling: Error Frame:
  • 37. o If “error-active” node detects a bus error : • Node interrupts transmission by generating an “active error flag”. • “Active error flag” is composed of six consecutive dominant bits. • This bit sequence actively violates the bit stuffing rule. • All other stations recognize the resulting bit stuffing error and in turn generate Error Frames themselves. • Error Flag field therefore consists of between six and twelve consecutive dominant bits (generated by one or more nodes). Error Handling: Error Frame:
  • 38. o If a “error passive” node detects a bus error: • Node transmits an “passive Error Flag”. • “Passive Error Flag” consists of six consecutive recessive bits, • Error Frame consists of 14 recessive . • Unless the bus error is detected by master node, the transmission of an Error Frame by an “error passive” node will not affect any other node on the network. • If the bus master node generates an “error passive flag” then this may cause other nodes to generate error frames due to the resulting bit stuffing violation. Error Handling: Error Frame:
  • 39. o CAN chips Dividing into: o Basic-CAN devices o Full-CAN devices. o It‟s possible to use both Basic-CAN and Full-CAN devices in the same network. CAN Devices
  • 40. o Only basic functions concerning the filtering and management of CAN messages are implemented in hardware. o Provides one transmit buffer and one or two receive. o CAN receiver accept message which filtering certain CAN identifiers are stored in the receive buffer. CAN Devices Basic-CAN devices:
  • 41. o Only two buffers for the reception of messages the host controller is quite busy reading and storing the incoming messages before they get overwritten by the following ones which results in a quite high CPU load. o The answering of Remote Frames with the corresponding Data Frame has to be handled by the host controller. o Basic-CAN devices should only be used at low baudrates and low bus loads with only a few different messages. CAN Devices Basic-CAN devices:
  • 42. CAN Devices Full-CAN devices Host CPU CPU load low high  Status/Control Registers Message Object 1 CAN Protocol Controller Acceptance Filtering Host Inter- face Message Object 2 Message Object n ... Receive Buffer(s) CAN Bus BusInterface
  • 43. o Provide the whole hardware for convenient acceptance filtering and message management. o For each message to be transmitted or received these devices have so called message objects which contains all information regarding the message (e.g. identifier, data bytes etc.). o During the initialization, the host CPU defines which messages are to be sent and which are to be received. CAN Devices Full-CAN devices
  • 44. o Only if the CAN controller receives a message whose identifier matches with one of the identifiers of the programmed (receive-) message objects the message is stored and the host CPU is informed by interrupt. o Remote Frames can be answered automatically by the Full-CAN controller with the corresponding Data Frame. o the CPU load is strongly reduced compared to the Basic-CAN solution. o Using Full CAN devices, high baudrates and high bus loads with many messages can be handled. CAN Devices Full-CAN devices