■ USART as slave device
C
RIE = 0; LBIE = 1; RXE = 0
LBD = 1
LIN break interrupt
ICU -
Interrupt
ICU -
Interrupt
RBI -
Interrupt
Figure 7-16 USART LIN slave flow chart (part1)
START
Initialization:
Set Operat. mode 3
(8N1 data format)
waiting
(slave
action)
Awaiting message
from LIN master.
Write "0" to LBD
to clear interrupt.
Enable ICU inter-
rupt (both edges)
waiting
(slave
action)
Read ICU value
and store it.
Clear Interrupt.
waiting
(slave
action)
Read ICU value.
Calculate new
baud rate.
Set it to Reload
Counter.
Clear Interrupt.
Wait for Bus Idle
BIE = 1
waiting
(slave
action)
Receive Indenti-
fier.
RIE = 1,
RXE = 1
A
A
Errors occurred? Y
E
N
0x80 received?
Y
S
(sleep mode)
(on next page)
N
B
Chapter 32 USART (LIN / FIFO)
B
Slave address
N
match?
Y
Master wants to
N
send data?
Y
Receive data
RIE = 0
+ checksum
TIE = 1
Calculate
checksum
Send data
TIE = 0
C
Errors occurred? Y
N
C
E
Error handler
C
continued next page
7.USART Operation
C
661