Re: USB serial port latency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Jul 2011, Walter Brisken wrote:

> Hi Linux USB serial port experts,
> 
> I recently bought a 4-port USB RS485 serial port box.  It is immediately 
> recognized by our Linux machines and works fine for the simple things.  My 
> particular application uses RS485 on a monitor and control bus for telescope 
> control and has strict timing requirements.  For this device to work it will 
> need to respond with an ACK signal within ~500 microseconds of receiving the 
> last byte of an address word.  We are operating at 57600 baud.
> 
> Reading a knowledgebase article at 
> http://www.ftdichip.com/Support/Knowledgebase/index.html (transcript of page 
> below [*]) I learned that USB being packet-based does not generate interrupts 
> upon receiving traffic and may be fundamentally rate limited for 
> one-character-at-a-time operation.  My question for you (or someone else you 
> might be able to point me to) is whether or not such a device can be programmed 
> to poll often enough to not miss our timing window. I have enabled low-latency 
> and done everything I can think of, short of digging into driver code.

It is barely possible if the USB RS485 box runs at high speed.  At full 
speed it is not possible, because packet-completion interrupts occur 
only once per ms.

In general, USB isn't a good match for low-latency character-at-a-time 
stuff.  Besides which, the kernel doesn't guarantee that interrupts 
will always be handled in a timely fashion.  You should plan to see 
delays of several ms or more between the time an I/O event occurs and 
the time the handler runs.

For something requiring a latency under 500 us, you would need hardware
assistance.

> For reference, I've tried this on RedHat Enterprise Linux with kernel 
> 2.6.18-194.32.1.el5 and on my Gentoo laptop with 2.6.38 kernel and the device 
> is a VSCOM 4 port RS482/485 using FTDI FT232 series UARTs.

IIRC, those FTDI devices run at full speed.

> Any advice?  If there is no solution here with the USB device (as I 
> suspect) can you recommend any PCI boards that may work better for my 
> application?

I don't know of any.  You might have better luck asking on the 
linux-pci mailing list.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux