|
|
|
|
|
by markfeathers
1300 days ago
|
|
This post inspired me a few years ago to start a very impractical learning side project. Most keyboards don't overly prioritize latency. Development of a keyboard is easy using a USB stack from the manufacturer, but it might not prioritize latency. I'm working on making my own FPGA based USB 2.0 HID device that will let me minimize any latency in the stack. PCB layout is mostly done, I'm working on a DECA FPGA board to prove out the USB hid software now. I started this pre covid though when Mach XO2s were inexpensive and available, so I have no idea who I will need to fight these days to get parts when I get to that point. There is lots of wiggle room too in how you implement your debounce algorithm to optimize latency too. I'm excited to control the whole stack to try to make this as fast as possible. The Logitech lightspeed products came out after I started this project though and are far more practical for most people. I have one of those at home and will try to benchmark and compare them when I get there. |
|
* Let the MCU replace the next unsent input report, and atomically. Many USB devices can only queue reports, not replace them.
* Allow the microcontroller to know when a input report has been received. (ACK)
The first would make it possible to get the lowest latency with reports such as keyboard reports that contains only the state of momentary switches. The second would make it possible to ensure that an event has been received, even if the host would poll at a slower rate than what the firmware works at.
The situation is especially complex for mice, where the reports have inputs that are relative — to the previous report.