Professional Documents
Culture Documents
Cs609@vu.edu.pk
Lecture # 15
1 =Self Test
0 =Normal RTS
In case software oriented flow control technique is used the bits 0 and 1 need to be set in
that case. Bit #3 need to be set to enable interrupts. Moreover if a single computer is
available to a developer the UART contains a self test mode which can be used by the
programmer to self test the software. In self test mode the output of the UART is routed
to its input. So you receive what you send.
Change
CD
in CTS
RI Change in DSR
DSR Change in RI
CTS Change in CD
This register indicates the status of the modem status line or any change in the status of
these lines.
FIFO Queue
This feature is available in the newer version of the UART numbered 16500. A queue or a
buffer of the input or output bytes is maintained within the UART in order to facilitate
more efficient I/O. The size of the queue can be controlled through this register as shown
by the slide.
Interrupt ID Register
7 6 3 2 1 0
Interrupt
1= Interrupt Triggered
Because Buffer is not full Triggered =1
But other side has
stop sending data. Reasons of Interrupt
(Time OUT) 00=Change in Modem Line Status
01=THR is Empty
10=Data is ready
11=Error in Data Transmit
Any one of these BEING
Set Indicates FIFO is ON.
INT # 14H
The following slide shows how int 14H service 0 can be used to set the line parameter of
the UART or COM port. The illustrates the various bits of AL that should be set
according before calling this service.
Service # 0
AL =
The Service on return places the line status in AH register as shown in the slide below.
AH = Line Status
And places the modem status in the AL register as shown in slide below.
AL = Modem Status
CD Change in CTS
RI Change in DSR
Ready (DSR) Change in RI
Ready to Receive Change in CD
Other service of 14h include service #1 which is used to send a byte and service #2 which
is used to receive a byte as shown in the slide below.
Service # 01
ON ENTRY
AL = ASCII character to send
ON RETURN
AH = Error Code
If 7th bit in AH = 1 = Unsuccessful
0 = Successful
Service # 02
ON RETURN
AL = ASCII character received
AH = Error Code
Modem
PC Tel Line
Modem
PC
Modem
Modem is generally used to send /receive data to/from an analog telephone. Had the
telephone line been purely digital there would have been no need of a modem in this
form. If data is to transferred from one computer to another through some media which
can carry digital data then the modem can be eliminated and the UART on both
computers can be interconnected. Such arrangement is called a NULL modem.
NULL
Modem
PC PC
CD 1 CD 1
RxD 2 RxD 2
TxD 3 TxD 3
DTR 4 DTR 4
GND 5 GND 5
DSR 6 DSR 6
RTS 7 RTS 7
CTS 8 CTS 8
RI 9 RI 9
The above slide shows the configuration used to interconnect two UARTs In this way a
full duplex communication can be performed and moreover flow control can also be
performed using DSR, DTS, RTS and CTS signals.
Sample Program
Example:
#include<BIOS.H>
#include<DOS.H>
char ch1, ch2;