Some time ago I announced my intention to work on a usb connection that can replace the bluetooth connection (it’s well known that the ps3 is compatible with some joysticks that comply with the USB HID specification).
Why do I want a usb connection?
- better precision for sticks (better than 8-bit precision)
- higher update frequency (better than 100Hz)
- good solution for a native windows controller
- challenge 😉
What hardware can be used?
This usb connection requires a system with 2 usb ports, one for the PC, and the other for the PS3. My first though was to use a VNC2, which is a programmable device with 2 usb ports. But the development tools are windows only 🙁
Widely distributed, available, and cheap devices with usb capabilities are the at90usb* boards (Teensy++, bumble-b, AvrUsbKey…). These only have a single usb port, which is not enough. But it’s possible to talk to these boards with other means like a UART (RS232, AKA serial connection).
USB to RS232 TTL devices are very easy to find and are very cheap (a few $/€). The theoretical maximum baud rate reachable with these devices is 1 Mbit/s = 125 Kbytes/s = 125 bytes/ms, which seems fast enough. As a comparison, the sixaxis sends about 64 bytes to the PS3 each 10ms.
Another good point for this at90usb + RS232 solution is that I already have all the hardware parts, as you can see in the following picture:
- Red outlined, the USB to RS232 TTL chip (FT232RL from FTDI). It’s on an arduino board, which is not required at all.
- Blue outlined, the bumble-b (at90usb162).
- Green outlined, the push-buttons required by the bumble-b to enter into dfu mode (other usb boards generally have on board push-buttons).
The RS232 connection requires as low as 3 wires (Gnd, Rx and Tx). Rx and Tx wires are crossed.
The Rx and Tx connectors of the arduino are for the AVR chip (which is absent on my board), and are crossed with the FT232RL. That’s why the arduino Rx pin is the FT232RL Tx, and the arduino Tx pin is the FT232RL Rx. I obviously fall into the trap 🙂
- The ps3 seems to handle 16-bit axes.
- The at90usb162 can report its joystick state each 1ms (but not sure the ps3 can work as fast).
- The practical max baud rate of the RS232 connection is about 85 bytes/ms bidirectional (instead of the 125 bytes/ms theoretical max baud rate).
- There seems to be no transmission error for the RS232 connection (I won’t handle errors in a first time).
- write a clean joystick interface
- write a RS232-capable emu process