is low latency communication possible?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
hm1717

is low latency communication possible?

Post by hm1717 » Sun Jan 25, 2009 12:43 pm

Hello everybody,

I'm trying to find out a way to make a low latency read-compute-write solution over usb.
.. i mean.. i'd like to be able to read some sensors (low amount of data..4-16 bytes) from an usb device, then do some (quick) computation on the computer side, and then send some result back to the usb device (also low amount of data)... what's important is that the time between sensor read and getting the reply in the usb device is as short as possible.
which should be the fastest method ? using an interrupt-in interrupt-out pair ? or maybe tricking the control endpoint to carry some little data?
which would be the lowest latency possible? (i'd need something like 1ms or less in an ideal world)
does HID or PID devices offer a lower latency in any way ?

thanks,
mihai

Drools
Posts: 15
Joined: Thu Dec 11, 2008 11:17 pm

Post by Drools » Mon Feb 02, 2009 10:09 pm

I'm also looking for a something similar however only one way, from USB --> PC but it has to be very low latency. If I come across a solution I will post back.

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Tue Feb 03, 2009 3:30 pm

When the host initiates communication, the control transfer is one of your best options for low speed devices. Full speed devices would benefit from a bulk endpoint, though.

In your case, just do a control-in, do your processing and then a control-out. 1 ms latency may be possible, but better measure the actual delay.

For AVR-USB to be as fast as possible, make sure that you have low delays in usbFunctionSetup(), usbFunctionRead() and usbFunctionWrite().

Post Reply