Talking about can bus

Source: Internet
Author: User

In the front of "talking about I2C bus" and "talking about the SPI Bus", we introduce the I2C, SPI Bus for the short transmission distance, simple protocol, small amount of data, mainly for IC (integrated circuit) communication between the "lightweight" occasions. But can bus is different, can bus defines more excellent physical layer, data link layer, and has rich, simple and heterogeneous upper layer protocol. What is CAN bus

CAN is "Controller area Network" abbreviation, namely "Controller LAN", is an ISO standard serial communication protocol. The can bus, developed and designed by the German BOSCH company, is used to meet the needs of an increasingly large electronic control system in automobiles, and its greatest feature is its scalability, affordability of high-speed communications and high stability. ISO organizes the CAN bus standardization through ISO11898 and ISO11519, so that it establishes the status of European automobile bus standard early. Today, can bus has been highly recognized by the industry, its application from the automotive electronics industry to extend to industrial automation, ships, medical equipment, industrial equipment and other fields. topology structure of CAN bus network

The physical connection of CAN bus requires only two lines, often called Can_h and can_l, which transmit data through differential signals. Can bus has two levels, respectively, the hidden level and the dominant level , the two levels have similar leakage I/O level signal between the "and" relationship: if the hidden level, the bus performance for the hidden level, if the dominant level encounter, the bus performance is the dominant level; If the recessive electricity and the dominant level meet, the bus performance is the dominant level.

A typical CAN bus network topology as shown in Figure 1, note that terminal resistors at both ends are required.

Figure 1. CAN Bus network topology

several data frames of CAN bus

The CAN Bus protocol provides 5 kinds of frames, namely data frame, remote control frame, error frame, overload frame and frame interval, and the application of data frame is most frequent in practice. The various frames are used as shown in table 1.
Table 1. Types and applications of CAN bus data frames

Frame type Use
Data frame A frame used to transmit data from a unit to a receiving unit
Overload frame For the receiving unit to inform that it is not ready to receive the frame
Frame interval A frame used to separate a frame of data from the previous frame
Remote control frame Frame for receiving cells to request data from a send unit with the same ID
Error frame Used to notify other cells of the wrong frame when an error is detected
the characteristics of CAN bus

Can bus network is a real multihomed network, when the bus is idle, any one node unit can request to become a host, send messages to the bus. The principle is: the first access to the Bus node unit can get the control of the bus; When multiple node units try to gain control of the bus, the quorum event occurs and the node unit with high priority gets the bus control. In the
CAN protocol, all messages are packaged and sent in a fixed data format. More than two node units send information at the same time, depending on the node identifier (often referred to as ID, also packaged in a fixed data format) to determine their priority relationship, so the ID is not to represent the destination address of the data sent, but represents the priority of each node access bus. So the CAN bus does not have the concept of "address" similar to other bus, when adding node units on the bus, the hardware and software of the other node units connected to the bus need not be changed. The
can bus communication rate and bus length, in the bus length is less than 40m, the data transmission rate can reach 1Mbps, and even if the bus length up to 1000m, the data transmission rate can still reach 50Kbps, regardless of the speed or transmission distance are significantly better than the common RS232, RS485, and I2C buses.
for bus errors, can bus has error detection function, error notification function, error recovery function Three kinds of countermeasures, should be for the following three points: all cell nodes can automatically detect errors on the bus, detected the wrong node unit will immediately notify the other node unit If the unit that is sending the message detects that the current bus has an error, force the cancellation of the current send immediately and repeatedly send the message to success.
Each node on the can bus can be judged by determining whether a temporary error (such as a momentary strong disturbance) or a persistent error (such as a bus break) is an error on the current bus. When a persistent error occurs on the bus, the node unit that causes the failure is automatically detached from the bus.
The number of nodes on the CAN bus is theoretically not capped, but the time delay and electrical load on the bus are actually received. Reduce the maximum communication rate, you can increase the number of nodes in the node unit, conversely, reduce the number of node units, the maximum communication rate can be improved.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.