
Chapter 4
Using Your Serial Hardware
PCI Serial for Windows 95
4-2
©
National Instruments Corporation
Asynchronous Receiver/Transmitter) is asserted. To transmit, your
application must first clear the
bit to enable the transmitter. After the
data is fully transmitted, your application once again sets the
bit to
disable the transmitter. Because the receiver is always enabled in this
mode, you not only receive packets from other devices, you also receive the
packets sent from your transmitter.
Two-Wire Mode: DTR Controlled
This mode is similar to the two-wire,
-with-echo mode. Use this mode
in half-duplex systems where the
line must control the transmitter.
Although this mode uses the same method as the
-with-echo mode to
control the transmitter, the hardware automatically disables the receiver
whenever the transmitter is enabled. Thus, you do not receive packets that
you have transmitted.
Two-Wire Mode: TXRDY Auto Control
In this mode, the hardware transparently enables the transmitter and
receiver in a two-wire system. This mode removes the burden of flow
control from the user software. By connecting the transmitter to the
(Transmit Ready) line, the hardware enables the transmitter for
each byte to be transmitted. Also, the hardware disables the receiver
whenever the transmitter is enabled, so you do not receive packets that you
have transmitted.
Note
It is recommended that you use the two-wire
auto control mode when you
are communicating with a two-wire device. Because this mode handles the
transmitter/receiver enabling for a two-wire connection in your hardware, it
reduces the software overhead required to perform this operation in your
application program.
Setting the Transceiver Control Mode
The recommended method for setting the transceiver control mode is with
the serial configuration utility located in the Windows 95 Device Manager.
For more information, refer to the
section in
Chapter 3,
. The mode you select in the Device Manager is
automatically configured when you open a port on a serial interface. You
can also set the hardware transceiver control mode from within a DOS
application. For each port you want to control, write the control byte for the
mode you want to select to the scratch register of the UART. Table 4-2
shows the control bytes for each mode.
DTR
DTR
DTR
DTR
DTR
TXRDY
TXRDY