中文English
can芯片ichaiyang 2024-05-10 7:11 33
CAN is the abbreviation of Controller Area Network (CAN , which was developed by the German BOSCH company known for the research and development and production of automotive electr...

can id Address assignment criteria?

CAN is the abbreviation of Controller Area Network (CAN), which was developed by the German BOSCH company known for the research and development and production of automotive electronics, and eventually became an international standard (ISO 11898), which is one of the most widely used fieldbuses in the world. The criterion of can address allocation is that each network does not conflict with each other, and can effectively cooperate with each other and localize the layout.

< br \/ >

The working principle of CAN bus

CAN bus uses serial data transmission mode, can run on 40m twisted pair at 1Mb\/s rate, can also use optical cable connection, and on this bus bus protocol supports multiple master controllers. CAN is similar to the I2C bus in many details, but there are some obvious differences.

< br \/ >

When a node (station) on the CAN bus sends data, it is broadcast in the form of a message to all nodes in the network. For each node, data is received regardless of whether it is sent to it or not. The 11-bit character at the beginning of each packet is an identifier that defines the priority of the packet. This packet format is called content-oriented addressing scheme. Identifiers are unique in the same system, and it is impossible for two stations to send messages with the same identifier. This configuration is important when several stations simultaneously compete for bus reads.

< br \/ >

When a station wants to send data to other stations, the CPU of the station will send the data and its own identifier to the CAN chip of the station, and is in a ready state; When it receives the bus assignment, it switches to the sending message state. 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 checks the received packets to determine whether the packets are sent to it, and then determines whether to receive them.

< br \/ >

Because the CAN bus is a content-oriented addressing scheme, it is easy to establish a high-level control system and configure it flexibly. We CAN easily add some new stations to the CAN bus without any hardware or software modifications. When the new station provided is a pure data receiving device, the data transfer protocol does not require the separate part to have a physical destination address. It allows the synchronization of the distributed process, that is, when the measurement data is needed by the controller on the bus, it can be obtained from the network, instead of each controller having its own independent sensor.

< br \/ >

The application of CAN bus

How can I assign an address to a CAN bus node

1. Application in automobile manufacturing

The application of CAN bus can reduce the wiring of the body and further save the cost, because of the use of bus technology, the signal transmission between modules only needs two signal lines. The wiring is localized, and all other lines across the body are no longer needed except the bus, saving the wiring cost. CAN bus system data is stable and reliable, CAN bus has the characteristics of small interference between lines and strong anti-interference ability. The CAN bus is tailor-made for the automobile, taking into account the harsh working environment on the automobile, such as the strong backcharge voltage generated when the ignition coil is fired, the surge current generated when the eddy current buffer is cut off, and the high temperature of about 100 ° C in the automobile engine compartment.

< br \/ >

2. Application of large instruments and equipment

Large instruments and equipment is a complex system that collects, processes, controls and outputs a variety of information according to certain steps. In the past, the electronic systems of such instruments and equipment tended to occupy a considerable part in terms of structure and cost, and reliability was not high. After adopting CAN bus technology, there has been a significant change in this aspect.

< br \/ >

3. Application of industrial control

With the development of computer technology, communication technology and control technology, the traditional field of industrial control is undergoing an unprecedented change, and the network of industrial control has expanded the development space of industrial control field and brought new development opportunities. In a wide range of industrial fields, CAN bus can be used as a field equipment level communication bus, and compared with other buses, it has high reliability and performance cost ratio. This will be a main direction of CAN technology development and application.

< br \/ >

4. Application of smart home and living area management

Community intelligence is a comprehensive system engineering, which should be considered from many aspects such as its function, performance, cost, expansion ability and the application of modern related technology. Based on such demand, the home intelligent management system designed by CAN technology is more suitable for multi-meter remote transmission, anti-theft, fire prevention, flammable gas leakage prevention, emergency rescue, home appliance control and so on.

< br \/ >

CAN node

CAN node refers to the unit that CAN be connected to the CAN bus, and can realize the communication between each node through the CAN bus to realize the complex control process. At present, it is mainly used for the communication between many sensors in automobiles.

< br \/ >

Build a CAN node

The node is constructed to realize the corresponding control, which is divided into four parts from bottom up: CAN node circuit, CAN controller driver, CAN application layer protocol and CAN node application program.

< br \/ >

Although different nodes perform different functions, they all have the same hardware and software structure.

< br \/ >

How can I assign an address to a CAN bus node

< br \/ >

The CAN transceiver and controller correspond to the physical layer and data link layer of CAN respectively to complete the sending and receiving of CAN messages. Functional circuits that perform specific functions, such as signal acquisition or control peripherals; The main controller and application software parsed the message according to the CAN message format to complete the corresponding control.

< br \/ >

CAN hardware driver is a program running on the main controller (such as P89V51), it mainly completes the following work: register-based operation, initializing CAN controller, sending CAN message, receiving CAN message;

< br \/ >

If the CAN hardware driver is used directly, the upper-layer application program needs to be modified when the controller is replaced, and the portability is poor. Adding a virtual driver layer to the application layer and hardware driver layer CAN mask the differences between different CAN controllers.

< br \/ >

In addition to the communication function, a CAN node also includes some specific hardware function circuits, which drive the downward direct control function circuit and provide the upward control function interface for the application layer. Specific functions include signal acquisition, man-machine display, etc.

< br \/ >

How can I assign an address to a CAN bus node

< br \/ >

The CAN transceiver realizes the interchange of the logic level of the CAN controller with the differential level on the CAN bus. There are two solutions to realize CAN transceiver, one is to use CAN transceiver IC (need to add power isolation and electrical isolation), the other is to use CAN isolation transceiver module. The second is recommended.

< br \/ >

CAN controller is the core component of CAN, it implements all functions of data link layer in CAN protocol, and CAN automatically complete the analysis of CAN protocol. There are generally two kinds of CAN controllers, one is the controller IC (SJA1000), and the other is the MCU integrated with the CAN controller (LPC11C00).

< br \/ >

The MCU is responsible for the control of the functional circuit and the CAN controller: when the node is started, the CAN controller parameters are initialized; Read and send CAN frames through CAN controller; When CAN controller interrupts, handle CAN controller interrupt exception; Output control signals according to the received data;

< br \/ >

How can I assign an address to a CAN bus node

< br \/ >

Interface management logic: interpret MCU instructions, address the register units of each function module in the CAN controller, and provide interrupt information and status information to the main controller.

< br \/ >

The send and receive buffers are capable of storing complete information on the CAN bus network.

< br \/ >

Acceptance filtering is to compare the stored verification code with the CAN message identification code. Only CAN frames matching the verification code are stored in the receiving buffer.

< br \/ >

The CAN kernel implements all protocols of the data link.

< br \/ >

How to set this node identifier for CAN bus

According to the can protocol, the destination station can select the address of a certain number of sending destination stations and decide whether to accept the message by itself. Generally, CAN communication chips can set their own identifiers that need to be accepted in the register, such as A to communicate with B, A to guide B's identifier, and then sent out, B found that the identifier is correctly accepted, C and D after reading the identifier choose to discard.

< br \/ >

To realize CAN communication, select a suitable can control chip and driver chip.

< br \/ >

How do I assign addresses to nodes on the CAN bus

There are ID fields in the CAN message, the standard frame is 11 bits, the extended frame is 29 bits, and the extended frame is used in my design. CAN is a packet of data to send data, usually, a packet of data 13 bytes, the first byte is used for control, such as defining the remote frame or other frames, define the number of bytes to receive data, and then is the ID bit, a total of 4 bytes, the remaining 8 bytes are used for data. The above can be considered as stipulated by the underlying communication protocol of CAN2.0.