CAN Protocol
CAN Protocol
AGENDA
Nodes
Network
ECUs
Speed
Length
Data
Why CAN?
Automotive Domain needed a way for all ECUs to communicate the data
among themselves.
Lets say the baud rate is 500kbps In 1 second, 500 *1000 bits can be transmitted
Lets say a single frame takes about 125 bits for example (without stuffing 111 bits)
So in a second the bus can fit around 2000 (500k /125) frames
Data Limit
Application 1 Application 2
frame Data
ECU 1 ECU 2
120 ohm
Can High Can Low
Wireless Protocols
• Bluetooth,
• WIFI
Wired Protocols
• Ethernet
• CAN
Synchronous: If a node has a frame to transmit, then it has to wait till its slot.
The time units are quantized and Nodes can transmit at particular point of
time only. Here all the nodes are in synch always and hence the name. Tx and
Rx nodes are synchronized with respect to time or clock. Eg: SPI, Flexray
Example of Peer-to-Peer protocols: Ethernet which uses Switch, SPI which uses CS.
Each CAN frame is identified with Message ID and no info about the Tx or Rx node.
Node based Can be understood with mobile phones. Usually Peer-Peer are node based.
Node D is transmitting the frame. Node A,B, C are getting the Message. Node A and B filters
the message IN and Node C Filters message Out
Filtering of Frame happens depending on Message ID.
Message filtering happens within CAN controller hardware using 2 configured parameters
called as mask and filter.
Simplex – Half Duplex – Full Duplex
CA CD CR
BUS
CA: Collision Avoidance Doesn’t let collision happen between its frames
CD: Collision Detection If collision happens between the frames, it is detected and a proper action taken.
CR: Collision Resolution If collision happens between frames, its resolved in that instance only successfully.
Temporary and Permanent Node Failures
Temporary Node failure is when the current ongoing frame is
destroyed by the node.
In CAN when we are normally talking of frames, we are referring Data
frames only.
Remote Frame
Frame Requesting for a Data Frame
A node wants a particular Data frame, so It sends the Remote frame with same
Message ID on the Bus.
This remote frame is followed by the Data frame on the bus transmitted by the node
who owns that data frame.
Hence Remote frame sending node got the data it requested for.
Now a days Remote frame is obsolete and not used in CAN protocol.
Error Frame
Error Frame signals an error condition in the data frame being transmitted currently.
If a node detects an error in the data frame being transmitted on the bus currently,
then it destroys that data frame and signals all other nodes by transmitting a error
frame.
The error can be detected by any of the receiver nodes or the transmitter node.
Overload Frame
Overload frame is transmitted by a node when it is overloaded and needs
some time to process the data frame received previously.
Strategy is that since the overloaded node needs some time so it buys that
time by keeping the bus busy with its overload frame preventing other
nodes to start transmitting data frames.
Refer : https://images.app.goo.gl/HyeBWwdpXUeRLVg18