Teach you CAN principle and circuit design step by step

Table of contents

1 What is CAN

2 CAN features and basic concepts

2.1 Features of CAN

2.2 The basic concept of CAN

3 CAN protocol

3.1 IOS standard

3.2 CAN protocol

4 CAN schematic design

4.1 ISO1050--TI CAN transceiver application

4.1.1 Features and Functional Block Diagram

4.1.2 Pin definition and electrical characteristics

4.1.3 CAN bus status and chip application points

5 CAN data and chip selection recommendation


1 What is CAN

CAN is the abbreviation of Controller Area Network (hereinafter referred to as CAN), which is an ISO*1 international standardized serial communication protocol .

Before the advent of CAN, the communication between various control systems in the automotive industry was complicated, and the wiring harness increased. In order to meet the needs of " reducing the number of wiring harnesses " and "carrying out high-speed communication of large amounts of data through multiple LANs ", in 1986 Germany Electric dealer Bosch has developed the CAN communication protocol for automobiles . Since then, CAN has been standardized through ISO11898 and ISO11519 , and is now a standard protocol for automotive networks in Europe. Now, CAN's high performance and reliability have been recognized and widely used in industrial automation, ships, medical equipment, industrial equipment, etc.

2 CAN features and basic concepts

The CAN controller judges the bus level based on the potential . The sender sends a message to the receiver by changing the bus level.

The bus level is divided into dominant level and recessive level . The bus must be at one of two levels. When performing logical "AND" on the bus , the dominant level is "0" and the recessive level is "1" .

2.1 Features of CAN

The CAN protocol has the following characteristics:

(1) Multiple "master" control

When the bus is free, all units can start sending messages (multi-master control) .

The unit that accesses the bus first gets the right to send. When multiple units start to send at the same time, the unit that sends high priority ID messages can get the right to send—an arbitration mechanism.

(2) Sending of messages

In the CAN protocol, all messages are sent in a fixed format . When the bus is free, all units connected to the bus can start sending new messages. When two or more units start to send messages at the same time, the priority is determined according to the identifier (Identifier is called ID hereafter). Quorum comparisons are done bit by bit for each message ID . The unit that wins the arbitration (determined as the highest priority) can continue to send messages, and the unit that loses the arbitration immediately stops sending and starts receiving.

(3) Flexibility of the system

Units connected to the bus have no information like "address". Therefore, when adding units on the bus, the software, hardware and application layers of other units connected to the bus do not need to be changed.

(4) Communication speed

According to the scale of the entire network, an appropriate communication speed can be set .

In the same network, all units must be set to a uniform communication speed. Even if one unit does not communicate at the same speed as the others, this unit will output an error signal, hampering communication across the network. Different networks can have different communication speeds .

(5) Remote data request

Other units can be requested to send data by sending a "remote control frame".

(6) Error detection function, error notification function, and error recovery function

All units can detect errors (error detection function).

A unit that detects an error immediately and simultaneously notifies all other units (error notification function).

Once the unit that is sending the message detects an error, it will forcibly end the current sending. Units that are forced to end are resent over and over again.

This message is sent until it is successfully sent (error recovery feature).

(7) Fault closure

CAN can determine whether the type of error is a temporary data error on the bus (such as external noise, etc.) or a continuous data error (such as internal unit failure, driver failure, disconnection, etc.). With this function, when persistent data errors occur on the bus, the unit causing the failure can be isolated from the bus.

(8) connection

The CAN bus is a bus that can connect multiple units at the same time . The total number of connectable units is theoretically unlimited. However, the actual number of connectable units is limited by time delays and electrical loads on the bus. When the communication speed is reduced, the number of connectable units increases, and vice versa.

2.2 The basic concept of CAN

The CAN protocol, as shown in Table 3, covers the transport layer, data link layer and physical layer in the OSI*1 basic reference model stipulated by ISO.

Figure 5 shows the specific definitions of the transport layer, data link layer and physical layer in the ISO/OSI basic reference model in the CAN protocol.

The MAC sublayer is the core part of the CAN protocol .

3 CAN protocol

3.1 IOS standard

After the CAN protocol is standardized by ISO, there are two types: ISO11898 standard and ISO11519-2 standard. The definition of the data link layer is the same, but the physical layer is different.

(1) About ISO11898

ISO11898 is a CAN high-speed communication standard with a communication speed of 125kbps-1Mbps .

(2) About ISO11519

ISO11519 is a CAN low-speed communication standard whose communication speed is below 125kbps .

3.2 CAN protocol

Communication is performed by the following 5 types of frames.

• Data Frames • Remote Frames • Error Frames • Overload Frames • Frame Interval

In addition, data frames and remote control frames have two formats: standard format and extended format. The standard format has an 11-bit identifier (Identifier: hereinafter referred to as ID), and the extended format has a 29-bit ID.

  

There is no need to look closely at the composition of various frames. It is basically to achieve the refinement of the MAC layer functions. It does not involve electrical characteristics and is not helpful for the design schematic diagram. Personal understanding is more suitable for those who design the CAN protocol IP, and need to know the frame type in detail. various details.

4 CAN schematic design

4.1 ISO1050--TI CAN transceiver application

ISO1050 is an isolated room CAN transceiver with transmission rate up to 1Mbps, SOP8 9.5*6.57mm package.

4.1.1 Features and Functional Block Diagram

(1) Meet the requirements of ISO11898-2

(2) I/O voltage range supports 3.3V and 5V microprocessors

(3) Transmission rate up to 1Mbps

 Simplified functional block diagram, see the manual for the specific transceiver section.

4.1.2 Pin definition and electrical characteristics

Pin definition:

Electrical characteristics: voltage, current, power consumption

4.1.3 CAN bus status and chip application points

The CAN bus has two states during operation: dominant state and recessive state. The dominant bus state, equivalent to logic low, is when the bus is differentially driven by the driver. A recessive bus state is when the bus is biased to a common mode of VCC/2 through the receiver's high-impedance internal input resistors, equivalent to a logic high.

Chip typical application and schematic design:

 Precautions:

(1) If the microprocessor output pin is floating, the TXD pin should be pulled up to VCC1 through a resistor to force a recessive input level.

(2) The ISO11898 standard stipulates that the interconnection is a single twisted pair (shielded or unshielded) with a 120-Ω characteristic impedance (ZO). Both ends of the cable should be terminated with a resistor equal to the characteristic impedance of the line - 120Ω resistor terminations to prevent signal reflections.

  

(3) In ISO11898-2, the differential output of the driver is specified as a 60Ω load (two 120Ω terminal resistors connected in parallel), and the differential output must be greater than 1.5 V. --The 60Ω resistance of the test circuit in the manual should be ISO11898-2 standard, and the actual application is more than 120Ω.

5 CAN data and chip selection recommendation

If it is just hardware circuit design, you only need to understand the CAN introductory book, and you don't need to read other protocol materials.

Are you useless?

Friendly reminder: If you like it, please pay attention, if it is helpful, please like, follow and add collection!

Guess you like

Origin blog.csdn.net/weixin_49336610/article/details/128882788