7.1.f – TX ACK Advance
Overview
Many Keyspan USB serial adapters support confirmable “Transmit Acknowledgement Advance” (aka
The Problem
In the case of a standard,
By contrast, in a USB to serial adapter situation, information 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 transmitting the last character in its FIFO, the host learns about it at about the same time the character is actually finished being transmitted. 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
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 transmitting. The size of the lie is what’s being configured with the “TX Ack Advance” parameter: it specifies how many characters ahead of time the adapter tells the host “I’m done.” This way, the adapter still has some data to transmit while it’s waiting 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 situations, the serial adapter’s lie is harmless or beneficial, 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 flow control, the remote (receiving) end of the serial connection 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 indefinitely, the “I’m done” indication, if it were sent early, could arrive at the host a significant amount ahead of time. As a result, the application might use the “I’m done” signal as an indication that the remote end is ready, leading to various kinds of trouble.
20