This article is mainly about the related introduction of the CAN bus, and focuses on the detailed explanation of the reason why the CAN is connected to the 120 ohm terminal resistance.
CAN busCAN is the abbreviation of Controller Area Network (CAN). It was developed by the German company BOSCH, which is known for its research and development and production of automotive electronic products, and eventually became an international standard (ISO 11898), which is the most widely used internationally One of the field buses. In North America and Western Europe, the CAN bus protocol has become the standard bus for automotive computer control systems and embedded industrial control local area networks, and has the J1939 protocol designed specifically for large trucks and heavy machinery vehicles with CAN as the underlying protocol.
CAN bus is a serial data communication protocol developed by German BOSCH company in the early 1980s to solve the data exchange between numerous control and test instruments in modern cars. It is a multi-master bus, and the communication medium can be dual Stranded wire, coaxial cable or optical fiber. The communication rate can reach up to 1Mbps.
Complete framing of communication data
The CAN bus communication interface integrates the physical layer and data link layer functions of the CAN protocol, which can complete the framing of communication data, including bit filling, data block coding, cyclic redundancy checking, priority discrimination and other tasks.
Make the number of nodes in the network unlimited in theory
One of the biggest features of the CAN protocol is to abolish the traditional station address coding, and instead encode the communication data block. The advantage of using this method allows the number of nodes in the network to be theoretically unlimited. The identifier of a data block can be composed of 11-bit or 29-bit binary numbers, so 2 or more different data blocks can be defined. This way of encoding according to data blocks can also enable different nodes to receive the same data at the same time, which is very useful in distributed control systems. The length of the data segment is up to 8 bytes, which can meet the general requirements of control commands, working status and test data in the general industrial field. At the same time, 8 bytes will not occupy the bus for too long, thus ensuring real-time communication. The CAN protocol adopts CRC inspection and provides corresponding error handling functions to ensure the reliability of data communication. CAN's outstanding characteristics, extremely high reliability and unique design are particularly suitable for the interconnection of industrial process monitoring equipment. Therefore, it has received more and more attention from the industry and has been recognized as one of the most promising fieldbuses.
Can realize free communication between nodes
The CAN bus adopts a multi-master competitive bus structure, and has the characteristics of a serial bus with multi-master operation and decentralized arbitration and broadcast communication. Any node on the CAN bus can actively send information to other nodes on the network at any time without distinction of priority, so free communication between nodes can be achieved. The CAN bus protocol has been certified by the International Organization for Standardization, the technology is relatively mature, the control chip has been commercialized, and the cost performance is high. It is especially suitable for data communication between distributed measurement and control systems. The CAN bus plug-in card can be arbitrarily inserted into the PC AT XT compatible machine to easily form a distributed monitoring system.
Simple structure
Only 2 wires are connected to the outside, and the error detection and management module is integrated inside.
Transmission distance and rate
CAN bus characteristics: (1) Data communication is not divided into master and slave. Any node can initiate data communication to any other (one or more) nodes. The order of communication is determined by the priority of each node's information. High priority nodes Information is communicated in 134μs; (2) When multiple nodes initiate communication at the same time, the one with low priority will avoid the one with high priority and will not cause congestion on the communication line; (3) The communication distance can be as long as 10KM (the rate is lower than 5Kbps) The rate can reach 1Mbps (communication distance is less than 40M); (4) CAN bus transmission medium can be twisted pair, coaxial cable. CAN bus is suitable for large data volume short-distance communication or long-distance small data volume, with high real-time requirements, multi-master and multi-slave or equal use in the field of each node.
Technology Introduction
Arbitration
To process data in real time, it is necessary to transmit the data quickly, which requires a higher speed in the physical transmission path of the data. When several stations need to send data at the same time, fast bus distribution is required. There is a big difference in real-time processing of emergency data exchanged over the network. A fast-changing physical quantity, such as the load of a car engine, will transmit data more frequently and require a shorter delay than a relatively slow-changing physical quantity such as the temperature of a car engine.
The CAN bus uses a message as a unit for data transmission. The priority of the message is combined in an 11-bit identifier, and the identifier with the lowest binary number has the highest priority. Once this priority is established during system design, it cannot be changed. Conflicts in bus reads can be resolved by bit arbitration. For example, when the identifiers 0111111, 0100100, and 0100111 undergo bit arbitration, the 0100100 message will be tracked, and the remaining messages will be discarded. The specific process is: when several stations send messages at the same time, the message identifier of station 1 is 0111111, the message identifier of station 2 is 0100110, and the message identifier of station 3 is 0100111, all identifiers are the same The two bits 01, until the third bit is compared, the message of station 1 is discarded because its third bit is high, while the third bit of the messages of the other two stations is low. The 4, 5, and 6 bits of the station 2 and station 3 messages are the same, and the station 3 message is not discarded until the 7th bit. Note that the signals in the bus continue to track the messages of the station that finally obtained the right to read the bus. In this example, the message of station 2 is tracked. The advantage of this non-destructive bit arbitration method is that the initial part of the message has been transmitted on the network before the network finally determines which station's message is transmitted. All stations that have not obtained the right to read the bus become the receiving station with the highest priority message, and will not send messages before the bus is free again.
CAN has higher efficiency because the bus is only used by those stations whose requests are pending, and these requests are processed in order according to the importance of messages in the entire system. This method has many advantages when the network load is heavy, because the priority of the bus read has been placed in each message in order, which can ensure a lower individual hidden time in the real-time system.
For the reliability of the master station, since the CAN protocol implements decentralized bus control, all major communications, including bus read (permission) control, are completed in several times in the system. This is the only way to achieve a high-reliability communication system.
Comparison of CAN and other communication schemes
In practice, there are two important bus allocation methods: allocation on a schedule and allocation on demand. In the first method, regardless of whether each node applies for the bus, each node is allocated according to the maximum period. As a result, the bus can be assigned to each station and is the only station, regardless of whether it is performing bus access immediately or performing bus access at a specific time. This will ensure a clear bus assignment during bus access. In the second method, the bus is allocated to a station according to the basic requirements of transmitting data, and the bus system is allocated according to the transmission desired by the station (for example: EthernetCSMA/CD). Therefore, when multiple stations request bus access at the same time, the bus will terminate the requests of all stations, and no one station will get the bus allocation at this time. In order to allocate the bus, more than one bus access is necessary.
CAN realizes the bus distribution method, can guarantee that when different stations apply for the bus access, the bus distribution is clearly carried out. This bit arbitration method can solve the collision problem that occurs when two stations send data at the same time. Different from the message arbitration of the Ethernet network, CAN's non-destructive method of resolving bus access conflicts ensures that the bus is not occupied when no useful messages are transmitted. Even when the bus is under heavy load, bus access that prioritizes message content has proven to be an effective system. Although the transmission capacity of the bus is insufficient, all unresolved transmission requests are processed in order of importance. In a network such as CSMA/CD, such as Ethernet, the system often crashes due to overload, and this situation does not happen in CAN.
CAN message format
The message transmitted on the bus consists of 7 parts per frame. The CAN protocol supports two message formats. The only difference is that the length of the identifier (ID) is different. The standard format is 11 bits and the extended format is 29 bits.
In the standard format, the start bit of the message is called the start of frame (SOF), followed by an arbitration field composed of an 11-bit identifier and a remote transmission request bit (RTR). The RTR bit indicates whether it is a data frame or a request frame. There is no data byte in the request frame.
The control field includes the identifier extension bit (IDE), which indicates whether it is a standard format or an extended format. It also includes a reserved bit (ro) for future expansion. Its last four bits are used to indicate the length of the data in the data field (DLC). The data field ranges from 0 to 8 bytes, followed by a cyclic redundancy check (CRC) to detect data errors.
The response field (ACK) includes the response bit and the response separator. The two bits sent by the sending station are both recessive levels (logic 1). At this time, the receiving station that correctly receives the message sends the master control level (logic 0) to cover it. In this way, the sending station can ensure that at least one station in the network can receive the message correctly.
The end of the message is marked by the end of the frame. There is a short interval between two adjacent messages. If no station is accessing the bus at this time, the bus will be in an idle state.
Composition of CAN data frame
Remote frame
The remote frame consists of 6 fields: frame start, arbitration field, control field, CRC field, response field and frame end. There is no data field in the remote frame.
The RTR bit of the remote frame must be hidden.
The data value of DLC is independent, it can be any value from 0 to 8, which is the data length of the corresponding data frame.
Error frame
The error frame is composed of two different fields. The first field is obtained by superimposing the error flags from each station, and the second field is the error delimiter.
The error flag has two forms:
Active error flag (Active error flag), composed of 6 consecutive display bits
Passive error flag, composed of 6 consecutive hidden bits
Error delimiter includes 8 hidden bits
Overload frame
Overload frame includes two position fields: overload mark and overload delimiter
Overload conditions for sending overload frames:
Request to delay the next data frame or remote frame
Manifestation detected in the intermittent field
The overload flag is composed of 6 display positions
The overload delimiter consists of 8 hidden bits
Data error detection
Unlike other buses, the CAN protocol cannot use response information. In fact, it can signal any errors that occur. The CAN protocol can use five methods to check errors, of which the first three are based on message content checking.
3.4.1 Cyclic Redundancy Check (CRC)
Adding a redundancy check bit to a frame of message can ensure that the message is correct. The receiving station can judge whether the message has errors through the CRC.
3.4.2 Frame Check
This method uses the bit field to check the format and size of the frame to determine the correctness of the message, and is used to check format errors.
3.4.3. Response error
As mentioned earlier, the received frame is confirmed by the receiving station with an explicit response. If the sending station does not receive the response, it indicates that the receiving station has found an error in the frame, that is, the ACK field has been damaged or the message in the network has not been received by the station. The CAN protocol can also detect errors by means of bit checking.
3.4.4 Bus detection
Sometimes, a node in CAN can monitor its own signal. Therefore, the station that sends the message can observe the bus level and detect the difference between the sent bit and the received bit.
3.4.5 Bit padding
Each bit in a frame of message is represented by a non-return-to-zero code, which can ensure the maximum efficiency of bit coding. However, if there are too many bits of the same level in a frame of messages, synchronization may be lost. To ensure synchronization, synchronization is generated by bit stuffing. After five consecutive equal bits, the sending station automatically inserts a complementary complementary bit; when receiving, this stuffing bit is automatically discarded. For example, after five consecutive low-level bits, CAN automatically inserts a high-level bit. CAN checks for errors through this coding rule. If there are 6 identical bits in a frame of message, CAN knows that an error has occurred.
If at least one station detects one or more errors through the above method, it will send an error flag to terminate the current transmission. This can prevent other stations from receiving erroneous messages and ensure the consistency of messages on the network. When a large amount of sending data is terminated, the sending station will automatically resend the data. As a rule, the transmission is restarted within 23 bit periods after the error is detected. On special occasions, the recovery time of the system is 31 bit cycles.
However, there is a problem with this method, that is, an error-generating station will cause all data to be terminated, including correct data. Therefore, if self-monitoring measures are not taken, the bus system should adopt a modular design. For this reason, the CAN protocol provides a way to distinguish accidental errors from permanent errors and local station failures. This method can be achieved by statistically evaluating the error station to determine the error of a station itself and entering an operating method that will not adversely affect other stations. That is, the station can shut down itself to prevent normal data from being mistakenly regarded as Incorrect data was terminated.
Hard synchronization and resynchronization
Hard synchronization is only carried out when the transition from the invisible bit to the dominant bit occurs under the condition of the bus idle state, indicating the start of the message transmission. After hard synchronization, the bit time counter restarts counting with the synchronization segment. Hard synchronization forces the transition that has occurred to be placed in the re-started bit time synchronization segment. According to the synchronization rules, if a hard synchronization occurs within a certain bit time, no resynchronization will occur within that bit time. Resynchronization may cause phase buffer segment 1 to be extended or phase buffer segment 2 to be shortened. The upper limit of the extension time or shortening time of the two phase buffer segments is given by the resynchronization jump width (SJW).
reliability
In order to prevent the car from causing danger to the driver due to data exchange errors during the service life of the car, the safety system of the car requires a high level of safety in data transmission. If the reliability of data transmission is high enough, or the remaining data errors are low enough, this goal is not difficult to achieve. From the perspective of bus system data, reliability can be understood as the ability to recognize data errors during transmission.
The probability of residual data error can be obtained by statistical measurement of data transmission reliability. It describes the probability that the transmitted data is corrupted and that such damage cannot be detected. The probability of residual data error must be very small, so that it is almost undetectable by average statistics during the entire life cycle of the system. Calculating the probability of residual errors requires the ability to classify data errors, and the data transmission path can be described by a model. If we want to determine the probability of residual error in CAN, we can use the probability of residual error as a function of the probability of bit error in message transmission with 80 to 90 bits, and assume that there are 5 to 10 stations in this system, and the error rate is 1. /1000, then the maximum bit error probability is 10-13 orders of magnitude. For example, the maximum data transmission rate of the CAN network is 1Mbps. If the data transmission capacity is only 50%, then for a system with a working life of 4000 hours and an average message length of 80 bits, the total amount of data transmitted is 9×1010. During the operating life of the system, the statistics of undetectable transmission errors are less than 10-2 on average. In other words, a system is calculated on the basis of 365 days a year, 8 hours a day, and an error rate of 0.7 per second. Then, according to the statistical average, an undetectable error occurs every 1,000 years.
Application examples
The CAN bus mainly uses low-speed-fault-tolerant CAN that is the ISO11898-3 standard in the industrial control field, and often uses 500Kbps high-speed CAN in the automotive field.
An imported model has multiple control networks for body, comfort, and multimedia. Among them, CAN network is used for body control, LIN network is used for comfort, MOST network is used for multimedia, and CAN network is used as the main network to control engine, gearbox, ABS and other body safety Module, and share the speed, vehicle speed, oil temperature, etc. to the entire vehicle to achieve intelligent control of the vehicle, such as automatically locking the door at high speed, and automatically opening the door when the airbag pops out.
CAN system is divided into high-speed and low-speed. High-speed CAN system adopts hard-wired power type, speed: 500kbps, controlling ECU, ABS, etc.; low-speed CAN is comfortable type, speed: 125Kbps, mainly controlling instruments, anti-theft, etc.
A hospital has 5 16T/H XXXX gas boilers, which provide 5kg/cm2 of steam for laundry room, preparation room, supply room, domestic water, heating and other facilities. The annual consumption of natural gas is 12 million m3 and 200,000 tons. Tap water. The hospital uses relay heating, and regionally manages the heating network, which is divided into four heating zones. Among them, the heating in winter consumes a lot of gas. Based on this, a distributed boiler steam heating network intelligent monitoring system based on CAN field bus is designed. The field application shows that the building automation system has strong anti-interference ability, easy on-site configuration, high degree of networking, and friendly man-machine interface.
Reason analysis of CAN connection with 120 ohm terminal resistanceDuring high-frequency signal transmission, the signal wavelength is shorter than that of the transmission line, and the signal will form a reflected wave at the end of the transmission line, which will interfere with the original signal. Therefore, it is necessary to add a terminating resistor at the end of the transmission line to prevent the signal from being reflected after reaching the end of the transmission line. For low frequency signals, it is not necessary to connect a terminal resistance at both ends of the CAN bus to work normally. The terminal resistance should be the same as the impedance of the communication cable, with a typical value of 120 ohms. Its function is to match the bus impedance and improve the anti-interference and reliability of data communication.
1. The function of the terminal resistance is to absorb signal reflection and echo, and the biggest source of signal reflection is impedance discontinuity and mismatch.
2. If it is added to two separate wires, it is equivalent to an open loop state. According to the source of signal reflection, that is to say, this connection method will cause the impedance of the single wire to be more discontinuous and suddenly become 0 at the end. , Will cause the reflection to increase exponentially. The two 120 ohm resistors added by the high-speed CAN actually simulate the characteristic impedance (not the actual impedance) generated on the transmission line when the wiring harness is connected to infinity. This is a typical empirical value, and the specific value depends on the wiring harness used. Types of. If there is still something unclear about the above, please briefly refer to the knowledge of transmission line theory and signal reflection.
The reason why the CAN low-speed does not add a terminal resistance is because the signal reflections and echoes produced by the same connection method are very different at different frequencies. The higher the frequency, the stronger the reflections and echoes. In addition, under different frequencies, the characteristic impedance of the transmission line is different.
3. In the first paragraph of page 4 of ISO-11898-2: 2003, there is roughly this sentence: "When a dominant bit is sent to a network that contains at least one CAN driver in the on state, it means that there is current passing through the terminal. Therefore, CAN_H and CAN_L have different voltage values.†That is to say, in the dominant state, the terminal resistance will stabilize and enhance the differential voltage. When one or two terminals are removed, one can be clearly seen through the oscilloscope. The signal is unstable, and the second is that the differential voltage will change. I think the voltage measured when there is no terminal or terminal resistance is purely generated by the CAN driver. The farther away from the transmitter, the greater the voltage difference.
Talking about CAN Bus ProtocolController Area Network CAN (Controller Area Network) belongs to the category of fieldbus and is a serial communication network that effectively supports distributed control systems. It is a serial communication bus specially developed for the automotive industry by the German Bosch company in the 1980s. Because of its high performance, high reliability and unique design, it has attracted more and more attention and has been widely used in many fields. And it can detect any errors that occur. When the signal transmission distance reaches 10km, CAN can still provide a data transmission rate of up to 50kbit/s. Because the CAN bus has a very high real-time performance and application range, it can be arbitrarily matched from a high-speed network with a bit rate of up to 1Mbps to a low-cost multi-line 50Kbps network. Therefore, CAN has been widely used in the automotive industry, aviation industry, industrial control, security protection and other fields.
With the wide application of CAN bus in various industries and fields, the standardization of its communication format also puts forward more stringent requirements. In 1991, the CAN bus technical specification (Version 2.0) was formulated and released. This technical specification includes two parts A and B. Among them, 2.0A gives the CAN message standard format, and 2.0B gives the standard and extended two formats. The American Society of Automotive Engineers SAE proposed the J1939 protocol in 2000. Since then, the protocol has become a common standard for controller area networks in trucks and buses. CAN bus technology is also constantly evolving. Traditional CAN is triggered based on events, and the uncertainty of information transmission time and priority reversal are its inherent flaws. When the density of messages transmitted on the bus is small, these defects have less impact on the real-time performance of the system; but as the density of messages transmitted on the bus increases, the real-time performance of the system will drop sharply. In order to meet the increasing demand of real-time performance and transmission message density of automobile control, it is necessary to improve the real-time performance of CAN bus. Therefore, the combination of traditional CAN and time trigger mechanism has produced TTCAN (TIme-Triggered CAN), and ISO11898-4 already includes TTCAN. The difference between the TTCAN bus and the traditional CAN bus system is that different messages on the bus define different time slots (Timer Slot).
Related organizations
According to the International Organization for Standardization/Open System Interconnection (InternaTIonal Standardi-zaTIon Organization/Open System Interconnection, ISO/OSI) reference model, the layer structure of the ISO/OSI reference model of CAN.
Concepts and characteristics
The working principle of CAN bus
The CAN bus uses a serial data transmission method, which can run on a 40m twisted pair at a rate of 1Mb/s, or can be connected by optical cables, and the bus protocol supports multi-master controllers on this bus. [1] Many details of CAN and I2C bus are similar, but there are some obvious differences. When a node (station) on the CAN bus sends data, it is broadcast to all nodes in the network in the form of a message. For each node, regardless of whether the data is sent to itself, it will be received. The 11-bit character at the beginning of each group of messages is an identifier, which defines the priority of the message. This message format is called a content-oriented addressing scheme. The identifier is unique in the same system, and it is impossible for two stations to send packets with the same identifier. This configuration is very important when several stations compete for bus reading at the same time.
When a station wants to send data to other stations, the CPU of the station will send the data to be sent and its own identifier to the CAN chip of the station, and is in the ready state; when it receives the bus assignment, it will switch to sending messages status. The CAN chip organizes the data into a certain message format according to the protocol and sends it out. At this time, other stations on the network are in the receiving state. Each station in the receiving state detects the received messages and judges whether these messages are sent to itself to determine whether to receive it. Since the CAN bus is a content-oriented addressing scheme, it is easy to build a high-level control system and configure it flexibly. We can easily add some new stations to the CAN bus without modifying the hardware or software. When the new station provided is a pure data receiving device, the data transmission protocol does not require a separate part to have a physical destination address. It allows the synchronization of the distributed process, that is, when the controller on the bus needs measurement data, it can be obtained on the Internet, and it is not necessary for each controller to have its own independent sensor.
CAN bus characteristics
(1) Message (Message) The data on the bus is sent in different message formats, but the length is limited. When the bus is idle, any node on the network can send messages.
(2) Information routing (Information Routing) In CAN, the node does not use any message about the system configuration, such as the station address, and the receiving node determines whether to receive this frame of information according to the characteristics of the message text. Therefore, when the system is expanded, there is no need to change the software and hardware of the application layer and any nodes, and nodes can be added directly in CAN.
(3) Identifier (Identifier) ​​The message to be transmitted has a characteristic identifier (a field of the data frame and the remote frame), which is not the target node address, but the characteristics of the message itself. The information is sent on the network in a broadcast mode, and all nodes can receive it. The node determines whether to receive this frame of information through the identifier.
(4) Data consistency should ensure that the message is received or not received by all nodes at the same time in CAN, which is achieved with error handling and resynchronization functions.
(5) CAN systems with different bit transmission rates have different speeds, but in a given system, the bit transmission rate is unique and fixed.
(6) The priority is determined by the identifier in the message that sends the data to the priority of the message occupying the bus. The smaller the identifier, the higher the priority.
(7) Remote Data Request (Remote Data Request) By sending a remote frame, a node that needs data requests another node to send corresponding data. The data frame transmitted by the responding node and the remote frame requesting data are named by the same identifier.
(8) Arbitration As long as the bus is free, any node can send messages to the bus. If two or more nodes send messages at the same time, it will cause a bus access collision. This collision can be resolved by using the bit-by-bit arbitration of the identifier. The arbitration mechanism ensures that neither the message nor the time is lost. When a data frame and a remote frame with the same identifier are sent at the same time, the data frame takes precedence over the remote frame. During arbitration, each transmitter compares the level of the transmitted bit with the monitored bus level. If the levels are the same, the unit can continue to send. If the sending is a "recessive" level and the monitored is a "dominant" level, then the unit loses arbitration and must exit the sending state.
(9) Bus status The bus has two states: "dominant" and "recessive", "dominant" corresponds to logic "0", and "recessive" corresponds to logic "1". The "dominant" state and the "recessive" state are the same as the "dominant" state, so when two nodes send "0" and "1" at the same time, "0" appears on the bus. The CAN bus uses binary non-return-to-zero (NRZ) encoding, so there is either "0" or "1" on the bus. However, the CAN protocol does not specifically define the specific implementation of these two states.
(10) Confinement CAN nodes can distinguish between faults caused by transient disturbances and permanent faults. The failed node will be shut down.
(11) The response receiving node gives a response to the correctly received message and marks the inconsistent message.
(12) The maximum CAN communication distance is 10 kilometers (set the rate as 5Kbps), or the maximum communication rate is 1Mbps (set the communication distance as 40 meters).
(13) The number of nodes on the CAN bus can reach 110. The communication medium can be selected from twisted pair, coaxial cable, and optical fiber.
(14) The message is a short frame structure, and the short transmission time makes it less likely to be interfered. CAN has a good verification mechanism, which guarantees the reliability of CAN communication.
Features of CAN bus
(1) It has the advantages of strong real-time performance, long transmission distance, strong anti-electromagnetic interference ability, and low cost;
(2) The two-wire serial communication method is adopted, and the error detection ability is strong, and it can work in a high-noise interference environment;
(3) With priority and arbitration functions, multiple control modules are connected to the CAN-bus through the CAN controller to form a multi-host local network;
(4) According to the ID of the message, it can be decided to receive or block the message;
(5) Reliable error handling and error detection mechanism;
(6) After the sent information is damaged, it can be re-sent automatically;
(7) The node has the function of automatically exiting the bus in the case of serious errors;
(8) The message does not contain the source address or the destination address, and only uses a marker to indicate function information and priority information.
Agreement
The physical layer of the CAN bus is the drive circuit that connects the ECU to the bus. The total number of ECUs will be limited by the electrical load on the bus. The physical layer defines the transmission process of physical data between nodes on the bus, mainly the implementation standards of connection media, line electrical characteristics, data encoding/decoding, bit timing and synchronization.
Principles of bus competition
BOSCH CAN basically does not define the physical layer, but the CAN-based ISO standard defines the physical layer. When designing a CAN system, the physical layer has a lot of choice, but it must ensure the non-destructive bit arbitration requirements of the media access layer in the CAN protocol, that is, when there is a bus competition, the message with a higher priority will get the bus competition. Principle, so the physical layer must support the state characteristics of recessive and dominant bits in the CAN bus. When no dominant bit is sent, the bus is in a recessive state, and when it is idle, the bus is in a recessive state; when one or more nodes send a dominant bit, the dominant bit covers the recessive bit, making the bus in a dominant state.
On this basis, the physical layer mainly depends on the transmission speed requirements. From the physical structure point of view, the composition of the CAN node is shown in Figure 7-8. In CAN, the physical layer can be divided into three layers structurally: Physical Layer Signaling (PLS), Physical Media Attachment (PMA) layer and Media Dependent: Interface, MDI) layer. Among them, the PLS and the data link layer function are completed by the CAN controller, the PMA layer function is completed by the CAN transceiver, and the MDI layer defines the characteristics of the cable and the connector. At present, there are also CAN controllers and transceiver circuits integrated inside the microprocessors that support CAN, such as MC68HC908GZl6. There are many different international or national or industry standards for PMA and MDI, and they can also be defined by themselves. The more popular one is the high-speed CAN transmitter/receiver standard defined by ISOll898.
Number of nodes
The nodes on the CAN network are independent of master and slave. Any node can actively send information to other nodes on the network at any time. The communication method is flexible. This feature can be used to easily form a multi-machine backup system. CAN only needs to report Text filtering can realize point-to-point, point-to-multipoint and global broadcast and other methods to transmit and receive data without special "scheduling". The direct communication distance of CAN can reach up to 10km (speed below 5kbps); the communication speed can reach up to 1Mbps (the longest communication distance at this time is 40m). The number of nodes on CAN is mainly determined by the bus drive circuit, which can reach 110 at present; the message identifier can reach 2032 (CAN2.0A), and the message identifier of the extended standard (CAN2.0B) is almost unlimited.
CAN data link layer
CAN's data link layer is its core content, in which logical link control (Logical Link control, LLC) completes the functions of filtering, overload notification and management recovery, and the media access control (Medium Access control, MAC) sub-layer completes data packaging/ Unpacking, frame encoding, media access management, error detection, error signaling, response, serial-to-parallel conversion and other functions. These functions are developed around the information frame transmission process.
Concluding remarksThis is the end of the related introduction about CAN bus. Please correct me if there are any deficiencies.
Related reading recommendations: one article to understand the characteristics and advantages and disadvantages of the CAN bus
Related reading recommendations: Understanding CAN bus in one article
Dongguan SOLEPIN Electronics Co., Ltd , https://www.wentae.com