|
|
(100 intermediate revisions by 6 users not shown)
|
Line 4: |
Line 4: |
| | | |
| <!--T:22--> | | <!--T:22--> |
| + | '''[https://blog.gimx.fr/product/gimx-adapter/ Buy a ready to use GIMX adapter from the official GIMX shop.]'''<br /> |
| '''A much easier but less complete tutorial is also available: [[DIY_USB_adapter_for_dummies|DIY USB Adapter for dummies]].'''<br /> | | '''A much easier but less complete tutorial is also available: [[DIY_USB_adapter_for_dummies|DIY USB Adapter for dummies]].'''<br /> |
− | A German translation of a previous version is also available on the forum: [http://forum.gimx.fr/viewtopic.php?f=4&t=362 old German translation]. | + | A German translation of a previous version is also available on the forum: [https://forum.gimx.fr/viewtopic.php?f=4&t=362 old German translation]. |
| | | |
| <!--T:2--> | | <!--T:2--> |
Line 12: |
Line 13: |
| ==Required hardware parts== <!--T:3--> | | ==Required hardware parts== <!--T:3--> |
| | | |
− | === USB to serial TTL converter === <!--T:4--> | + | ===USB to UART adapter=== <!--T:4--> |
| + | |
| + | <!--T:37--> |
| Make sure it works at '''500kbps''' and that it is '''5V tolerant'''. | | Make sure it works at '''500kbps''' and that it is '''5V tolerant'''. |
| {| class="wikitable" | | {| class="wikitable" |
− | | chip || CP2102 || FT232R || PL2303 || CH340 || FT230X | + | | chip || CP2102 || FT232R || PL2303HX || CH340 || FT230X |
| |- | | |- |
| | 5V tolerant | | | 5V tolerant |
| | style="background: green; color: white;" | yes | | | style="background: green; color: white;" | yes |
− | | style="background: orange; color: white;" | (*) | + | | style="background: orange; color: white;" | (1) |
− | | style="background: orange; color: white;" | (*) | + | | style="background: orange; color: white;" | (1) |
− | | style="background: orange; color: white;" | (*) | + | | style="background: orange; color: white;" | (1) |
| | style="background: green; color: white;" | yes | | | style="background: green; color: white;" | yes |
| |- | | |- |
Line 27: |
Line 30: |
| | style="background: green; color: white;" | yes | | | style="background: green; color: white;" | yes |
| | style="background: green; color: white;" | yes | | | style="background: green; color: white;" | yes |
− | | style="background: red; color: white;" | no | + | | style="background: orange; color: white;" | (2) |
| | style="background: red; color: white;" | no | | | style="background: red; color: white;" | no |
| | style="background: green; color: white;" | yes | | | style="background: green; color: white;" | yes |
Line 35: |
Line 38: |
| | compatible | | | compatible |
| | style="background: green; color: white;" | yes | | | style="background: green; color: white;" | yes |
− | | style="background: orange; color: white;" | (*) | + | | style="background: orange; color: white;" | (1) |
− | | style="background: red; color: white;" | no | + | | style="background: orange; color: white;" | (1)(2) |
| | style="background: red; color: white;" | no | | | style="background: red; color: white;" | no |
| | style="background: green; color: white;" | yes | | | style="background: green; color: white;" | yes |
| |} | | |} |
− | (*) depends on the board<br /> | + | (1) depends on the board<br /> |
| + | (2) only on Linux<br /> |
| Examples: | | Examples: |
| * [http://jim.sh/ftx/ MicroFTX (10$ excl. shipping costs)] | | * [http://jim.sh/ftx/ MicroFTX (10$ excl. shipping costs)] |
Line 51: |
Line 55: |
| | | |
| === AVR USB development board === <!--T:5--> | | === AVR USB development board === <!--T:5--> |
− | 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<br /> | + | |
| + | <!--T:41--> |
| + | Make sure it is '''working at 5V''' and that is has an '''atmega32u4''' chip. |
| Examples: | | Examples: |
− | * [http://www.pjrc.com/store/teensy.html Teensy 2.0 board (atmega32u4, 16$ excl. shipping costs)] (to build a solderless adapter, take a board [http://www.pjrc.com/store/teensy_pins.html with header pins]) (newer Teensy 3.x and LC boards are NOT compatible as they do not have the same chip) | + | * [http://www.pjrc.com/store/teensy.html Teensy 2.0 board ('''atmega32u4''', '''16$''' excl. shipping costs)] <span style=" font-weight:bold;">(Warning: Chinese clones of Teensy are '''NOT SUPPORTED''', use only genuine product)</span> (to build a solderless adapter, take a board [http://www.pjrc.com/store/teensy_pins.html with header pins]) (newer Teensy 3.x and LC boards are NOT compatible as they do not have the same chip) |
− | * Boards used for the psgroove hack (check the on-board chip).
| + | * Arduino-compatible boards based on the '''atmega32u4 chip''' '''(4$-11$)''' |
− | * Arduino-compatible boards based on the atmega32u4 chip | + | ** [http://arduino.cc/en/Main/ArduinoBoardLeonardo Arduino Leonardo] - [http://arduino.cc/en/Main/Buy distributors] - (cheap Chinese clones can be found on ebay for '''11$''' incl. shipping costs) |
− | ** [http://arduino.cc/en/Main/ArduinoBoardLeonardo Arduino Leonardo] - [http://arduino.cc/en/Main/Buy distributors] - (cheap Chinese clones can be found on ebay for 11$ incl. shipping costs) | + | ** [http://www.ebay.com/sch/i.html?_sop=15&_from=R40&_sacat=0&_nkw=pro+micro+atmega32u4+-atmega328&LH_PrefLoc=2&rt=nc&LH_BIN=1 Cheap '''atmega32u4''' boards on ebay] (about 4$). Soldering required. |
− | ** [http://www.ebay.com/sch/i.html?_sop=15&_from=R40&_sacat=0&_nkw=pro+micro+atmega32u4+-atmega328&LH_PrefLoc=2&rt=nc&LH_BIN=1 Cheap atmega32u4 boards on ebay] (about 4$). Soldering required. | |
| | | |
− | === Recommended setup === <!--T:7--> | + | ==Wiring== <!--T:12--> |
− | * CP2102 converter from ebay (very low price, but sometimes low delivery)
| |
− | * Teensy 2.0 board (low price, good quality, and quick delivery).
| |
− | | |
− | ==Firmware loading== <!--T:8-->
| |
− | | |
− | <!--T:9-->
| |
− | *[http://gimx.fr/download/gimx-firmwares Firmwares]
| |
− | {{Firmwares/en}}
| |
− | | |
− | ===Teensy boards===
| |
− | | |
− | Teensy boards can be easily flashed using the [http://www.pjrc.com/teensy/loader.html Teensy Loader].<br />
| |
− | It is probably the easier to use flashing tool, but it is only compatible with '''genuine''' teensy boards.
| |
− | | |
− | ===Cheap Arduino-compatible atmega32u4-based boards===
| |
− | | |
− | ====First-time flashing instructions====
| |
− | | |
− | * Download the Arduino Leonardo drivers and save them into the same folder:
| |
− | ** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.cat arduino.cat]
| |
− | ** [https://github.com/arduino/Arduino/raw/master/build/windows/dist/drivers/arduino.inf arduino.inf]
| |
− | * Right-click on the arduino.inf file and click on Install.
| |
− | * Connect the atmega32u4 board. A new COM port named "Arduino Leonardo (COMX)" should appear in the device manager.
| |
− | * Download the [http://sourceforge.net/projects/arduinodev/files/ArduinoBuilder/ArduinoBuilder-0.8.8.7z/download Arduino Builder tool] and extract the archive (using [http://www.7-zip.org/ 7zip]).
| |
− | * Run ArduinoBuilder.exe.
| |
− | * Click on "Load Sketch / HEX", and select the desired atmega32u4.hex firmware.
| |
− | * Click on "Board Type" and select "Arduino Leonardo".
| |
− | * In the Arduino Builder tool, click on the COM port that matches the "Arduino Leonardo (COMX)" COM port in the device manager.
| |
− | Upon success a "Uploading completed!" message should be displayed.<br /><br />
| |
− | | |
− | This did not work on windows for me, the board entered programming state but Arduino Builder could not find the com port for the upload (due to the com port changing as it's put into programming mode), if that happens you can manually perform the steps by calling avrdude and putting the com ports in use:
| |
− | avrdude.exe" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -n -patmega32u4 -cavr109 '''-PCOM3''' -b1200
| |
− | followed within a few 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
| |
− | | |
− | In GNU/Linux, use the following command to run the bootloader:
| |
− | avrdude -v -n -p atmega32u4 -c avr109 -P /dev/ttyACM0 -b 1200
| |
− | And use the following command (within 8 seconds) to load the firmware:
| |
− | avrdude -v -p atmega32u4 -c avr109 -P /dev/ttyACM0 -b 57600 -D -U flash:w:atmega32u4.hex:i
| |
− | | |
− | ====Further flashing====
| |
− | | |
− | Because GIMX reprograms the USB interface, the COM port used in the First-time flashing instructions is no more available.<br />
| |
− | Fortunately, there is a way to make the board run the bootloader:
| |
− | * Make sure that the USB to UART board (e.g. CP2102) is connected and powered, and that the wiring with the atmega32u4 board is correct.
| |
− | * Make sure that the atmega32u4 board is connected and powered.
| |
− | * Run ArduinoBuilder.exe.
| |
− | * Click on "Load Sketch / HEX", and select the desired atmega32u4.hex firmware.
| |
− | * Click on "Board Type" and select "Arduino Leonardo".
| |
− | * In the Arduino Builder tool, click on the COM port that matches the "Silicon Labs CP210x ... (COMX)" COM port in the device manager (or whatever the name of your USB to UART board is). This is a trick to make the Arduino Builder tool look for a new COM port.
| |
− | * The following message should appear: "Forcing reset using 1200bps open/close on COMX...".
| |
− | * Quickly unplug/replug the atmega32u4 board, or connect RST to GND twice.
| |
− | * The atmega32u4 board should run the bootloader. The Arduino builder tool should find the Arduino Leonardo COM port and flash the firmware.
| |
− | Upon success a "Uploading completed!" message should be displayed.<br /><br />
| |
− | In GNU/Linux, use the following command to load the firmware (within 8 seconds after repluging):
| |
− | avrdude -v -p atmega32u4 -c avr109 -P /dev/ttyACM0 -b 57600 -D -U flash:w:atmega32u4.hex:i
| |
− | | |
− | ===Other tools===
| |
− | | |
− | <!--T:10--> | |
− | There are a few other tools that can be used to load the hex file:
| |
− | * avrdude: comes with the Arduino IDE, and with the Arduino Builder tool
| |
− | * [http://www.atmel.com/tools/FLIP.aspx Flip utility from Atmel] (not compatible with genuine teensy boards and with Arduino-compatible atmega32u4-based boards)
| |
− | * [http://dfu-programmer.sourceforge.net/ dfu-programmer command-line tool] (not compatible with genuine teensy boards and with Arduino-compatible atmega32u4-based boards)
| |
| | | |
− | <!--T:11-->
| + | ===Connection table=== <!--T:44--> |
− | dfu-programmer example:
| |
− | sudo dfu-programmer at90usb162 erase
| |
− | sudo dfu-programmer at90usb162 flash at90usb162.hex
| |
− | sudo dfu-programmer at90usb162 reset
| |
− | | |
− | ==Wiring== <!--T:12--> | |
| | | |
| <!--T:13--> | | <!--T:13--> |
Line 140: |
Line 75: |
| | GND || GND | | | GND || GND |
| |- | | |- |
− | | RX || TX / TXO / RXD | + | | RX || TX / TXO / TXD |
| |- | | |- |
− | | TX || RX / RXI / TXD | + | | TX || RX / RXI / RXD |
| |} | | |} |
− | With a Teensy 2.0 as a USB dev board: | + | '''Warning: some adapters are mislabeled and have inverted RX/TX.'''<br /> |
| + | With a Teensy 2.0 or Arduino Leonardo as a USB dev board: |
| {| class="wikitable" | | {| class="wikitable" |
− | | Teensy 2.0 || USB to UART board | + | | Arduino Leonardo || Teensy 2.0 || USB to UART board |
| |- | | |- |
− | | GND || GND | + | | GND || GND || GND |
| |- | | |- |
− | | D2 || TX / TXO / RXD | + | | 0 (RX1) || D2 || TX / TXO / TXD |
| |- | | |- |
− | | D3 || RX / RXI / TXD | + | | 1 (TX1) || D3 || RX / RXI / RXD |
| |} | | |} |
| | | |
Line 158: |
Line 94: |
| If you use the arduino on-board USB to serial converter, Rx and Tx are inverted, i.e. Rx = TX▶ and Tx = RX◀ | | If you use the arduino on-board USB to serial converter, Rx and Tx are inverted, i.e. Rx = TX▶ and Tx = RX◀ |
| | | |
− | <!--T:14-->
| + | ===Examples=== <!--T:48--> |
− | The example below shows how to connect a CP2102 converter (left) to a Teensy 2.0 board (right):
| |
− | | |
− | <!--T:15-->
| |
− | <div class="image200px">[http://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG http://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG]</div>
| |
− | | |
− | <!--T:16--> | |
− | 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:
| |
| | | |
− | <!--T:17--> | + | <!--T:47--> |
− | <div class="image200px">[http://gimx.fr/img/adapter/solderless.jpg http://gimx.fr/img/adapter/solderless.jpg]</div> | + | <div class="mw-collapsible mw-collapsed"> |
| | | |
| <!--T:19--> | | <!--T:19--> |
− | Examples:
| + | * /!\ '''mislabeled''' /!\ CP2102 converter (left, TXD and RXD are inverted) to a Teensy 2.0 board (right). '''Warning, new versions may be labeled properly!''' |
− | * Bumble-b and FT232RL wired on a breadboard: | + | :<div class="image200px">[https://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG https://gimx.fr/img/screenshots/PC-to-PS3-USB-controller.JPG]</div> |
− | :<div class="image200px">[http://gimx.fr/img/screenshots/ft232rl_bumbleb.jpg http://gimx.fr/img/screenshots/ft232rl_bumbleb.jpg]</div> | + | * using jumper wires (these are generally provided with USB to serial TTL boards) in case your AVR USB board has header pins: |
| + | :<div class="image200px">[https://gimx.fr/img/adapter/solderless.jpg https://gimx.fr/img/adapter/solderless.jpg]</div> |
| * Teensy++ and CP2102 wired on a breadboard: | | * Teensy++ and CP2102 wired on a breadboard: |
− | :<div class="image200px">[http://gimx.fr/img/screenshots/cp2102_teensy++.jpg http://gimx.fr/img/screenshots/cp2102_teensy++.jpg]</div> | + | :<div class="image200px">[https://gimx.fr/img/screenshots/cp2102_teensy++.jpg https://gimx.fr/img/screenshots/cp2102_teensy++.jpg]</div> |
| * Teensy 2.0 and CP2102 soldered: | | * Teensy 2.0 and CP2102 soldered: |
− | :<div class="image200px">[http://gimx.fr/img/adapter/soldered.jpg http://gimx.fr/img/adapter/soldered.jpg]</div> | + | :<div class="image200px">[https://gimx.fr/img/adapter/soldered.jpg https://gimx.fr/img/adapter/soldered.jpg]</div> |
| + | |
| + | <!--T:50--> |
| + | </div> |
| + | |
| + | ==Firmware loading== <!--T:8--> |
| + | |
| + | '''Firmwares''' |
| + | |
| + | <div class="mw-collapsible mw-collapsed"> |
| + | |
| + | [http://gimx.fr/download/gimx-firmwares Download link]<br/> |
| + | Available controller emulations: |
| + | {{Firmwares/en}} |
| + | |
| + | </div> |
| + | |
| + | {{FirmwareLoading}} |
| + | |
| + | ==Serial port settings== <!--T:33--> |
| + | |
| + | <!--T:72--> |
| + | This is needed on Windows, for USB to UART adapters based on a FTDI chip. |
| + | |
| + | <!--T:71--> |
| + | <div class="mw-collapsible mw-collapsed"> |
| | | |
− | ==Connection== <!--T:20-->
| + | <!--T:34--> |
| + | On Windows the driver for FTDI chips (e.g. FT232R, FT230X, FT231X...) provides a "Latency Timer" setting than should be set to 1ms for optimal performance.<br /> |
| + | The procedure is detailed on the FTDI website: [http://www.ftdichip.com/Support/Knowledgebase/index.html?cdmcomportadvancedproperti.htm link]. |
| | | |
− | <!--T:21--> | + | <!--T:74--> |
− | If it's not already done, install [http://gimx.fr/downloads GIMX].<br />
| + | </div> |
− | Connect the USB to UART converter to your PC, and connect the usb dev board to your console.<br />
| |
− | Turn the console on (the ps/guide buttons are not working at this point).<br />
| |
− | The console should detect a controller (if you add another controller, it should be detected as controller #2).<br />
| |
− | Start gimx-launcher:<br />
| |
− | TODO: update screenshot<br />
| |
− | <div class="image200px">[http://gimx.fr/img/screenshots/tuto/2.4_2_gimx-serial.png http://gimx.fr/img/screenshots/tuto/2.4_2_gimx-serial.png]</div>
| |
− | In Ubuntu/Linux, the USB to UART converter should be detected as "ttyUSBX" (with 'X' a number).<br />
| |
− | In Windows, it should be detected as "COMX" (with 'X' a number). Check the device manager to select the right one.
| |
− | <div class="image200px">[http://gimx.fr/img/screenshots/WinCP2102.gif http://gimx.fr/img/screenshots/WinCP2102.gif]</div>
| |
− | Now that your adapter is ready you can follow the instructions on the [[Quick_Start|Quick Start page]].
| |
| </translate> | | </translate> |