design of lin bus converter for vehicle communication system

5
Design of LIN Bus Converter for Vehicle Communication System Li Huang 1, a, * , Hui Huang 2, b 1 City College of Wuhan University of Science and Technology, Hubei Wuhan, China 2 Central Southern China Electric Power Design Institute, Hubei Wuhan, China a [email protected], b [email protected] Keywords: LIN bus, USB/CDC, SCM Abstract. In order to improve the performance of vehicle communication system and reduce the cost of testing, a LIN bus converter has been designed. This paper discusses the basic structure of LIN bus converter and the realization method of hardware and software. The design has been applied in testing of BCM. The test shows that the LIN bus converter not only provides a rich human-machine interface and intelligent testing management means, but also it can greatly reduce the cost of testing. 1. Introduction The LIN bus is widely used in the control of car door, steering wheel, seat, temperature control and engine cooling fan [1]. At present, the engineer mostly use special testing equipment to test the BCM (body control module) with LIN bus. But this kind of equipment have simple function, low efficiency and high cost. The USB interface has been used in most of computers. If the LIN bus and USB bus interconnection interface are designed, and the information in the BCM module is directly sent to the computer through the USB interface, then BCM can be tested with the help of computer’s resources. The LIN bus is based on a general UART/SCI interface which is easy to implement on both hardware and software [2]. Its low cost advantage makes some advanced mechanical electronic devices can be applied to the vehicle system. PIC18F2550 MCU is embedded with USB interface and the USART interface with LIN protocol. In this paper, a LIN and USB interface converter is designed with the MCU. 2. Overall Design of the USB-LIN Converter The USB-LIN converter is consists of three major parts: the USB interface part of the microcontroller, the interface part of the LIN bus and the power isolation, as shown in Figure 1. The 5V power supply of the MCU comes from the computer’s USB interface, and the power of the LIN transceiver comes from the 12V battery of the car. The optocoupler PS9701 can realize the isolation of two power systems. It effectively protects the USB interface and BCM module of the computer. Fig.1 Overall design of USB-LIN conversion interface 3. Hardware Design of USB-LIN Conversion Interface 3.1 Hardware Design of USB Interface PIC18F2550 is an USB Microcontroller with 24k bytes enhanced flash memory. The MCU is embedded with the enhanced USART module to support the LIN bus protocol. 2nd International Conference on Mechanical, Electronic, Control and Automation Engineering (MECAE 2018) Copyright © 2018, the Authors. Published by Atlantis Press. This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/). Advances in Engineering Research, volume 149 642

Upload: others

Post on 02-Dec-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design of LIN Bus Converter for Vehicle Communication System

Design of LIN Bus Converter for Vehicle Communication System

Li Huang 1, a, *, Hui Huang 2, b 1City College of Wuhan University of Science and Technology, Hubei Wuhan, China

2Central Southern China Electric Power Design Institute, Hubei Wuhan, China [email protected], [email protected]

Keywords: LIN bus, USB/CDC, SCM

Abstract. In order to improve the performance of vehicle communication system and reduce the cost of testing, a LIN bus converter has been designed. This paper discusses the basic structure of LIN bus converter and the realization method of hardware and software. The design has been applied in testing of BCM. The test shows that the LIN bus converter not only provides a rich human-machine interface and intelligent testing management means, but also it can greatly reduce the cost of testing.

1. Introduction

The LIN bus is widely used in the control of car door, steering wheel, seat, temperature control and engine cooling fan [1]. At present, the engineer mostly use special testing equipment to test the BCM (body control module) with LIN bus. But this kind of equipment have simple function, low efficiency and high cost. The USB interface has been used in most of computers. If the LIN bus and USB bus interconnection interface are designed, and the information in the BCM module is directly sent to the computer through the USB interface, then BCM can be tested with the help of computer’s resources.

The LIN bus is based on a general UART/SCI interface which is easy to implement on both hardware and software [2]. Its low cost advantage makes some advanced mechanical electronic devices can be applied to the vehicle system. PIC18F2550 MCU is embedded with USB interface and the USART interface with LIN protocol. In this paper, a LIN and USB interface converter is designed with the MCU.

2. Overall Design of the USB-LIN Converter

The USB-LIN converter is consists of three major parts: the USB interface part of the microcontroller, the interface part of the LIN bus and the power isolation, as shown in Figure 1. The 5V power supply of the MCU comes from the computer’s USB interface, and the power of the LIN transceiver comes from the 12V battery of the car. The optocoupler PS9701 can realize the isolation of two power systems. It effectively protects the USB interface and BCM module of the computer.

Fig.1 Overall design of USB-LIN conversion interface

3. Hardware Design of USB-LIN Conversion Interface

