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
is low latency communication possible?
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().
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().