written 6.3 years ago by |
A Controller Area Network (CAN bus) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other in applications without a host computer.
It is a message-based protocol, designed originally for multiplex electrical wiring within automobiles, but is also used in many other contexts.
The CAN bus is a multi-master, message broadcast system that specifies a maximum signaling rate of 1 megabit per second (bps).
Unlike a traditional network such as USB or Ethernet, CAN does not send large blocks of data point-to-point from node A to node B under the supervision of a central bus master.
In a CAN network, many short messages like temperature or RPM are broadcast to the entire network, which provides for data consistency in every node of the system.
Features and protocol Of CAN Standard Are :-
i) CAN Bus components and Output signal:
- Typically the CAN Bus is made up two wires, CAN-H (CAN High) and CAN-L (CAN Low) which connect to all the devices in the network.
- The signals on the two CAN lines have the same sequence of data, but their amplitudes are opposite. So if a pulse on the CAN-H line goes from 2.5V to 3.75V then the corresponding pulse on the CAN-L line goes from 2.5V to 1.25V (opposite than CAN-H).
- By sending the data in equal and opposite ways like this allows for greater noise immunity and therefore less chance of the data being corrupted.
- Status of bit with the value 0 = 2.5V differential voltage = dominant state
- Status of bit with the value 1 = 0V differential voltage = recessive state
ii) Speed:
A CAN device using a CAN controller receives or sends a bit at any instant by operating at a maximum rate of 1 Mbps.
iii) Cables and cable length:
It employs a twisted pair connection of 120 ohm line impedance at each controller node. This pair can run up to a maximum length of 40m.
iv) Network/ CAN bus components:
Figure shows an example of two connected devices as well as the components that make up a CAN Bus: CAN controller, CAN transceiver, two data bus terminals (R) and two data bus lines (CAN High line and CAN Low line).
CAN Controller: It receives the transfer data from the microcomputer integrated in the control unit/device (also known as CAN Node). The CAN controller processes this data and relays it to the CAN transceiver. Also, the CAN controller receives data from the CAN transceiver, processes it and relays it to the microcomputer integrated in the control unit/device (CAN Node).
- CAN Transceiver: It is a transmitter and receiver in one. It converts the data which the CAN controller supplies into electrical signals and sends this data over the data bus lines. Also, it receives data and converts this data for the CAN controller.
- CAN Data Bus Terminal: It is a resistor (R) typically of 120 ohms. It prevents data sent from being reflected at the ends and returning as an echo.
v) CAN Data Transfer Process:
The CAN data transfer process consists of the following stages-
- Supplying Data: The CAN Node provides data to the CAN controller for transfer.
- Sending Data: The CAN transceiver receives data from the CAN controller, converts it into electrical signals and sends them back into the network.
- Receiving Data: All other CAN Nodes networked with the CAN data bus become receivers.
- Checking Data: The CAN Node checks whether they require the data they have received for their functions or not.
- Accepting Data: If the received data is important, it is accepted and processed. If not, the received data is ignored.
vi) CAN Bus data message structure:
- SF = Start Field: indicates the beginning of a message with a dominant bit. So this field marks the start of the data protocol.
- Message Identifier: defines the level of priority of the data protocol. If, for instance, two CAN Nodes want to send their data protocol simultaneously, the CAN Node with the higher priority takes precedence. The lower the value the higher the priority of the message.
- Control, also known as Check Field: displays the number of items of information contained in the data field. This field allows any receiver to check whether it has received all the information transferred to it.
- Data Field: in this field the information is transferred to the other CAN Nodes.
- CRC = Cyclic Redundancy Check, also known as Safety Field: Contains 15 bit cyclic redundancy check code and a recessive delimiter bit. The CRC field is used for transfer faults detection.
- ACK = Acknowledge Field, also known as Confirmation Field: In this field the receivers signal to the transmitter that they have correctly received the data protocol. If an error is detected, the receivers notify the transmitter of this immediately. The transmitter then sends the data protocol again.
- EF = End Field: this field marks the end of the data protocol. This is the last possibility to indicate errors which lead to a repeat transfer.