USB connection

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 ๐Ÿ™‚

First experiments:

  • 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).

Next tasks:

  • write a clean joystick interface
  • write a RS232-capable emu process

12 Replies to “USB connection”

  1. Neat…I can't wait; I've got an FTDI breakout board, an Arduino D, both versions of the teensy 2.0, and a laptop with both win7x64 and Ubuntu 11.04 installed…I intend to be ready for release!

  2. How about 2 at90usb162 or equivalent? The new Arduinos use an Atmega8u2 instead of an FTDI. I have a couple Atmega32u2 and have a teensy++ 2.0 I would love to try this out on. Especially if I could use my 360 wired controller with it.

  3. @Jeremy

    Seems like you forgot a negation in your phrase ๐Ÿ™‚ Yes, this is another advantage of this method, the hardware compatibility should be better.

    @Chuck

    The atmega8u2 of the arduino behaves like a USB to RS232 TTL chip. The firmware it runs is open-source and is built with the LUFA library, which is great because it means you can build the firmware for any other supported hardware.

  4. Oops ( ^no) more ๐Ÿ™‚
    Here is an idea for a future feature: A simple keyboard emulator that we could switch to for easy psn message typing. Like press [Key] to toggle between controller and Keyboard mode.

  5. More amazing work! ๐Ÿ˜€
    It would been more efficient if you could somehow use a more powerful device like a beagleboard or plug pc to have it interface with the ps3 and plug a usb mouse and keyboard directly into it.

    With that being said, I'm curious why cant you just use your PC to interface with the PS3 directly using USB? Hardware wise it should be possible.

  6. @Jeremy

    Good idea, but this doesn't look simple to me.

    @darkinovator

    My solution is cheap (about 20$), easy, and efficient.

    Direct connection is not possible due to the usb protocol. A host can't be a device.

  7. Jeremy…not sure if this appeals to you, but a usb switch on the keyboard would do what you describe. I agree it would be a neat feature, but I am more concerned with the basic sixaxis functionality myself; no reason to work on bonus features when the main feature is still WIP.

  8. @matlo cheap is good but for an extra 80$ you could get a far more power efficient solution, in the long run you might get back your monys worth. Anyways I love the work your doing, if this provides better polling rate it would be amazing.

    One question tho I thought usb 2.0 standard allow a host control to become a device. So 2 host control's can communicate with each other?

  9. I agree it's much convenient to use for people that don't want a PC to control the PS3. I don't think it would be more powerful or efficient.

    The beagleboard costs 125$ on digikey.com, without s&h, and without customs… Most people will hesitate to spend that much money for a non commercial controller.

    My free time is limited. I don't have the time to make it run on every hardware.

    Both host and device capabilities for a single usb port is USB OTG. Generally desktops/laptops don't have such usb ports.

  10. This product from littlebirdelectronics is not what you need, because it most probably works at -12V/+12V levels.

    What you need is a usb to serial converter that works at 0V/+5V: link1, link2.

    Prices are lower on ebay: link.

    But ebay is ebay (slow delivery + sometimes bad surprises…).

    Concerning the avr usb board, I highly recommend the teensy board: link.

    A second teensy board working as a usb to serial converter is something possible.

Leave a Reply

Your email address will not be published. Required fields are marked *