
R8C/3GM Group
26. Hardware LIN
R01UH0284EJ0100 Rev.1.00
Aug 09, 2011
Figure 26.6
Header Field Reception Flowchart Example (1)
Set the count source and registers
TRA and TRAPRE as appropriate
for the Synch Break period.
Select the timing at which to
unmask the RXD0 input for UART0.
If the RXD0 input is chosen to be
unmasked after Synch Break
detection, the Synch Field signal is
also input to UART0.
A
Set the TIOSEL bit in the
TRAIOC register to 1 to select the
hardware LIN function.
If the wake-up function is not
necessary, the setting of the INT1
pin can be omitted.
Timer RA
Set to pulse width measurement mode
Bits TMOD2 to TMOD0 in TRAMR register
← 011b
Timer RA
Set the pulse width measurement level to low
TEDGSEL bit in TRAIOC register
← 0
Timer RA
TRAIO pin assigned to P1_5
Bits TRAIOSEL1 to TRAIOSEL0 in TRASR register
← 10b
UART0
RXD0 pin assigned to P1_5
RXD0SEL0 bit in U0SR register
← 1
INT1
INT1 pin assigned to P1_5
Bits INT1SEL1 to INT1SEL0 in INTSR register
← 01b
Timer RA
Set the count source (f1, f2, f8, fOCO)
Bits TCK0 to TCK2 in TRAMR register
Timer RA
Set the Synch Break width
TRAPRE register
TRA register
Hardware LIN
Set the LIN operation to stop
LINE bit in LINCR register
← 0
Hardware LIN
Set to slave mode
MST bit in LINCR register
← 0
Hardware LIN
Set the RXD0 input unmasking timing
(After Synch Break detection, or after Synch Field
measurement)
SBE bit in LINCR register
Hardware LIN
Set interrupts to enable
(Bus collision detection, Synch Break detection, Synch
Field measurement)
Bits BCIE, SBIE, SFIE in LINCR register
Hardware LIN
Set the LIN operation to start
LINE bit in LINCR register
← 1
Notes:
1. When the previous communication completes normally and header field reception is
performed again with the same settings, the above settings can be omitted.
2. Although the timer-associated registers (TRAMR and TRAIOC) are set before the
TRASR register is set, there is no problem with this flow for the hardware LIN.
(1, 2)
(1)
(1, 2)