1 Introduction
CAN (Controller Area Network) was first proposed by Bosch of Germany. It is the most popular and commonly used bus in the automotive controller area network. Its main features are: CAN bus is a multi-master bus. Each node can actively send information to other nodes on the network at any time, regardless of master and slave, and the communication is flexible; CAN bus adopts a unique non-destructive bus arbitration technology. The node with high priority transmits data first, which can meet the real-time requirements; CAN bus has the functions of point-to-point, point-to-multipoint and global broadcast data transmission; The number of valid bytes per frame on the CAN bus is up to 8, and there are CRC and other verification measures. The data error rate is extremely low. If a node has a serious error, it can automatically leave the bus, and other operations on the bus will not be affected; CAN bus has only two wires. When the system is expanded, the new node can be directly hung on the bus, so there are fewer wires, the system is easy to expand, and the modification is flexible; CAN bus has a fast transmission speed. When the transmission distance is less than 40 m, the maximum transmission rate can reach 1 Mb/s. The application of CAN bus can not only simplify the wiring harness, realize sensor sharing, and reduce system costs, but also greatly reduce the failure rate of vehicles. The application of CAN bus in automobiles is the development trend of modern automobile technology.
2 Application of CAN bus in automobiles
At present, the network connection in automobiles mainly adopts two CAN buses, one is the high-speed CAN bus of the drive system, with a rate of 500 kb/s, and the other is the low-speed CAN bus of the body system, with a rate of 100 kb/s. The main connection objects of the CAN of the drive system are the engine controller (ECU), ASR and ABS controller, airbag controller, instrument cluster, etc., which have the same basic characteristics and control systems directly related to the driving of the car. The main connection objects of the CAN of the body system are the central control door locks, electric windows, rearview mirrors and interior lighting of cars with more than 4 doors. In addition to the above two CAN buses, some advanced cars will also have a third CAN bus, and its main connection object is satellite navigation and intelligent communication system.
In foreign countries, especially in Europe, CAN has become an indispensable device in modern automobiles. CAN bus technology is becoming more and more mature and its application is becoming more and more extensive. Mercedes-Benz, BMW, Volkswagen, Volvo, Renault and other cars all use CAN as the controller networking technology. Domestic research on CAN bus has just started, and there has been no successful application so far. However, my country attaches great importance to the research and development of vehicle local area network bus technology. Recently, relevant national departments have made clear regulations on the application of CAN bus in luxury buses. I believe that the introduction of this policy will greatly promote the research, development and application of automotive CAN bus by related enterprises and scientific research institutions. This article discusses the design of headlight node in the CAN bus system of bus body, which belongs to the node design on low-speed CAN bus.
3 Microcontroller and its CAN bus module
NEC is the world's second largest automotive microcontroller manufacturer after Freescale. Due to its late promotion in China, domestic companies do not use it much. The CAN bus module is a peripheral of the μPD780822 microcontroller and is a complete CAN controller. It can meet the requirements of the vehicle body CAN bus network. In addition to the basic functions of CAN, it also includes some unique functions, such as time synchronization, programmable CAN bus wake-up and CPU wake-up functions, and programmable bus shutdown sending bottom reset function. Access to the CAN bus is divided into access to the control/status register and access to the send/receive buffer.
The information frames sent by the CAN controller are divided into two types: sending data frames and sending remote frames. There are two send buffers, one of which is 16 bytes and the other is 8 bytes. The 16-byte buffer can store data frames in two formats: standard frame and extended frame, and the 8-byte buffer can be used to store data to be sent. When sending a data frame, after the data is written to the send buffer, if the corresponding send request bit is enabled, the data is sent to the CAN bus, and the data of the data frame can be set to 1 to 8 bytes by software. The format of the data frame is shown in Figure 1.
When the CAN controller receives information, it must first compare the identifier of the received information with the identifier of the corresponding buffer. Only information with the same identifier can be received. The CAN module of the μPD780822 microcontroller has two independent transmit buffers. The two buffers share a 16-byte data area to store CAN frames with a maximum of 8 bytes of data. The structure of the transmit area and the receive area is similar. When the flag bit and control bit are not set to CAN-specific, the CPU can use it as a normal data storage area.
The controller has 16 receive buffers. The buffer area used when receiving information frames is determined by the information quantity register (MCNT). The information received from the bus is directly stored in the transmit buffer. The receive buffer that is not used during operation can be used by the CPU as a normal RAM. Each receive buffer has its own programmable interrupt enable bit.
4 Network structure and nodes
The bus body CAN system includes the master control node, lighting node, air conditioning node, door node and instrument node, as shown in Figure 2. Among them, the front light node control includes 16 control units, including the front left and right clearance lights, front left and right position lights, front left and right distress warning lights, front left and right parking lights, left and right headlights, high beams, left and right headlights, low beams, front left and right fog lights and front left and right turn lights. The rear light node control includes 12 control units, including the rear left and right clearance lights, rear left and right turn lights, rear left and right brake lights, rear left and right position lights, rear left and right fog lights and rear left and right reverse lights. The master control node mainly receives some switch input signals from the driver. The instrument node mainly controls the direction, water temperature, oil pressure, brake, door, light, ABS/ARS and defrost indicators and control instruments by receiving data on the bus to display the values of vehicle speed, engine speed, water temperature, fuel, oil, voltage, stepper motor, etc. The air conditioning node controls the air conditioning switch and the setting of the interior temperature. The door and rearview mirror node controls the door solenoid valve switch, rearview mirror adjustment switch and rearview mirror heating switch. The safety node monitors the power supply of ABS and ECAS.
5 Hardware Circuit Design
The hardware structure of the lighting node is shown in Figure 3, which includes a lighting control module and a CAN interface module. The lighting control module consists of a TLP521-4 optoelectronic isolator and BTS442 and BTS740 intelligent switches. TLP521-4 is a 4-way optoelectronic isolator. Eight TLP521-4s form 32-way optoelectronic isolation, connecting the signals transmitted to the switch and the switch feedback to the microcontroller. BTS442 is a single-channel output intelligent switch (PROFET) produced by Infineon. It has the advantages of allowing larger transient currents (above 140 A) and a wider temperature range (-55℃~+150℃). Six BTS442s form a 6-way control switch to control six high-current loads such as headlights and fog lights. BTS740 is a 4-way output intelligent switch produced by Infineon. The two outputs are combined into one to pass a larger transient current. Five BTS740s form a 10-way control switch to control the remaining low-current loads. Both BTS442 and BTS740 have diagnostic feedback functions. If an error occurs, a low-level signal will appear on the 4th pin of BTS442 and the 4th and 8th pins of BTS740. The signal is connected to the microcontroller through the optoelectronic isolator to realize the endpoint detection function and feedback to the instrument node through the CAN information frame. The hardware CAN interface module of all nodes is the same, including the light node. Since this microcontroller has a CAN bus module, a special CAN controller is not required. The microcontroller does not have a CAN transceiver and needs an external 82C250 transceiver, with a 6N137 optoelectronic isolator in the middle. The hardware interface circuit of the microcontroller, optoelectronic isolator and CAN transceiver is shown in Figure 4.
6 Node software design
The node software flow is shown in Figure 5. The program adopts the query mode. After the node is initialized and reports normal operation, it will remain in the query state until the light control command sent by the master node reaches the light node. The microcontroller can then determine which light or lights are controlled, and detect whether the corresponding switch is normal through the switch diagnostic feedback function. If normal, the corresponding control command is sent to the corresponding high/low end switch, and then returns to the query state. If abnormal, the abnormal information frame of the corresponding endpoint is sent to the instrument node, and the corresponding endpoint is continued to be detected.
Node initialization is mainly microcontroller initialization, including port initialization and CAN control module initialization. Microcontroller port initialization mainly resets the used I/O port. CAN module initialization is mainly to set the special function registers used, mainly including protocol mode, acceptance filter mode, CAN communication rate and interrupt register settings. Write the acceptance code and acceptance mask code into the acceptance code register and acceptance mask register.
The software design of the CAN bus mainly includes the initialization of the CAN node, the data sending and receiving program. Mastering the design of these three modules basically completes the software design of CAN communication.
7 Conclusion
Although this node is designed to control bus lights, it can also serve as a reference for some other nodes, especially the hardware interface part of the CAN bus, which can be used on other CAN network nodes of buses, and can even be used on CAN networks in other non-automotive fields, such as industrial automation.
Previous article:Multi-channel Data Acquisition System Based on MSCl210Y5
Next article:Research on the synchronization of data flow in SPI communication of single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 18:09
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [GD32L233C-START Review] 1. Receive the development board
- Bicycle modification series: fixed solar panels
- [Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] Infrared Detection
- Live broadcast has ended [Microchip Embedded Security Solution | Accessory Authentication Using Secure Element]
- After reading these two books, you will never be embarrassed to talk about the Internet of Things again!
- Verilog007
- The future belongs to ultra-wideband (UWB)
- Zhongke Bluesun (AB32VG1) development board (based on RT-Thread system) --- Music player -- Sharing
- What exactly is a sine filter?
- Pingtouge RVB2601 board-GPIO