| |||
| Home > Programmer’s Model > Register descriptions > Line control register, UARTLCR_H | |||
The UARTLCR_H register is the line control register. This register accesses bits 29 to 22 of the UART bit rate and line control register, UARTLCR.
All the bits are cleared to 0 when reset. Table 3.10 shows the bit assignment of the UARTCR_H register.
Table 3.10. UARTLCR_H register
| Bits | Name | Function |
|---|---|---|
15:8 | - | Reserved, do not modify, read as zero. |
7 | SPS | Stick parity select. When bits 1, 2, and 7 of the UARTLCR_H register are set, the parity bit is transmitted and checked as a 0. When bits 1 and 7 are set, and bit 2 is 0, the parity bit is transmitted and checked as a 1. When this bit is cleared stick parity is disabled. Refer to Table 3.11 for a truth table showing the SPS, EPS and PEN bits. |
6:5 | WLEN | Word length. The select bits indicate the number of data bits transmitted or received in a frame as follows: 11 = 8 bits 10 = 7 bits 01 = 6 bits 00 = 5 bits. |
4 | FEN | Enable FIFOs. If this bit is set to 1, transmit and receive FIFO buffers are enabled (FIFO mode). When cleared to 0 the FIFOs are disabled (character mode) that is, the FIFOs become 1-byte-deep holding registers. |
3 | STP2 | Two stop bits select. If this bit is set to 1, two stop bits are transmitted at the end of the frame. The receive logic does not check for two stop bits being received. |
2 | EPS | Even parity select. If this bit is set to 1, even parity generation and checking is performed during transmission and reception, which checks for an even number of 1s in data and parity bits. When cleared to 0 then odd parity is performed which checks for an odd number of 1s. This bit has no effect when parity is disabled by Parity Enable (bit 1) being cleared to 0. Refer to Table 3.11 for a truth table showing the SPS, EPS and PEN bits. |
1 | PEN | Parity enable. If this bit is set to 1, parity checking and generation is enabled, else parity is disabled and no parity bit added to the data frame. Refer to Table 3.11 for a truth table showing the SPS, EPS and PEN bits. |
0 | BRK | Send break. If this bit is set to 1, a low-level is continually output on the UARTTXD output, after completing transmission of the current character. For the proper execution of the break command, the software must set this bit for at least two complete frames. For normal use, this bit must be cleared to 0. |
UARTLCR_H, UARTIBRD and UARTFBRD form a single 30-bit wide register (UARTLCR) which is updated on a single write strobe generated by a UARTLCR_H write. So, in order to internally update the contents of UARTIBRD or UARTFBRD, a UARTLCR_H write must always be performed at the end.
To update the three registers there are two possible sequences:
UARTIBRD write, UARTFBRD write and UARTLCR_H write
UARTFBRD write, UARTIBRD write and UARTLCR_H write.
To update UARTIBRD or UARTFBRD only:
UARTIBRD write (or UARTFBRD write) and UARTLCR_H write.
Table 3.11 is a truth table for the Stick Parity Select (SPS), Even Parity Select (EPS), and Parity ENable (PEN) bits of the UARTLCR_H register.
Table 3.11. Truth table
| PEN | EPS | SPS | Parity bit (transmitted or checked) |
|---|---|---|---|
| 0 | x | x | Not transmitted or checked |
| 1 | 1 | 0 | Even parity |
| 1 | 0 | 0 | Odd parity |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 |
The baud rate and line control registers must not be changed:
when the UART is enabled
when completing a transmission or a reception when it has been programmed to become disabled.
The FIFO integrity is not guaranteed under the following conditions:
after the BRK bit has been initiated
if the software disables the UART in the middle of a transmission with data in the FIFO, and then re-enables it.