
R8C/3GM Group
26. Hardware LIN
R01UH0284EJ0100 Rev.1.00
Aug 09, 2011
Figure 26.3
Header Field Transmission Flowchart Example (1)
Timer RA Set to timer mode
Bits TMOD2 to TMOD0 in TRAMR register
← 000b
Timer RA Set the pulse output level from low to start
TEDGSEL bit in TRAIOC register
← 1
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 to master mode.
MST bit in LINCR register
← 1
Hardware LIN Set the LIN operation to start
LINE bit in LINCR register
← 1
Hardware LIN Set interrupts to enable
(Bus collision detection, Synch Break detection,
Synch Field measurement)
Bits BCIE, SBIE, SFIE in LINCR register
Hardware LIN Clear the status flags
(Bus collision detection, Synch Break detection,
Synch Field measurement)
Bits B2CLR, B1CLR, B0CLR in LINST register
← 1
Set the count source and
registers TRA and TRAPRE
as appropriate for the Synch
Break period.
In master mode, the Synch
Field measurement-completed
interrupt cannot be used.
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.
UART0
Set to transmit/receive mode
(Transfer data 8 bits long, internal clock, 1 stop bit, parity
disabled)
U0MR register
UART0
Set the BRG count source (f1, f8, f32)
Bits CLK0 and CLK1 in U0C0 register
UART0
Set the bit rate
U0BRG register
Hardware LIN Set the LIN operation to stop
LINCR register LINE bit
← 0
Set the BRG count source
and the U0BRG register as
appropriate for the bit rate.
Hardware LIN Set bus collision detection to enable
BCE bit in LINCR2 register
← 1
Notes:
1. When the previous communication completes normally and header field transmission 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)