CAN is Serial
Few data lines will be needed for exchange because it is serial. We have that as our first CAN advantage.
CAN is Asynchronous
The second benefit is that it does not require a clock signal for exchange.
CAN is differential Bus
What are the advantages of differential bus use? Automobile vehicles go from one location to another. It creates vibration and travels in various EMF environments, which introduces noise into the transmitted signal. Differential buses use two distinct data lines to transmit the original signal (CAN HI) and its counterpart (CAN LOW), which are then compared at the receiving end to filter out noise. Both the original and complement signals are equally impacted by noise introduced from the surroundings or other sources. + noise + (-noise) = 0 is the result. In order to filter the common mode noise in CAN buses, differential buses are utilized. In CAN bus, we hear the terms CANHI and CANLOW a lot. They are nothing but the complement signals of differential bus.
CAN Does Not Use Node Addressing
Because CAN does not employ node addressing, source and destination addresses are not encoded in the can frame. As a result, every node in the network is aware of a message's transmission. They retrieve and process the packet if they are interested in it; if not, they just disregard it.
CAN Is Based On CSMA
The CAN adheres to the democratic ideal. What does democracy mean? Everyone is treated equally before the law in a democracy. It is predicated on the idea of "For the people by the people," which implies that there is no one master, even though this is not practically true. When given the opportunity, anyone can become a master
The same is true for the CAN. Every node in the network can broadcast when the bus is free. Therefore, until the bus is free, each node should keep an eye on it. They have the same rights to transmit once they determine the bus is free. In technical terms, this is known as CSMA. This presents the CAN bus with still another difficulty. Considering that it is serial communication, it is unable to permit all nodes to broadcast simultaneously. That is to say, the bits are moving serially. There will be a collision if it is permitted. The CAN bus uses the idea of arbitration to determine the winner in order to prevent collisions. The packet or arbitration ID is used by arbitration to determine the winner. The higher the priority to transmit, the lower the identification value.
When CAN_H and CAN_L voltage is approximately 2.5V then the bus is considered as free. If there is voltage variation then that is considered as busy. When the bus is detected as free, each node in the network will try to transmit if they have message to transmit. When they want to transmit they send start of frame first. When more than one node want to transmit at the same time that will end up in collision. That is avoided in the CAN bus via arbitration. We can understand this by means of a simple example
Let us say we have “CAN book” in the library and librarian says, “The people who can come at 7:00 am can get this book”. Then every candidate who need that book monitor the clock until the time is 7:00 a.m. if there is only one person at 7: 00 am then there is no issue. He can get the book. When there are more than one come for the book at 7:00 am, he cannot give single book to more than one. He should have some other strategy to filter one. Here opening the door for everyone to come at 7:00 am and they monitor the time to become 7:00 am is analogous to CSMA. When more than one comes, deciding who can receive the book via some other strategy is analogous to arbitration. The Arbitration process selects the packet which has least identifier as winner of arbitration.
CAN is Based on Multi-master and Broadcasting Concept
Pear-to-pear communication is not what CAN communication is. Source and destination addresses are not allowed in the frame structure of CAN packets. As a result, each node that wishes to send a message broadcasts it over the bus. Any other node connected to the same bus is aware of the transmission and, if it is interested in that packet, will retrieve the message from the bus; if not, it will disregard it. To determine whether to accept or reject an incoming packet, each node in the bus applies a filer mask to its identifier.CAN Have Sophisticated Error Detection & Handling system: Peripheral circuitry is used to implement error detection and handling in CAN buses. Therefore, no further program is needed for it. Making cars safer, more dependable, and more fuel-efficient was the design objective of CAN. The 1991-created CAN 2.0 A & B specification is widely utilized. In 2012, Bosh GmbH developed a new standard known as CANFD. We can attain a band width of 8Mb/s using CAN FD, which is eight times faster than the CAN 2.0 bus speed. CAN FD uses two baud rates and can send 64 bytes in a single packet. Control bits are transmitted at a lower baud rate, and data bits are transmitted at a higher baud rate. With ID ISO11898, the CAN is standardized by ISO. In addition to the automotive sector, CAN is utilized in avionics, industrial automation, agricultural networks, and other fields.
Communication layers of CAN bus
The CAN standard includes only two layers those are implemented in circuit level
- Physical layer
- Data link layer
Hence we must write a program for the other layer. It is an established standard that has been on the market for almost 45 years at the time this article was written. The market is filled with CAN tools and goods. With CAN 2.0, we can only reach a maximum bandwidth of 1 Mb/sec. To exchange packets, the CAN bus uses a straightforward transmission medium consisting of a twisted pair of wires. Other physical links, such radio or fiber optic links are also supported. It is the most widely used protocol in the automotive and industrial sectors. The CRC technique is used by the CAN to identify errors. Let me explain the CRC mechanism with a simple example
Assume for the moment that I compose a letter to a friend and include the count of "a" at the end of the letter. My friend counts the number of "a"s in the letter he receives and compares it to the number encoded at the end of the letter. The letter is genuine if the number of "a"s that my friend counts and the number that I encode at the end match; if not, it is biased. The CAN use the similar technique. The packet's transmitter attaches a 15-bit numerical value at the conclusion of the sent frame after calculating it using the frame bits from the beginning to the end of the data. The receiver uses the same procedure to calculate the same 15-bit value when it receives frame bits serially. The frame is deemed legitimate if the transmitter's and receiver's computed CRCs match and there is no manipulation of the bus's bits; otherwise, it is not.