
I
Z550 UART
I
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
8
Oki Semiconductor
Line Status Register
The Line Status Register (LSR) is a single register that provides status indications. The LSR is usually the
first register read by the CPU to determine the cause of an interrupt or to poll the status the serial channel.
The contents of the LSR is shown in
Figure 4
and described in the following table.
Figure 4. Line Status Register
Line Status Register Description
LSR Bit(s)
Description
LSR(0)
Data Ready (DR). Data Ready is set high when an incoming character has been received and transferred
into the Receiver Buffer Register. LSR(0) is reset low by a CPU read of the data in the Receiver Buffer Reg-
ister.
LSR(1)
Overrun Error (OE). Overrun Error indicates that data in the Receiver Buffer Register was not read by the
CPU before the next character was transferred into the Receiver Buffer Register, overwriting the previous
character. The OE indicator is reset whenever the CPU reads the contents of the Line Status Register.
An overrun error will occur in the FIFO Mode after the FIFO is full and the next character is completely re-
ceived. The overrun error is deleted by the CPU on the first LSR read after it happens. The character in the
shift register is not transferred to the FIFO but it is overwritten.
LSR(2)
Parity Error (PE). Parity Error indicates that the received data character does not have the correct parity, as
selected by LCR(3) and LCR(4). The PE bit is set high upon detection of a parity error, and is reset low when
the CPU reads the contents of the LSR.
In the FIFO Mode, the Parity Error is associated with a particular character in the FIFO. LCR(2) indicates the
error when the character is at the top of the FIFO.
LSR(3)
Framing Error (FE). Framing Error indicates that the received character did not have a valid stop bit. LSR(3)
is set high when the stop bit following the last data bit or parity bit is detected to be a logic “0” (spacing
level). The FE indicator is reset low when the CPU reads the contents of the LSR. In the FIFO Mode, the
Framing Error is associated with a particular character in the FIFO. LCR(3) indicates the error when the
character is at the top of the FIFO.
LSR(4)
Break Interrupt (BI). Break Interrupt is set high when the received data input is held in the spacing (logic
“0”) state for a full word transmission time (start bit + data bits + parity + stop bits). The BI indicator is reset
when the CPU reads the contents of the Line Status Register.
In the FIFO Mode, this is associated with a particular character in the FIFO. LCR(4) reflects the BI when the
break character is at the top of the FIFO. The error is deleted by the CPU when its associated character is
at the top of the FIFO during the first LSR read. Only one zero character is loaded into the FIFO when a BI
occurs.
LSR(1)-LSR(4) are the error conditions that produce a Receiver Line Status interrupt [priority 1 interrupt in
the Interrupt Identification Register (IIR)] when any of the conditions are detected. This interrupt is enabled
by setting IER(2)=1 in the Interrupt Enable Register.
LSR
7
LSR
6
LSR
5
LSR
4
LSR
3
LSR
2
LSR
1
LSR
0
Overrun Error (OE) (Error=1, No Error=0)
Parity Error (PE) (Error=1, No Error=0)
Framing Error (FE) (Error=1, No Error=0)
Break Interrupt (BI) (Break=1, No Break=0)
Transmitter Holding Register Empty (THRE) (Empty=1, Not Empty=0)
Transmitter Empty (TEMT) (Empty=1, Not Empty=0)
Receiver FIFO Error (Error in FIFO=1, No Error in FIFO=0)
Data Ready (DR) (Ready=1, Not Ready=0)