Keyspan USA-49WG Computer Drive User Manual


 
20
Overview
Many Keyspan USB serial adapters support conrmable “Transmit Acknowledgement Advance” (aka TX-ACK threshold,
aka TX-ACK (nowledgement) advance, etc.) in the Keyspan Manager. This feature allows the user to adjust a device’s
transmit behavior to achieve the opmum compromise between compability (exact emulaon of built-in ports) and
maximum throughput. This document describes the factors which a user should be aware of to guide their conguraon
of this feature.
The Problem
In the case of a standard, “built-in” serial port, the host CPU (the “brain” of the computer) can communicate directly
with the serial hardware because the (serial) hardware is in the address space directly accessible to the CPU. When
the serial port has transmied all the data in its transmit FIFO (the buer that holds characters waing to be sent), it
interrupts the CPU, which then adds more characters to the transmit FIFO with a minimum me delay.
By contrast, in a USB to serial adapter situaon, informaon about the state of the serial port FIFO reaches the CPU
by means of USB messages. The USB subsystem in most computers delays the delivery of inbound (USB peripheral to
USB host computer) USB messages by about 1 millisecond. The impact of this delay on serial throughput depends on
the baud rate. At 9600 baud, it takes about 1 millisecond to transmit a character. If the serial adapter signals the host
when it begins transming the last character in its FIFO, the host learns about it at about the same me the character
is actually nished being transmied. Since outbound (USB host computer to USB peripheral) USB messages are not
subject to such a long delay, the host can supply new data before the serial port has been idles for too long.
At higher baud rates, however, this 1-millisecond delay becomes more of a problem. For example, at 920 Kbps, 1
millisecond is enough me to send 92 characters. So, if you’re sending 92 characters at a me, you will only achieve
50% throughput, since half the me is spent with the adapter waing for the host to send more data.
The Work Around
Since there’s no way to eliminate the USB delays, there’s only one work around: the serial adapter has to like about
when it’s done transming. The size of the lie is what’s being congured with the “TX Ack Advance” parameter: it
species how many characters ahead of me the adapter tells the host “I’m done.” This way, the adapter sll has some
data to transmit while it’s waing for more to arrive from the host. If the next data from the host arrives before the
previous data is completely sent, the new data can be sent with no delay, and the device will achieve 100% transmit
throughput.
Notes about the Work Around
In most situaons, the serial adapter’s lie is harmless or benecial, even. However, in some circumstances, this lie gets
us into trouble. There are several ways this can happen:
Flow control: If the adapter is programmed to use ow control, the remote (receiving) end of the serial connecon can
ask the adapter to suspend its data transmission (e.g. if it’s not ready to receive more data). Since this state can persist
indenitely, the “I’m done” indicaon, if it were sent early, could arrive at the host a signicant amount ahead of me.
As a result, the applicaon might use the “I’m done” signal as an indicaon that the remote end is ready, leading to
various kinds of trouble.
7.1.f – TX ACK Advance