Design of car light node based on μPD780822 single chip microcomputer and CAN bus module

Publisher:丝路老君Latest update time:2020-04-13 Source: 国外电子元器件Keywords:μPD780822 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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. Nodes with high priority transmit 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 2 wires. When the system is expanded, new nodes 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, 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 the car mainly uses 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 control unit (ECU), ASR and ABS controllers, airbag controllers, instrument clusters, etc., and their basic characteristics are the same, all of which 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. In addition to the above two CAN buses, some advanced cars will also have a third CAN bus, which mainly connects to satellite navigation and intelligent communication systems.


In foreign countries, especially in Europe, CAN has become an indispensable device in modern cars. 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. It is believed that the introduction of this policy will greatly promote the research, development and application of automobile 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. Single chip microcomputer 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 function, programmable CAN bus wake-up and CPU wake-up function, programmable bus shutdown send bottom reset function, etc. The access to the CAN bus is divided into access to the control/status register and access to the send/receive buffer.


There are two types of information frames sent by the CAN controller: data frames and 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 the 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 frame data can be set to 1 to 8 bytes by software. The format of the data frame is shown in Figure 1.

Design of car light node based on μPD780822 single chip microcomputer and CAN bus module

When the CAN controller receives information, it first compares 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 structures of the transmit area and the receive area are 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 number register (MCNT). Information received from the bus is directly stored in the transmit buffer. The receive buffer not used during operation can be used by the CPU as ordinary RAM . Each receive buffer has its own programmable interrupt enable bit.


4. Network structure and nodes


The bus body CAN system includes the main 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 such as 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, 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 such as 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 main 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 values ​​such as vehicle speed, engine speed, water temperature, fuel, oil, voltage, stepper motor , etc. The air conditioning node controls the air conditioning switch and the temperature setting in the car. The door and mirror nodes control the door solenoid valve switch, mirror adjustment switch and 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 photoelectric isolator and BTS442 and BTS740 intelligent switches.

TLP521-4 is a 4-way optoelectronic isolator. 8 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 (more than 140 A) and a wider temperature range (-55℃~+150℃). 6 BTS442s form a 6-way control switch to control 6 high-current loads such as headlights and fog lights. BTS740 is a 4-way output intelligent switch produced by Infineon. The 2 outputs are combined into 1 to pass larger transient currents. 5 BTS740s form a 10-way control switch to control the remaining small 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 uses a 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 being controlled, and detect whether the corresponding switch is normal through the switch's 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 continues to be detected.


Node initialization is mainly MCU initialization, including port initialization and CAN control module initialization. MCU port initialization mainly resets the used I/O ports. CAN module initialization mainly sets the special function registers used, 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.

[1] [2]
Keywords:μPD780822 Reference address:Design of car light node based on μPD780822 single chip microcomputer and CAN bus module

Previous article:Features of the new physical layer interface device MC33661 and its application in automotive electronics
Next article:Design of vehicle fault diagnosis instrument based on CAN bus combined with radio frequency and USB

Latest Automotive Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号