Information Technology Reference
In-Depth Information
character in the buffer. If there is then it is set to a '1', else the transmitter buffer is empty.
To send a character
Test bit 6 until set;
Send character;
A typical Pascal routine is
repeat
status := port[LSR] and $40;
until (status=$40);
When receiving data the S 0 bit is tested to determine if there is a bit in the receiver buffer. To
receive a character
Test bit 0 until set;
Read character;
A typical Pascal routine is
repeat
status := port[LSR] and $01;
until (status=$01);
Figure 13.16 shows how the LSR is tested for the transmission and reception of characters.
Line control register (LCR)
The LCR sets up the communications parameters. These include the number of bits per char-
acter, the parity and the number of stop bits. It can be written to or read from and has a simi-
lar function to that of the control registers used in the PPI (programmable parallel interface)
and PTC (programmable timer/counter). The bit definitions are given in Figure 13.17.
Character to be
transmitted
Transmitter
Receiver
TX buffer
RX buffer
Character
received
Test S 6 to determine if
the TX buffer is empty
Test S 0 to determine
if the RX buffer is full
1
LSR
LSR
1
Figure 13.16
Testing of the LSR for the transmission and reception of characters
Search WWH ::




Custom Search