beautypg.com

3 lin protocol, 1 master and slave, 2 frames – Rainbow Electronics ATmega64M1 User Manual

Page 201: Lin bus

background image

201

8209A–AVR–08/09

ATmega16M1/32M1/64M1

21.3

LIN Protocol

21.3.1

Master and Slave

A LIN cluster consists of one master task and several slave tasks. A master node

contains the

master task as well as a slave task. All other nodes contain a slave task only.

Figure 21-1. LIN cluster with one master node and “n” slave nodes

The master task decides when and which frame shall be transferred on the bus. The slave tasks
provide the data transported by each frame. Both the master task and the slave task are parts of
the Frame handler

21.3.2

Frames

A frame consists of a header (provided by the master task) and a response (provided by a slave
task).

The header consists of a BREAK and SYNC pattern followed by a PROTECTED IDENTIFIER.
The identifier uniquely defines the purpose of the frame. The slave task appointed for providing
the response associated with the identifier transmits it. The response consists of a DATA field
and a CHECKSUM field.

Figure 21-2. Master and slave tasks behavior in LIN frame

The slave tasks waiting for the data associated with the identifier receives the response and
uses the data transported after verifying the checksum.

Figure 21-3. Structure of a LIN frame

master task

slave task

master node

slave task

slave node

1

slave task

slave node

n

LIN bus

Master Task

Slave Task 1

Slave Task 2

HEADER

RESPONSE

HEADER

RESPONSE

BREAK

Field

SYNC

Field

CHECKSUM

Field

DATA-0

Field

Field

IDENTIFIER

PROTECTED

DATA-n

Field

Break Delimiter

Response Space

Inter-Byte Space

Inter-Frame Space

RESPONSE

HEADER

FRAME SLOT

Each byte field is transmitted as a serial byte, LSB first.