RL78/F13, F14 CHAPTER 17 LIN/UART MODULE (RLIN3)
R01UH0368EJ0210 Rev.2.10 1246
Dec 10, 2015
17.6.2 Transmission in LIN Master Self-Test Mode
To execute a self-test on LIN master transmission, perform the procedure below:
ï‚·ï€ Set registers related to the baud rate, noise filter, and interrupt output.
LWBRn register = 0000xxxxb
Note 1
LBRPn0 register = xxxxxxxxb
Note 1
LBRPn1 register = xxxxxxxxb
Note 1
LMDn register = 00xxxx00b
Note 1, 3
ï‚·ï€ Set registers related to interrupt enabling and error enabling.
LIEn register = 0000xxxxb
Note 2, 3
LEDEn register = x000x0xxb
ï‚·ï€ Set registers related to the break field and spaces.
LBFCn register = 00xxxxxxb
LSCn register = 00xx0xxxb
ï‚·ï€ Cancel the reset.
Write 11b to the OM1 and OM0 bits in the LCUCn register and verify that the OMM1 and OMM0 bits in the LMSTn
register become 11b.
ï‚·ï€ Set registers related to the transmission frame.
LDFCn register = 00x1xxxxb
LIDBn register = xxxxxxxxb
LDBn1 to LDBn8 registers = xxxxxxxxb
ï‚·ï€ Start header transmission followed with response transmission
LDFCn register = 00x1xxxxb
Set the FTS bit in the LTRCn register to 1 (frame transmission or wake-up transmission/reception started).
The LIN master self-test mode (transmission) is executed. In this mode, interrupts are generated, and status and error
status are also updated appropriately. The checksum is automatically computed by the LIN/UART module.
When the execution of LIN master self-test mode (transmission) is aborted, set OM0 bit of LCUCn register to 0 (LIN reset
mode).
ï‚·ï€ When the transmission is completed, the reversed value of the looped-back frame data is stored in the LIDBn,
LDBnm (m = 1 to 8), and LCBRn registers (the data is reversed before being stored because the transmitted value
should be compared with the looped-back value). The FTS bit in the LTRCn register is cleared.
ï‚·ï€ If the transmission fails to complete due to an error, the applicable error flag is set and the FTS bit in the LTRCn
register is cleared.
Notes 1. The following register settings do not affect the operations in LIN self-test mode. Therefore, setting them is
not mandatory.
LPRS bits in LWBRn register, LBRPn0 register, LBRPn1 register, and LCKS bits in LMDn register
2. As necessary, set the related registers in CHAPTER 21 INTERRUPT FUNCTIONS.
3. When the successful header transmission interrupt and successful frame transmission interrupt are used in
the same interrupt, the SHIE bit in the LIEn register should not be set to 1 (successful header transmission
interrupt enabled) if the software processing of the successful header transmission interrupt does not
complete before the successful frame transmission interrupt is generated.
The period starting from when the successful header transmission flag is set until the successful
frame/wake-up transmission flag is set can be calculated as follows:
10 ï‚´ (number of data bytes + 1) [Tbit]
1 Tbit = LIN communication clock source ï‚´ 16
Remark x: Any desired value
<R>