In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly talks about "what is the difference between high-speed CAN, fault-tolerant CAN and LIN bus". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what's the difference between high-speed CAN, fault-tolerant CAN, and LIN bus?"
1. What is the LIN bus?
LIN (Local Interconnect Network) bus is a low-cost serial communication protocol based on UART/SCI (Universal Asynchronous Transceiver / Serial Interface). Its target is the low-end communication between the nodes of the body network module, which is mainly used for the serial communication of intelligent sensors and actuators, which is not required by the bandwidth and function of the CAN bus.
2. CAN/LIN bus difference
Because the LIN network does not exist independently in the automobile, it is usually connected with the upper CAN network to form the CAN-LIN gateway node.
Master-Slave relationship of 2.1.LIN bus
The LIN bus adopts the form of single-line transmission and applies single-host and multi-slave computers (is there any support for active reporting?) The bus level is generally 12V and the maximum transmission rate is limited to 20kbps. Due to the limitations of the physical layer, a LIN network can connect up to 16 nodes.
The bus task is responsible for:
Schedule the transmission order of frames on the bus
Monitoring data, handling errors
As a standard clock reference (not asynchronous communication?)
Receive the bus wake-up command from the machine node
The slave task cannot send data directly to the bus. After receiving the frame header sent by the master node, you need to judge according to the information contained in the frame header:
Send a reply
Receive reply
Neither receive nor reply
Characteristics of LIN
The network consists of one master node and several slave nodes.
Using the LIN bus can greatly reduce costs (both CAN and Lin require transceivers, but Lin belongs to single-wire harness savings)
The transmission is deterministic and the propagation time can be calculated in advance.
LIN has predictable EMC (electromagnetic compatibility) performance. In order to limit the strength of EMC, LIN protocol stipulates that the maximum transmission rate is 20kbps.
The LIN bus provides the functions of signal configuration, processing, recognition and diagnosis (which UART does not have, but how is LIN implemented?)
3.LIN message frame structure
The LIN message frame includes two parts: the frame header (hearder) and the reply (response). The host is responsible for sending to the frame header; the slave is responsible for receiving the frame header and parsing it, and then deciding whether to send a reply or receive a reply or no reply.
(host) the frame header structure includes synchronization interval segment, synchronization segment, PID segment (protected ID) segment, and the response part includes data segment and checksum segment. The value "0" is the dominant level and "1" is the recessive level, which is similar to the CAN bus to play embedded micropoint8. The "line-and" is implemented on the bus: when at least one node of the bus sends the dominant level, the bus presents the dominant level; when all nodes send the implicit level or do not send information, the bus is the recessive level, that is, the dominant level plays a leading role.
3.1.1. Synchronous interval
The synchronization interval is composed of at least 13-bit dominant levels, and the bus maintains a hidden level state because all gaps in the frame or when the bus is idle. So the synchronization interval can mark the beginning of a frame. The spacer of the synchronization interval is at least 1-bit recessive level.
3.1.2. Synchronous segment
The following falling edge of LIN synchronization is the judgment mark, and byte 0x55 (01010101b) is used for synchronization. The high-precision clock can not be used on the slave node, and the resulting deviation needs to be adjusted through the synchronization section.
3.1.3.PID segment
The first six bits of a protected ID are called frame ID, plus two parity codes, called protected ID. The value range of the frame ID is 64 0x00~0x3f, and the frame ID identifies the category and destination of the frame. The slave task responds according to the frame header ID (receive / send / ignore the reply). The effects of P0 and P1 are as follows:
According to the difference of frame ID number, LIN bus divides the message into signal carrying frame, diagnostic frame and reserved frame.
PS: the slave response frame is a complete frame, which is different from the "reply" in the (master node) frame structure!
3.1.4. Data segment
Data segments can contain 1-8 bytes and contain two data types, signal (singal) and diagnostic message (diagnostic messages). The signal is transmitted by the signal carrying the frame, and the diagnostic message is transmitted by the diagnostic frame.
The protocol does not specify which part displays the information of the data length code (which is different from the CAN bus). The content and length of the data are agreed by the system designer in advance according to the frame ID.
The data on the bus is sent as a broadcast and can be received by any node, but it is not useful for every node (same as CAN). Specific to which node to publish and answer depends on the software configuration of the application layer, in general, for the reply in a frame, there is only one publishing node on the bus, otherwise an error will occur. An exception to the event trigger frame, there may be 0Power1, multiple publishing nodes.
3.1.5. Effective sum segment
The purpose of the validation sum segment is to validate the content of the frame transmission. Effectiveness can be divided into standard test and enhanced effect. Whether the standard type or the enhanced type is used is managed by the host node, and the publishing node and the listening node judge which kind of checksum is adopted according to the frame ID.
4.LIN bus waveform
Communication of 5.LIN bus
The above figure shows the communication mode of the LIN bus, you can see that whenever the frame header is always issued by the host node, when the host node wants to publish data, the whole frame is sent by the host node. When the slave node wants to publish data, the frame header is released by the host node, and the reply part is issued by the slave node (how does the host know that the slave node wants to publish data? it must be that the host node has no data to send, so only the frame header is sent?) So that the other nodes can receive a complete message frame It can be directly observed that the communication of the LIN bus is the embedded micropoint8 initiated by the host node. As long as the configuration of each node is reasonably specified, there will be no bus conflict (the conflict resolution schedule is used when the event triggers the frame conflict).
Frame Typ
5.1. Unconditional frame
An unconditional frame is a frame with a single publishing node, and the frame header is answered unconditionally regardless of whether the signal changes or not.
For example, in the above figure, the issuing node of the frame ID=0x30 reply part is the slave node 1, and the listening node is the host node, which is applied to the slave node to report its status to the host node; in the frame ID=0x31, the reply part is the host node, and the listening part is the slave node, and the host node is applied to send messages to the slave node The sending node of the reply part of the frame ID=0x32 is the slave node 2, the listening node is the slave node 1, and the communication between the application and the slave node.
5.2. Event trigger frame
The event trigger frame is the frame used by the host node when querying whether the signal of each slave node has changed in a frame gap. When there are multiple publish nodes, the conflict is resolved through the conflict resolution schedule.
When the frequency of the slave node signal change is low, the host task to query the information of each node again and again will occupy a certain bandwidth. In order to reduce the consumption of bandwidth, the concept of event trigger frame is introduced. The main principle is: when the slave node information state does not change, the slave node can not reply to the frame header sent by the host; when multiple node information changes at the same time, at the same time the response event triggers the frame header will cause the bus conflict. When the host node detects the conflict, it queries the conflict resolution schedule to send unconditional frames to each node in turn (unconditional frames can only be answered by 1 node) to determine the information status of the slave node.
Multiple unconditional frames associated with an event trigger frame need to meet the following five conditions:
The number of data bytes contained in the data segment is equal using the same validation and the first byte of the type data segment is the protected ID of the unconditional frame, so that it is possible to know which associated unconditional frame the reply is sent and issued by different slave nodes cannot be in the same schedule as the time trigger frame.
5.2.1. Occasional frame
The occasional frame is the frame that the host node starts to send to the bus when its own signal changes in the same frame slot. When there are multiple associated response signal changes, it is arbitrated by a pre-set priority. Like event-triggered frames, occasional frames define a set of unconditional frames. It is stipulated that occasional frames can only be published by host nodes.
There are three possible situations for the transmission of occasional frames:
When no signal changes in the associated unconditional frame, the host does not even need to send a frame header.
The frame is transmitted when the associated unconditional frame signal changes.
When the signal changes in a plurality of unconditional frames, it is transmitted in sequence according to the priority specified in advance.
5.2.2. Diagnostic frame
Diagnostic frames include host request frames and slave response frames, which are mainly used for configuration, identification and diagnosis. The host requests the frame ID=0x3c, and the issuing node of the reply part is the host node; the slave response frame ID=0x3d, and the issuing node of the reply part is the slave node. The data segment is specified to be 8 bytes, all using the standard checksum.
5.2.3. Reserved Fram
Keep the ID=0x3e and 0x3f of the frame for future expansion.
5.3. Schedule
The schedule is the schedule of frames, which defines the transmission order and transmission time of frames on the bus. The schedule is located in the host node, and the host tasks are scheduled according to the needs of the application. There can be multiple schedules. In general, when it is a schedule's turn to execute, it starts at the entrance of the schedule, and when the last frame of the schedule is not started, if no new schedule is started, return to the first frame of the current schedule to start the execution of embedded micropoint8. It is also possible to interrupt when execution to a schedule, jump to another schedule and then return. For example, the event trigger frame is a typical example.
6. The implementation of state machine 6.1. Host state machine
6.2. Slave state machine
The slave task is responsible for publishing or listening to the response status of the frame, including connecting two state machines: the synchronization interval and synchronization segment checker, and the frame processor.
6.3. Slave task state machine
At this point, I believe you have a deeper understanding of "what is the difference between high-speed CAN, fault-tolerant CAN and LIN bus". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.