RL78/F13, F14 CHAPTER 17 LIN/UART MODULE (RLIN3)
R01UH0368EJ0210 Rev.2.10 1248
Dec 10, 2015
17.6.4 Transmission in LIN Slave Self-Test Mode
To execute a self-test on LIN slave transmission, perform the procedure below:
ï‚·ï€ Set registers related to the baud rate, noise filter, and interrupt output.
LWBRn register = 0000xxx0b
Note 1
LBRPn0 register = xxxxxxxxb
Note 1
LBRPn1 register = xxxxxxxxb
Note 1
LMDn register = 00xx0011b
Note 4
ï‚·ï€ Set registers related to interrupt enabling and error enabling.
LIEn register = 0000xxxxb
Note 2, 4
LEDEn register = xx0xx00xb
ï‚·ï€ Set registers related to the break field and spaces.
LBFCn register = 0000000xb
Note 3
LSCn register = 00xx0001b
ï‚·ï€ 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 reception followed with response transmission
Set the FTS bit in the LTRCn register to 1 (header reception or wake-up transmission/reception started).
(Without any operation involving the RTS bit in the LTRCn register, the reception of a header and the transmission of
a response are executed, in the indicated order.)
The LIN slave 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, and LBRPn1 register
2. As necessary, set the related registers in CHAPTER 21 INTERRUPT FUNCTIONS.
3. A break with a width of 9.5 or 10.5 Tbits is output from the internal LTXDn pin depending on this register
setting.
4. When the successful header reception interrupt and successful response transmission interrupt are used in
the same interrupt, the SHIE bit in the LIEn register should not be set to 1 (successful header reception
interrupt enabled) if the software processing of the successful header reception interrupt does not complete
before the successful response transmission interrupt is generated.
The period starting from when the successful header reception flag is set until the successful
response/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>