User Manual
633
Rev. 1.1
2019-03-18
TLE984xQX
Microcontroller with LIN and Power Switches for Automotive Applications
UART1/UART2
19.7.3
Automatic Synchronization to the Host
Upon entering LIN communication, a connection is established and the transfer speed (baud rate) of the serial
communication partner (host) is automatically synchronized in the following steps that are to be included in
the user software:
STEP 1: Initialize interface for reception and timer for baud rate measurement
STEP 2: Wait for an incoming LIN frame from host
STEP 3: Synchronize the baud rate to the host
STEP 4: Enter for Master Request Frame or for Slave Response Frame
The next sections,
provide some hints on setting up the
microcontroller for baud rate detection of LIN.
Note:
Re-synchronization and setup of the baud rate has always to be done for
every
Master Request
Header or Slave Response Header LIN frame by user software.
19.7.4
Initialization of Break/Sync Field Detection Logic
The LIN baud rate detection feature provides the capability to detect the baud rate within the LIN protocol
using Timer 2 / Timer 21. Initialization consists of:
• Setting of the serial port of the microcontroller to Mode 1 (8-bit UART, variable baud rate) for
communication.
• Providing the baud rate range via bit field LINST.BGSEL.
• Toggling of the LINST.BRDIS bit (set the bit to 1 before clearing it back to 0) to initialize the sync break/sync
detection logic.
• Clearing all status flags LINST.BRK, LINST.EOFSYN and LINST.ERRSYN to 0.
• Setting of Timer 2 / Timer 21 to capture mode with falling edge trigger at pin T2EX. Setting of the bits
T2MOD.EDGESEL to 0 by default and T2CON.CP/RL2 to 1.
• Enabling Timer 2 external events. T2CON. EXEN2 is set to 1. (EXF2 flag is set when a negative transition
occurs at pin T2EX)
•
Configuring of f
T2
by bit field T2MOD.T2PRE.
19.7.5
Baud Rate Range Selection
The sync break/sync field detection logic supports a maximum number of bits in the sync break field as
defined by
.
(19.2)
The sample frequency is given by
(19.3)
If the maximum number of bits in the Break field is exceeded, the internal counter will overflow, which results
in a baud rate detection error. Therefore, an appropriate BGSEL value has to be selected for the required baud
rate detection range.
=
Baud rate
Sample Frequency
4095
•
Maximum number of bits
=
Sample Frequency
8 2
fsys
•
BGSEL