20.7.8
Sample Flowcharts for LIN-UART in LIN communication
(Operation Mode 3)
This section contains sample flowcharts for LIN-UART in LIN communication.
LIN-UART as LIN Master Device
Start
Initial setting :
Set operation mode 3
Serial data output enabled, Baud rate setting,
Synch break length setting
TXE = 1, TIE = 0, RXE = 1, RIE = 1
Send
N
Message?
Y
Wake up ?
(0x80
reception)
RXE = 0
Synch break interrupt enabled
Sync Break transmission:
ECCR: LBR = 1
Synch Field transmission:
TDR = 0x55
LBD = 1
Synch Break interrupt
Reception enabled
LBD = 0
Synch break interrupt dis-
abled
RDRF = 1
Reception interrupt
Synch field reception
Identify field set : TDR = lD
RDRF = 1
Reception interrupt
1
ID field reception*
*1: If an error occurs, perform the error processing
• When fre and ore is "1", write 1 to SCR: CRE bit and clear the error flag.
*2:
• When ESCR: LBD bit is "1", execute UART reset.
Note: The error is detected in each processing and take appropriate measure.
Figure 20.7-18 LIN-UART LIN Master Flowchart
(Reception)
N
Y
Data 1 reception
Data N reception*
*1
(Transmission)
Data Field
Y
N
reception ?
RDRF = 1
Reception interrupt
*1
Transmission data 1 set :
TDR = Data 1
Transmission interrupt
enabled
RDRF = 1
Reception interrupt
1
Transmission data N set:
TDR = Data N
Transmission interrupt dis-
abled
Data 1 reception*
Data 1 reading
Data N reception*
Data N reading
Without
N
Error processing*
error?
Y
CHAPTER 20 LIN-UART
TDRE = 1
Transmission interrupt
RDRF = 1
Reception interrupt
1
RDRF = 1
Reception interrupt
1
2
439
Need help?
Do you have a question about the F2MCTM-16LX and is the answer not in the manual?