3.1 Hardware Design of USB Interface PIC18F2550 is an USB Microcontroller with 24k bytes enhanced flash memory. The MCU is

embedded with the enhanced USART module to support the LIN bus protocol.

2nd International Conference on Mechanical, Electronic, Control and Automation Engineering (MECAE 2018)

Copyright © 2018, the Authors. Published by Atlantis Press. This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).

Advances in Engineering Research, volume 149

642

Page 2: Design of LIN Bus Converter for Vehicle Communication System

C310uF

VCC

D1

VCC

VCC

C222PF

C1

22PF

R34.7k

R21M

Y120MHz R4

100k

123456

J1 ICD

MCLR

RB7RB6

VCCRB7RB6

MCLR

R1

330

RC6/TXRC7/RX

R51K

RC0/CSRC1/FT

VB 1

DM 2

DP3

G4

S15

S26

USBH

R61K

RA02

RA13

RA24

RA35

RA46

RA57

RB0 21

RB7/PGD28

RB6/PGC27

RB5 26

RB4 25

RB324

RB2 23

RB1 22

OSC210

MCLR1

VDD20

OSC19

VSS 19VSS 8

RC0 11

RC7/RX 18RC6/TX17

RC5/D+/VP16 RC4/D-/VM15

Vusb14

RC213

RC1 12

U1

PIC18F2550

C4470nF

RC1/FTRC0/CSRC6/TXRC7/RX

Fig.2 Circuit of the USB interface with computer

In Figure 2, USBH is a USB interface, and the voltage of the USB port of the computer is 5V + 5%. In actual testing, the current consumed by this circuit is only 50mA. Therefore, the power supply provided by the USB port can guarantee the normal operation of the circuit.

In this figure, these signals are connected to optical isolation circuit, such as RC1/FT, RC0/CS, RC6/TX and RC7/RX. The power supply is isolated from the USB port of computer and the LIN bus. RC1/FT is the LIN bus fault detection port, through which the ATA6625 (LIN interface chip) transfers the state of the LIN bus to PIC18F2550. RC0/CS is the chip selection signal of the LIN bus transceiver. RC6/TX is the sending signal of the LIN bus transceiver. RC7/RX is the receiving signal of the LIN bus transceiver. To improve the coupling waveform of the optical septum, the pull up resistance of 1K is added to both the RC1/FT signal and the RC7/RX signal. 3.2 Hardware Design of LIN Bus Interface

C90.01UF

C10

0.01UF

Vbat

123

LINH

R131k

D2

1N4750/27V

VREGR11 1K

LinTX

R12 1K

LinCS

LinFT

LinCSLinTX

LinRX

D31N4004

D41N4750/27V

VCC5

2Y4

1A1

2A3

GN

D2

1Y6

U7 74LVC2G04VREG

EN2

TXD6

RXD5

VR

EG

8

VS

1

LIN4

NRES7

GND3

U2 ATA6625

Fig.3 Circuit of LIN bus interface

In figure 3, ATA6625 is a LIN transceiver[3], and this chip is designed in accordance with the LIN specification and the SAEJ2602 standard. The ESD stability of the chip is higher than 6Kv. ATA6625 includes a step-down regulator which can provide power for the MCU and other chips in the application.

The LINH is the LIN bus interface in the figure, and Vbat is powered by 12V battery. D3 and D4 prevent battery overload. The power of the LIN bus terminal is isolated from the USB port of computer. Data is exchanged between LIN bus transceiver and MCU through a photoelectric isolation chip of PS9701. 3.3 Hardware Design of Power System Isolation

In order to prevent the damage of the USB interface of computer, the photoelectric isolation is added between the 5V power supply of the PC machine and the battery of the car. Considering that the baud rate upper limit of the LIN bus is 20Kbps[4], ps9701 with higher speed optical isolation is used in the circuit. This photoelectric isolation rising delay is only 50ns.

Advances in Engineering Research, volume 149

643

Page 3: Design of LIN Bus Converter for Vehicle Communication System

R9 470

RC6/TX

1

3 456

U5 PS9701

LinTX

R10 510 LinRXRC7/RX

R8 470

RC0/CS

1

3 456

U4 PS9701

LinCS

1

3456

U6 PS9701

VREG

R7510

LinFTVCC

RC1/FT1

3456

U3 PS9701

RC1/FT

RC0/CS

RC6/TX

RC7/RX

LinFT

LinCS

LinTX

LinRX

C8

0.01uF

C70.01uF

VREG

C60.01uF

VCC

C50.01uF

Fig.4 Isolation circuit of power supply

4. Software Design of LIN Bus and USB Bus Communication Conversion.

