Datasheet

The intrinsic structure of the Rx service offers a 2-byte buffer. The fist one is used for serial to parallel
conversion, the second one receives the result of the conversion. This second buffer byte is reached
reading LINDAT register. If the 2-byte buffer is full, a new in-coming character will overwrite the second
one already recorded. An OVRERR error in LINERR register will then accompany this character when
read.
A FERR error in LINERR register will be set in case of framing error.
21.4.7.3. Tx service
If this service is enabled, the user sends a character by writing in LINDAT register. Automatically the
LTXOK flag of LINSIR register is cleared. It will rise at the end of the serial transmission. If no new
character has to be sent, LTXOK flag can be cleared separately (see specific flag management described
in “LINSIR – LIN Status and Interrupt Register” on page 208).
There is no transmit buffering.
No error is detected by this service.
21.5. LIN / UART description
21.5.1. Reset
The AVR core reset logic signal also resets the LIN/UART controller. Another form of reset exists, a
software reset controlled by LSWRES bit in LINCR register. This self-reset bit performs a partial reset.
Table 21-2. Reset of LIN/UART registers.
Register Name Reset Value LSWRES value Comment
LIN control reg. LINCR 0000 0000
b
0000 0000
b
x=unknown
u=unchanged
LIN status & interrupt reg. LINSIR 0000 0000
b
0000 0000
b
LIN enable interrupt reg. LINENIR 0000 0000
b
xxxx 0000
b
LIN error reg. LINERR 0000 0000
b
0000 0000
b
LIN bit timing reg. LINBTR 0010 0000
b
0010 0000
b
LIN baud rate reg. low LINBRRL 0000 0000
b
uuuu uuuu
b
LIN baud rate reg. high LINBRRH 0000 0000
b
xxxx uuuu
b
LIN data length reg. LINDLR 0000 0000
b
0000 0000
b
LIN identifier reg. LINIDR 1000 0000
b
1000 0000
b
LIN data buffer selection LINSEL 0000 0000
b
xxxx 0000
b
LIN data LINDAT 0000 0000
b
0000 0000
b
21.5.2. Clock
The I/O clock signal (clk
i/o
) also clocks the LIN/UART controller. It is its unique clock.
21.5.3. LIN protocol selection
LIN13 bit in LINCR register is used to select the LIN protocol:
LIN13 = 0 (default): LIN 2.1 protocol
LIN13 = 1: LIN 1.3 protocol
Atmel ATmega16M1/32M1/64M1 [DATASHEET]
Atmel-8209F-ATmega16M1/32M1/64M1_Datasheet_Complete-10/2016
280