DIY USB adapter

From GIMX

Revision as of 21:28, 26 October 2015 by Kensands (talk | contribs) (help on how to do the firmware upload.)

Jump to: navigation, search
Other languages:
English • ‎français

This page explains how to build a pc to PS3/Xbox 360/PS4/Xbox One usb adapter.

A much easier but less complete tutorial is also available: DIY USB Adapter for dummies.
A German translation of a previous version is also available on the forum: old German translation.

Warning: you are responsible for the hardware you buy, and anything right or wrong you do with this.

Required hardware parts

USB to serial TTL converter

Make sure it works at 500kbps and that it is 5V tolerant.

chip CP2102 FT232R PL2303 CH340 FT230X
5V tolerant yes (*) (*) (*) yes
500 kbps yes yes no no yes
compatible yes (*) no no yes

(*) depends on the board
Examples:

AVR USB development board

Make sure it is working at 5V and that is has a chip among the following: at90usb82, at90usb162, at90usb646, at90usb647, at90usb1286, at90usb1287, atmega16u2, atmega32u2, atmega16u4, atmega32u4
Examples:

Recommended setup

  • CP2102 converter from ebay (very low price, but sometimes low delivery)
  • Teensy 2.0 board (low price, good quality, and quick delivery).

Firmware loading

  • EMUJOYSTICKPS3: HID joystick emulation, with 16bit stick axes, for PS3
  • EMUPS3: Sixaxis emulation, for PS3
  • EMU360: 360 pad emulation, for Xbox 360
  • EMUPS4: Hori Pad FPS Plus emulation, for PS4 (with touchpad support)
  • EMUXONE: Xbox One pad emulation, for Xbox One
  • EMUG29PS4: Logitech G29 gaming wheel emulation, for PS4, with force feedback support
  • EMUG27PS3: Logitech G27 gaming wheel emulation, for PS3, with force feedback support
  • EMUGTFPS2: Logitech GT Force emulation, for PS2, with force feedback support
  • EMUDFPS2: Logitech Driving Force emulation, for PS2, with force feedback support
  • EMUDFPPS2: Logitech Driving Force Pro emulation, for PS2, with force feedback support
  • EMUG27PC: Logitech G27 gaming wheel emulation, for PC, force feedback support

There are several tools that can be used to load the hex file:

dfu-programmer example:

   sudo dfu-programmer at90usb162 erase
   sudo dfu-programmer at90usb162 flash at90usb162.hex
   sudo dfu-programmer at90usb162 reset

If you want to build on the cheap, you can get a cp2102 based USB to TTL for £1 and an ATmega32u4 board for around £3.50, if you do and you're on windows you may have found the firmware upload can be tricky. Well here's how to do it. The board I got showed up as an arduino leonardo (it's not) and would accept uploads only from the arduino programming tool (unfortunately that will not upload hex files but uploading the blink example is good enough for now). Fortunately that tool gives a nice debug output if you turn it on (it's in the options). It uses the program avrdude to do the actual upload and the trick was that it puts the board into programming mode first by connecting to it at 1200 baud. (while other tools do this they then fall at the next hurdle which was that while the activating and uploading are on different com ports). Your COM ports may vary but the debug from the arduino program will show you the ones needed. once you know the two ports it uses you can use the following in a command window

avrdude.exe" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -n -patmega32u4 -cavr109 -PCOM3 -b1200

followed within 2 seconds by

avrdude.exe" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -patmega32u4 -cavr109 -PCOM5 -b57600 -D -Uflash:w:<PATH TO FIRMWARE>\atmega32u4.hex:i

Obviously with the correct paths in there and with the -PCOM3 / -PCOM5 set to the com ports your device is on. Once you've successfully got your new firmware on board you'll find that you're good to go but what if you want to switch to new firmware? well at this point the device is not shown as a COM device at all. the way to get it back into programming mode is to hit the reset switch, for our cheap boards this means bridging the RST pin to ground (GND) while it is connected. This seemingly does the same thing as the connecting at 1200 baud, you'll likely get a beep from your pc to tell you a new device is connected, but only again for a couple of seconds, so you'll need to run the upload command (the second of the commands above) within seconds of the reset, if all is well you'll see the upload sequence again.

Wiring

The only thing you have to do is to connect the following pins:

USB dev board USB to UART board
GND GND
RX TX / TXO / RXD
TX RX / RXI / TXD

With a Teensy 2.0 as a USB dev board:

Teensy 2.0 USB to UART board
GND GND
D2 TX / TXO / RXD
D3 RX / RXI / TXD

If you use the arduino on-board USB to serial converter, Rx and Tx are inverted, i.e. Rx = TX▶ and Tx = RX◀

The example below shows how to connect a CP2102 converter (left) to a Teensy 2.0 board (right):

It's possible to solder wires or to use jumper wires (these are generally provided with USB to serial TTL boards) in case your AVR USB board has header pins:

Examples:

  • Bumble-b and FT232RL wired on a breadboard:
  • Teensy++ and CP2102 wired on a breadboard:
  • Teensy 2.0 and CP2102 soldered:

Connection

If it's not already done, install GIMX.
Connect the USB to UART converter to your PC, and connect the usb dev board to your console.
Turn the console on (the ps/guide buttons are not working at this point).
The console should detect a controller (if you add another controller, it should be detected as controller #2).
Start gimx-launcher:
TODO: update screenshot

In Ubuntu/Linux, the USB to UART converter should be detected as "ttyUSBX" (with 'X' a number).
In Windows, it should be detected as "COMX" (with 'X' a number). Check the device manager to select the right one.

Now that your adapter is ready you can follow the instructions on the Quick Start page.