XC886/888CLM
Serial Interfaces
User’s Manual
12-29
V1.3, 2010-02
Serial Interfaces, V 1.0
12.2.2.2
Baud Rate Detection of LIN
The LIN baud rate detection feature provides the capability to detect the baud rate within
the LIN protocol using Timer 2. Initialization consists of:
•
Serial port of the microcontroller set to Mode 1 (8-bit UART, variable baud rate) for
communication.
•
Provide the baud rate range via bit field BCON.BGSEL.
•
Toggle BCON.BRDIS bit (set the bit to 1 before clearing it back to 0) to initialize the
Break/Synch detection logic.
•
Clear all status flags FDCON.BRK, FDCON.EOFSYN and FDCON.ERRSYN to 0.
•
Timer 2 is set to capture mode with falling edge trigger at pin T2EX. Bit
T2MOD.EDGESEL is set to 0 by default and bit T2CON.CP/RL2 is set to 1.
•
Timer 2 external events are enabled. T2CON. EXEN2 is set to 1. (EXF2 flag is set
when a negative transition occurs at pin T2EX)
•
f
T2
can be configured by bit field T2MOD.T2PRE.
The baud rate detection for LIN is shown in
, the Header LIN frame consists
of the:
•
SYN Break (13 bit times low)
•
SYN byte (55
H
)
•
Protected ID field
Figure 12-10 LIN Auto Baud Rate Detection
With the first falling edge:
•
The Timer 2 External Start Enable bit (T2MOD.T2RHEN) is set. The falling edge at
pin T2EX is selected by default for Timer 2 External Start (bit T2MOD.T2REGS is 0).
With the second falling edge:
•
Start Timer 2 by the hardware.
With the third falling edge:
•
Timer 2 captures the timing of 2 bits of SYN byte.
•
Check the Break Field Flag bit FDCON.BRK.
Captured Value (8 bits)
SYN BREAK
SYN CHAR (55
H
)
Start
Bit
Stop
Bit
1st negative transition,
set T2RHEN bit
T2 automatically
starts
EOFSYN bit is set,
T2 is stopped
Last captured value of T2
upon negative transition
Check the break field
flag bit BRK is set or not
*
Содержание XC886CLM
Страница 1: ...User s Manual V1 3 2010 02 Microcontrollers 8 Bit XC886 888CLM 8 Bit Single Chip Microcontroller...
Страница 3: ...User s Manual V1 3 2010 02 Microcontrollers 8 Bit XC886 888CLM 8 Bit Single Chip Microcontroller...
Страница 324: ...XC886 888CLM Serial Interfaces User s Manual 12 52 V1 3 2010 02 Serial Interfaces V 1 0...
Страница 663: ...w w w i n f i n e o n c o m Published by Infineon Technologies AG...