The overall program block diagram of USB-LIN interface is shown in Figure 5. The whole program is divided into two parts, one is main program and the other is interrupt service program. The main task state machine of LIN bus is implemented in the timer interrupt service program, and is implemented from the task state machine on the LIN bus's rising edge interrupt service program. The slave state machine is implemented on the LIN bus in the rising edge interrupt service program.

Fig.5 Overall program flow chart of USB-LIN interface

The design of data buffer for USB-LIN interface is illustrated in Figure 6. It includes data exchange on LIN node, data exchange on USB side, and data parsing and exchanging between LIN bus buffer and USB end buffer.

Fig.6 Data exchange schematic of USB-LIN interface

4.1 Software Implementation of LIN Bus The software part of the LIN bus includes the implementation of network management, realization

of master and slave state machine, and the update of scheduling table and information binding table. The LIN protocol specifies the state transfer diagram of the master and slave task[5]. The core task of the main task is to produce the right message head. The mechanism of message header transmission is based on the time scheduling table. The scheduling principle of the LIN bus task is shown in Figure 7. In this figure, Timer 1 is the slice timer setting as 1ms for scheduling, timer 0 is timer for frame timeout, and its setting depends on the clock frequency of the node and the baud rate of the communication.

Advances in Engineering Research, volume 149

644

Page 4: Design of LIN Bus Converter for Vehicle Communication System

Fig.7 Scheduling schematic diagram of LIN bus

A scheduler table gives the time slice for each frame, and the main task starts the transmission of the frame based on this table. The scheduling table consists of three items: the processing handle of the frame, the frame’s protected identifier (PID) and the time slice for the frame.

A information binding table defines a node's response to a received frame with a particular protected identifier (PID). The master node can operate the data buffer of slave node, this means that the physics parameter from the node can be operated directly by master node.

The scheduler table and the information binding table are stored in the EEPROM of the PIC18F2550, and this two tables can be updated through USB of computer. 4.2 Software Implementation of USB Bus

The USB interface of PIC18F2550 can be used in general mode or CDC [6] mode to exchange data with computer. Because the USB-LIN interface just handles low-speed LIN communication, the CDC mode is used in the USB interface of PIC18F2550.

In the CDC mode [7], the CDC subclass implements the protocol for virtual serial communication. Most operating systems have device drivers that support the CDC class, and can identify the CDC class devices, therefore it is only necessary to view the interface as a virtual serial port in computer. When the USB port of the PIC18F2550 works in the CDC mode, the highest communication rate is 1Mbps. This MCU fully meets the requirements of LIN bus data exchange.

5. Conclusion

In this paper, the design methods of LIN bus and USB bus interface are discussed from the aspects of the overall system structure, hardware, and software design. The interface is used to connect the LIN bus interface with the auto body control module and the USB of computer. This design has been used in the testing of the BCM module and in the teaching and training of the LIN network protocol. Practice has proved that it is valuable.

Acknowledgements

This paper is supported by Hubei Provincial Department of Education Science and Technology Research Foundation of B2017589.

References

[1]. Y Xu, J Wang, W Chen, J Tao, Application of LIN Bus in Vehicle Network, IEEE International Conference on Vehicular Electronics & Safety, 2006:119-123.

[2]. JW Specks, A Rajnäk, LIN - Protocol, development tools, and software interfaces for local interconnect networks in vehicles, VDI-Berichte , 2000 :227-250.

[3]. M Ruff, Evolution of local interconnect network (LIN) solutions, IEEE Vehicular Technology Conference, 2003, 5(2) :3382-3389.

[4]. G Krastev, Microcomputer protocol implementation at local interconnect network, Computer Applications, 2004, 24(6) :114-116.

Advances in Engineering Research, volume 149

645

Page 5: Design of LIN Bus Converter for Vehicle Communication System

[5]. BB Shi, Application Research of Automatic Guided Vehicle System Based on LIN Bus, Advanced Materials Research, 2011, 267 :710-714.

[6]. A Kenarsari Anhari, Medium access control protocol design for in-vehicle power line communication, Journal of Clinical Research in Pediatric Endocrinology, 2013, 5 (1) :1022-1027.

[7]. Q Ye, Research and application of CAN and LIN bus in automobile Network System, International Conference on Advanced Computer Theory & Engineering, 2010, 6(14):V6-150-V6-154.

Biographical notes

Li Huang is a Teacher of E-commerce Department at the City College of Wuhan University of Science and Technology.She received her Master degree from Chang and University. Her current research interests include computer software design and embedded system.

Hui Huang is a Senior Engineer of Central Southern China Electric Power Design Institute. He received his Master degree from Huazhong University of Science and Technology. His current research interests include computer hardware design and electrical automation.

Advances in Engineering Research, volume 149

646