PSX controller to USB adapter using a Pro Micro, with minimal lag: about 0.65 ms on average (estimated), close to the 0.5 ms floor set by the 1 ms USB polling.
Supports both classic and Dual-Shock controllers.
When using a Dual-Shock, enabling ANALOG on the controller adds about 0.2 ms, since the sticks are read after the buttons.
Two options for DATA:
- Lowest lag: add an external pull-up (about 1 kΩ) from DATA to the pin that powers the controller (VCC). This is what the code expects by default (
CLOCK_LOW_US 2inlibraries/psxlib/Psx.cpp). - No extra component: set
CLOCK_LOW_USto 10. The internal pull-up is then enough, but a read takes longer: in ANALOG mode, reports go out every 2 ms instead of every 1 ms.
Do not use CLOCK_LOW_US 2 without the external pull-up: DATA rises too slowly and released buttons read as pressed.
Includes modified copies of two libraries, in libraries/:
psxlib: started from https://github.com/Jerther/psxlib (archived), itself based on Kevin Ahrendt's PSX library. The copy here is the maintained version: it uses the Pro Micro pins directly and adds analog sticks, a 250 kHz clock and frame validation.ArduinoGamepad: from https://github.com/gamelaster/ArduinoGamepad, slightly modified to reduce lag for a PSX controller.
