Datasheet

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.
ma s ter tas k
slave ta sk
mas ter no de
slave ta sk
s lave no de
1
slave ta sk
s lave no de
n
LIN bus
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.
Master task
Slave task 1
Slave task 2
HEADER
RESPONSE
HEADER
RESPONSE
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
BREAK
Field
SYNC
Field
CHECKSUM
Field
DATA-0
FieldField
IDENTIFIER
PROTECTED
DATA-n
Field
Break delimiter Response space Inter-byte space Inter-frame space
RESPONSEHEADER
FRAME SLOT
Each byte field is transmitted as a serial byte, LSB first.
21.3.3. Data transport
Two types of data may be transported in a frame; signals or diagnostic messages.
Signals
Signals are scalar values or byte arrays that are packed into the data field of a frame. A signal is
always present at the same position in the data field for all frames with the same identifier.
Diagnostic messages
Diagnostic messages are transported in frames with two reserved identifiers. The interpretation of
the data field depends on the data field itself as well as the state of the communicating nodes.
Atmel ATmega16M1/32M1/64M1 [DATASHEET]
Atmel-8209F-ATmega16M1/32M1/64M1_Datasheet_Complete-10/2016
274