LIN Testing
LIN Testing
of LIN systems
Roman Hofmann, IXXAT Automation GmbH
LIN communication systems have now be- gle master/multiple slave concept in accordance
with extended ISO 9141 with a bit rate of up to
come an integral part of car body electronics
20 kbits/s. Physically the LIN is based on a sin-
and ever more complex applications are im- gle wire 12 V bus. A special feature of LIN is the
synchronization mechanism, with which slave
plemented in the bus systems of the vehicle.
nodes can be synchronized with the master,
For this reason it is important to have suit- which enables the use of very low-cost oscillator
circuits.
able test concepts and testing tools which
meet the increased requirements. In the fol- A LIN message consists of a header, which is
terminated by the LIN bus arbiter (LIN master),
lowing article, the various requirements are
and a response field, which is transmitted by the
discussed and it is shown how even complex addressed LIN slave. The header consists of a
13 bit long sync-break, which serves as a clear
testing systems can be implemented with
start-up code, an eight bit long sync field, which
suitable testing devices. enables synchronization of the slave resonators
to the master oscillator with 0-1 sequences and
an identifier field with 6 bit message ID (of which
LIN (Local Interconnect Network) is a universal,
2 bits are used as optional length information
serial low-cost communication system for use in
and 2 more bits as parity backup) (Fig. 1).
automobiles [1]. It was developed as an open
standard, among others by Audi,
BMW, Daimler-Chrysler, Volvo and
Volkswagen, in order to further re-
duce the costs of networking vehicle
components. In particular, LIN is
used in systems where only simple
functions are necessary and a rela-
tively low bit rate is sufficient (e.g. air-
conditioning, central locking or mirror
adjustment). Use of just one signal
wire, very simple implementation of
the interface, use of low-cost micro-
controllers and dispensing with precise quartz Fig. 1: LIN Message Frame
oscillators enable a certain cost saving com-
pared with device networking via CAN.
In the 2 bits of the length information, message
lengths of 2, 4 or 8 bytes can be coded. The re-
LIN as a sub-bus to CAN sponse field contains the user data of the LIN
Subsystems for which the power of the CAN-bus slave and a further byte as a check-sum. The
is not required, can be implemented less expen- sync field, identifier field and response field are
sively with LIN. Inasmuch, CAN and LIN com- transferred coded in 8N1. However, the length
plement each other perfectly. By means of LIN/- option also allows message lengths outside the
CAN gateways, the sub-systems can be inte- length information specified in the header. In this
grated in CAN networks or implemented via case it is necessary to store the message
CAN-distributed LIN systems. lengths for each subscriber of the LIN network,
LIN is based on the SCI (UART) protocol, a sin- as the message length can no longer be deter-
mined from the header bits received. Owing to Master and slave implementations
the flexible use of the message length, LIN require different test functions
communication systems can be adapted to the Due to the single master/multiple slave principle
optimum use of bandwidth and reaction times. on which it is based, the device corresponding to
communication is generally not necessary during
The physical bus connection is basically made development. For the implementation of a slave,
via a transistor connection to the SCI. A diode a LIN master may also have to emulate other
prevents a reverse current into the MC system in slaves in order to transmit or receive the mes-
the event of power loss (Fig. 2). The LIN bus is sages required in the application. For the devel-
biased with the master node via a 1 k pull-up re- opment of a LIN master, on the other hand, LIN
sistor, with the LIN slave node via a 30 k pull-up slaves are required to be able to test the com-
resistor. The connection can be made using nu- munication and thus also the application. The
merous available LIN transceiver modules. Cor- LIN2CAN gateway of IXXAT Automation [3], for
responding modules generally implement further example, fulfills both requirements – it can be
useful functions such as wakeup detection, used both as a LIN master and as a LIN slave.
power-saving mode and already offer integrated Two operating modes are possible: a configur-
protection against transient faults, short-circuits able stand-alone emulation and a PC-based,
and overload [2]. Test devices must provide the freely programmable emulation.
relevant bus connections for master and slave
modes and if applicable an automatic switching
of the bus connection to the master or slave MC stand-alone and PC-based
mode. emulation for simple and complex tests
The stand-alone LIN master mode supports a
configurable scheduling table, in which the LIN
identifiers can be identified with a configurable
delay time.
As a LIN slave, response messages can be con-
figured to each of the LIN identifiers. If a LIN
master transmits the corresponding header, the
device switches the configured message(s) to
the bus. The stand-alone modes are configured
via a user-friendly Windows configuration pro-
gram. For this the LIN2CAN device is connected
to the PC via the serial port.
Fig. 2: Basic LIN bus connection Complex master or slave emulations can be im-
plemented via a programming interface. Both the
monitoring and the transmission of headers and
Necessary functions for testing complete messages are provided in the master
error detection and troubleshooting and slave mode via the Windows API. This en-
LIN dispenses with error signaling via the bus. ables the PC-based simulation of the remaining
Error detection remains local; reaction to errors network (“residual bus simulation“). In addition
is generally application-specific. Testing of the the device can be used in this way as an inde-
LIN devices for error conditions and checking of pendent development platform by first develop-
the application behavior, e.g. on receipt of an in- ing the application on the PC and then porting it
correct check-sum, an unknown message length to the target platform.
or unexpected data are all the more important
right from the development phase onwards. LIN
testing and analysis devices must therefore be Development support with
capable of reliably detecting and signaling at LIN monitoring tool
least global errors and of providing functions for At the beginning of a development, first basic
the generation of defined errors. The behavior of communication functions are required. For this a
the internal error counters and associated trou- simple LIN monitor is generally sufficient. It
bleshooting routines is checked via specific in- should provide functions to display and transmit
troduction of errors. The LIN analysis device LIN messages and a trace function. Timestamps
must also be capable of monitoring message of the individual LIN messages and the display
timing, maximum permissible response time and of errors are useful here. In the case of the
duration of a message. IXXAT LIN2CAN device, a corresponding moni-
tor is integrated in the configuration tool. The
LIN2CAN device then works as a PC interface
and can be used both as a master and as a
slave (Fig. 3).
Author: