29.4.3.5 LIN Host
LIN Host is available with the following configuration:
- LIN Host format (CTRLA.FORM = 0x02)
- Asynchronous mode (CTRLA.CMODE = 0)
- 16x sample rate using fractional baud rate generation (CTRLA.SAMPR = 1)
LIN frames start with a header transmitted by the host. The header consists of the break, sync, and identifier fields. After the host transmits the header, the addressed client will respond with 1–8 bytes of data plus checksum.
Using the LIN command field (CTRLB.LINCMD), the complete header can be automatically transmitted, or software can control transmission of the various header components.
When CTRLB.LINCMD = 0x1, software controls transmission of the LIN header. In this case, software uses the following sequence.
- CTRLB.LINCMD is written to 0x1
- Writing
0x00to the DATA register triggers transmission of the break field by hardware. Note that writing any other value to the DATA register will also result in the transmission of the break field by the hardware. 0x55written to the DATA register. The 0x55 value (sync) is transmitted.- The identifier written to the DATA register. The identifier is transmitted.
When CTRLB.LINCMD = 0x2, hardware controls transmission of the LIN header. In this case, software uses the following sequence.
- CTRLB.LINCMD is written to 0x2
- Writing the identifier to the DATA register triggers transmission of the complete header by hardware. First, the break field is transmitted. Next, the sync field is transmitted, followed by the sync field, and finally the identifier.
In LIN Host mode, the length of the break field is programmable using the break length field (CTRLC.BRKLEN). When the LIN header command is used (CTRLB.LINCMD = 0x2), the delay between the break and sync fields, in addition to the delay between the sync and ID fields, are configurable using the header delay field (CTRLC.HDRDLY). When manual transmission is used (CTRLB.LINCMD = 0x1), the software controls the delay between break and sync.
After header transmission is complete, the client responds with 1–8 data bytes plus checksum.
