
UM10850
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 2.4 — 13 September 2016
278 of 464
NXP Semiconductors
UM10850
Chapter 21: LPC5410x USARTs (USART0/1/2/3)
Automatic data direction control with the RTS pin can be set up using the OESEL,
OEPOL, and OETA bits in the CFG register (
). Data direction control can
also be implemented in software using a GPIO pin.
21.7.7 Oversampling
Typical industry standard USARTs use a 16x oversample clock to transmit and receive
asynchronous data. This is the number of BRG clocks used for one data bit. The
Oversample Select Register (OSR) allows this USART to use a 16x down to a 5x
oversample clock. There is no oversampling in synchronous modes.
Reducing the oversampling can sometimes help in getting better baud rate matching
when the baud rate is very high, or the peripheral clock is very low. For example, the
closest actual rate near 115,200 baud with a 12 MHz peripheral clock and 16x
oversampling is 107,143 baud, giving a rate error of 7%. Changing the oversampling to
15x gets the actual rate to 114,286 baud, a rate error of 0.8%. Reducing the oversampling
to 13x gets the actual rate to 115,385 baud, a rate error of only 0.16%.
There is a cost for altering the oversampling. In asynchronous modes, the USART takes
three samples of incoming data on consecutive oversample clocks, as close to the center
of a bit time as can be done. When the oversample rate is reduced, the three samples
spread out and occupy a larger proportion of a bit time. For example, with 5x
oversampling, there is one oversample clock, then three data samples taken, then one
more oversample clock before the end of the bit time. Since the oversample clock is
running asynchronously from the input data, skew of the input data relative to the
expected timing has little room for error. At 16x oversampling, there are several
oversample clocks before actual data sampling is done, making the sampling more
robust. Generally speaking, it is recommended to use the highest oversampling where the
rate error is acceptable in the system.
21.7.8 Break generation and detection
A line break may be sent at any time, regardless of other USART activity. Received break
is also detected at any time, including during reception of a character. Received break is
signaled when the RX input remains low for 16 bit times. Both the beginning and end of a
received break are noted by the DELTARXBRK status flag, which can be used as an
interrupt. See
for details of LIN mode break.
In order to avoid corrupting any character currently being transmitted, it is recommended
that the USART transmitter be disabled by setting the TXDIS bit in the CTL register, then
waiting for the TXDISSTAT flag to be set prior to sending a break. Then a 1 may be written
to the TXBRKEN bit in the CTL register. This sends a break until TXBRKEN is cleared,
allowing any length break to be sent.
21.7.9 LIN bus
The only difference between standard operation and LIN mode is that LIN mode alters the
way that break generation and detection is performed (see
for details of
the standard break). When a break is requested by setting the TXBRKEN bit in the CTL
register, then sending a dummy character, a 13 bit time break is sent. A received break is
flagged when the RX input remains low for 11 bit times. As for non-LIN mode, a received
character is also flagged, and accompanied by a framing error status.