195
ATmega16M1/32M1/64M1 [DATASHEET]
8209E–AVR–11/2012
20.4.6
LIN commands
Clearing the LCMD[2] bit in LINCR register enables LIN commands.
As shown in
Table 20-1, four functions controlled by the LCMD[1..0] bits of LINCR register are available (c.f.
Figure20.4.6.1
Rx header / LIN abort function
This function (or state) is mainly the withdrawal mode of the controller.
When the controller has to execute a master task, this state is the start point before enabling a Tx Header
command.
When the controller has only to execute slave tasks, LIN header detection/acquisition is enabled as background
function. At the end of such an acquisition (Rx Header function), automatically the appropriate flags are set, and in
LIN 1.3, the LINDLR register is set with the uncoded length value.
This state is also the start point before enabling the Tx or the Rx Response command.
A running function (that is Tx Header, Tx or Rx Response) can be aborted by clearing LCMD[1..0] bits in LINCR
register. In this case, an abort flag - LABORT - in LINERR register will be set to inform the other software tasks. No
wait states are implemented, so, the abort command is taken into account immediately.
Rx Header function is responsible for:
The BREAK field detection
The hardware re-synchronization analyzing the SYNCH field
The reception of the PROTECTED IDENTIFIER field, the parity control and the update of the LINDLR register in
case of LIN 1.3
The starting of the Frame_Time_Out
The checking of the LIN communication integrity
20.4.6.2
Tx header function
In accordance with the LIN protocol, only the master task must enable this function. The header is sent in the
appropriate timed slots at the programmed baud rate (c.f. LINBRR & LINBTR registers).
The controller is responsible for:
The transmission of the BREAK field - 13 dominant bits
The transmission of the SYNCH field - character 0x55
The transmission of the PROTECTED IDENTIFIER field. It is the full content of the LINIDR register (automatic
check bits included)
At the end of this transmission, the controller automatically returns to Rx Header / LIN Abort state (that is,
LCMD[1..0] = 00) after setting the appropriate flags. This function leaves the controller in the same setting as after
the Rx Header function. This means that, in LIN 1.3, the LINDLR register is set with the uncoded length value at
the end of the Tx Header function.
During this function, the controller is also responsible for:
The starting of the Frame_Time_Out
The checking of the LIN communication integrity
20.4.6.3
Rx & TX response functions
These functions are initiated by the slave task of a LIN node. They must be used after sending an header (master
task) or after receiving an header (considered as belonging to the slave task). When the TX Response order is