English
Language : 

LM3S5D91 Datasheet, PDF (694/1340 Pages) Texas Instruments – Stellaris® LM3S5D91 Microcontroller
Universal Asynchronous Receivers/Transmitters (UARTs)
When preparing to send a LIN message, the TXFIFO should contain the Sync data (0x55) at FIFO
location 0 and the Identifier data at location 1, followed by the data to be transmitted, and with the
checksum in the final FIFO entry.
13.3.7.1
LIN Master
The UART is enabled to be the LIN master by setting the MASTER bit in the UARTLCTL register.
The length of the Sync Break is programmable using the BLEN field in the UARTLCTL register and
can be 13-16 bits (baud clock cycles).
13.3.7.2
LIN Slave
The LIN UART slave is required to adjust its baud rate to that of the LIN master. In slave mode, the
LIN UART recognizes the Sync Break, which must be at least 13 bits in duration. A timer is provided
to capture timing data on the 1st and 5th falling edges of the Sync field so that the baud rate can
be adjusted to match the master.
After detecting a Sync Break, the UART waits for the synchronization field. The first falling edge
generates an interrupt using the LME1RIS bit in the UARTRIS register, and the timer value is
captured and stored in the UARTLSS register (T1). On the fifth falling edge, a second interrupt is
generated using the LME5RIS bit in the UARTRIS register, and the timer value is captured again
(T2). The actual baud rate can be calculated using (T2-T1)/8, and the local baud rate should be
adjusted as needed. Figure 13-5 on page 694 illustrates the synchronization field.
Figure 13-5. LIN Synchronization Field
Sync Break
Synch Field
0 1 2 3 4 5 6 7 8 9 10 11 12 13
Sync Break Detect
0
1
2
3
4
5
6
7
8
Edge 1
Edge 5
8 Tbit
13.3.8
FIFO Operation
The UART has two 16x8 FIFOs; one for transmit and one for receive. Both FIFOs are accessed via
the UART Data (UARTDR) register (see page 700). Read operations of the UARTDR register return
a 12-bit value consisting of 8 data bits and 4 error flags while write operations place 8-bit data in
the transmit FIFO.
Out of reset, both FIFOs are disabled and act as 1-byte-deep holding registers. The FIFOs are
enabled by setting the FEN bit in UARTLCRH (page 711).
FIFO status can be monitored via the UART Flag (UARTFR) register (see page 705) and the UART
Receive Status (UARTRSR) register. Hardware monitors empty, full and overrun conditions. The
UARTFR register contains empty and full flags (TXFE, TXFF, RXFE, and RXFF bits), and the
UARTRSR register shows overrun status via the OE bit. If the FIFOs are disabled, the empty and
full flags are set according to the status of the 1-byte-deep holding registers.
The trigger points at which the FIFOs generate interrupts is controlled via the UART Interrupt FIFO
Level Select (UARTIFLS) register (see page 717). Both FIFOs can be individually configured to
trigger interrupts at different levels. Available configurations include ⅛, ¼, ½, ¾, and ⅞. For example,
694
January 22, 2012
Texas Instruments-Production Data