wusbmote: Wiimote accessory to USB adapter



Project overview

Wii-USB

Wii-USB

This time, for a change, I decided to create an adapter that uses controllers from this era, as in still sold in stores, as new items, and no, not in one of those wireframe bins full of items sold at a price 4 times less than the original. (Still, I do know many treasures are found there...)

Specifications

Joystick mode (default)

Mouse mode (Since version 1.2)

Applications

There are no doubts regarding the usefulness of the Classic controller since it is basically a Playstation controller. But what about the much simple Nunchuk controller? With only two buttons and one joystick, I was not sure it would be very useful. But during testing, I quickly realized I was wrong. This controller is perfect for simple games as found for the Sega Master System and of course, NES.

Nunchuk pros: Nunchuk cons:

goto top Up


Pictures

Here are a few pictures of the project and the supported peripherals:
Development setup

Development setup

Official Nunchuk

Official Nunchuk

Wii MotionPlus

Wii MotionPlus

Official classic controllers

Official classic controllers

Nunchuk clones (Wired and wireless)

Nunchuk clones (Wired and wireless)

Finished adapter

Finished adapter


Please send me your pictures if you build this project! I would be happy to add them here.

goto top Up


Schematic

An Atmel Atmega8 (or Atmega8a), clocked with a 12mhz crystal is used.
MCU and USB

MCU and USB

Wiimote connector

Wiimote connector


3.3v supply
A 3.3v source is required by the game controller and for the R4 and R5 pull up resistors in the above schematic. A voltage regulator reducing the USB 5v supply to 3.3 volt can be easily implemented using the popular LM317 integrated circuit such as suggested for the N64/Gamecube to USB project: http://www.raphnet.net/electronique/gc_n64_usb/index_en.php#2

Wii connector
There a the following options:

Important: I am not specifying a color code for the cables since it changes depending on the manufacturer. You must find out what color code is used by your cables by using a continuity tester to fill a table such as the example below. Once you have done this, wiring should be easy.

Very important: Do not blindly follow the colors in the above example. Sorry to insist, but blindly following a color code may result in a non-functional project, or worst, into permanent damages to your equipment (Controllers, PC, House?). Whatever happens, I will not be held responsible.

What about the cable shield?
Simply connect it to GND.

goto top Up


PCB

As is often the case, I used my multiuse pcb2 circuit which is designed to use an Atmega8 with all the components required for this USB implementation:
Multiuse pcb2

Multiuse pcb2

Wiring instructions

Wiring instructions

Wiimote connector pinout

Wiimote connector pinout



The wiimote wires on the second picture are intentionally desaturated since it is dangerous to follow them blindly, as stated in the schematic section.

goto top Up


Software

File(s)DateDescription
wusbmote-1.3.tar.gz (129 KB)
wusbmote-1.3-m8.hex (19.1 KB)
wusbmote-1.3-m168.hex (19.9 KB)
May 29, 2014 (Thursday) Configuration improvements:
  • Created a separate interface (HID-Generic) for configuration. This makes it possible to send commands under Windows, even in mouse mode.
  • Updated configuration tool for above change.
  • Implemented an I2C interface mode (useful for raw controller access, and experimentation. See the i2c_tool/ subdir for an example.
wusbmote-1.2.1.tar.gz (122.2 KB)
wusbmote-1.2.1-m8.hex (17.2 KB)
wusbmote-1.2.1-m168.hex (17.9 KB)
May 11, 2014 (Sunday) Quick fixes:
  • Now working again under Windows (Corrected report descriptors)
  • Add a makefile to compile the configuration tool under windows.
wusbmote-1.2.tar.gz (111.7 KB)
wusbmote-1.2-m8.hex (17.3 KB)
wusbmote-1.2-m168.hex (18 KB)
May 4, 2014 (Sunday) New features:
  • Add mouse support (Using Nunchuk or Classic controller)
    • Classic controller mouse scroll using right stick
    • Nunchuck mouse scroll wheel by moving then holding C
  • Configuration now stored in EEPROM. Includes:
    • Serial number
    • Operating mode (Mouse or Joystick)
    • Mouse parameters: Divisor, deadzone, invert wheel.
  • Implement an HID Feature report to set configuration
  • Add a Linux tool to set configuration through USB (Uses hidapi)
  • Change VID/PID
  • Atmega168 now compatible (Use Makefile.atmega168)
  • Code cleanup
wusbmote-1.1.tar.gz (102.7 KB)
wusbmote-1.1.hex (10.8 KB)
April 26, 2014 (Saturday) Maintenance release:
  • Update V-USB and fixes for modern GCC
  • Optimized I2C code
wusbmote-1.0.tar.gz (81.7 KB)
wusbmote-1.0.hex (11.5 KB)
November 4, 2012 Initial release.
  • Supports the Nunchuk
  • Supports the classic controller
  • Partially supports the Wii MotionPlus
  • USB HID Compatible
  • The connected controller can be changed at any time
This project is also available on GitHub!
To request features, report issues or contribute, you may send me an email or use the GitHub repository:
https://github.com/raphnet/wusbmote
Source code:
The source code is available under the GPLv2 license. See License.txt for more information. The project compiles with avr-gcc.

Using .hex files

For informations about how to program an AVR MCU, visit my AVR programming page.

USB implementation:
I used an Atmega8 which does not support USB natively so I used the V-USB software only USB driver for AVRs.

Combinaison Vendor ID/Product ID USB:
In order to prevent driver problems and conflicts, please do not re-use my VID/PID pair for derived or other projects. Instead, please obtain your own.

goto top Up


Configuration

A command-line tool for configuring the adapter is supplied with the source code under the tool/ directory. At the moment, I only tested it under Linux, but as hidapi also supports Windows and Mac OS X, it should be possible to use the tool under those OSes as well.

Note that:

Help

Display help:
$ wusbmote_ctl --help
./wusbmote_ctl [OPTION]... [COMMAND]....
Control tool for WUSBmote adapter. Version 1.1.1

Options:
  -h, --help   Print help
  -l, --list   List devices
  -s serial    Operate on specified device (required unless -f is specified)
  -f, --force  If no serial is specified, use first device detected.

Configuratin commands:
  --set_serial serial                Assign a new device serial number
  --mouse_mode                       Put the device in mouse mode
  --joystick_mode                    Put the device in joystick mode
  --mouse_divisor val                Set the mouse rate divisor (Higher = slower). Typ: 4
  --mouse_deadzone val               Set the deadzone for mouse mode. Typ: 5
  --scroll_joystick_invert val       Invert joystick scrolling direction. (0 = normal, 1 = inverted)
  --scroll_nunchuck_invert val       Invert scroll direction (0 = normal, 1 = inverted)
  --scroll_nunchuck_threshold val    Set the nunchuck roll threshold for scrolling. Typ: 127
  --scroll_nunchuck_step val         Set the scroll step size (Higher = more scrolling). Typ: 5
  --scroll_nunchuck_c val            Enable/disable scrolling by move + C. (1 = enable, 0 = disable)
  --scroll_nunchuck_c_threshold val  Stick deflection threshold for scrolling. (Typ: 64)

Example: Listing adapters

Each adapter has an unique serial number which can be used to configure a specific adapter, even if several are connected to the same computer. The --list command will display the serial numbers.

If you only have one adapter, you may use the --force option which will configure the first (and only) adapter from the list.
$ ./wusbmote_ctl -l
Simply listing the devices...
Found device 'WUSBmote_v1.2', serial '1001'
1 device(s) found

Enabling mouse mode

By default, the adapter is in joystick mode. Mouse mode must be explicitely enabled. Note that you must use the serial number corresponding to your adapter (not 1001 as in the example below. See listing adapters above). Note: When switching between mouse and joystick mode, the adapter must be disconnected and reconnected for the setting to become effective.
./wusbmote_ctl -s 1001 --mouse_mode
Setting mouse/joystick mode...command result: 0

Mouse configuration

Permissions under Linux

Typically, it won't be possible for a normal user to configure the adapter:
./wusbmote_ctl -s 1001 --mouse_mode
Error opening device. (Do you have permissions?)
A quick fix is to run the tool as root using sudo:
sudo ./wusbmote_ctl -s 1001 --mouse_mode
Setting mouse/joystick mode...command result: 0

goto top Up


References

The following pages have been extremely useful for this project:

http://www.hardwarebook.info/Wiimote_Expansion_Port
http://wiibrew.org/wiki/Wiimote/Extension_Controllers
http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck
http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Classic_Controller
http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus

goto top Up


Disclaimer

I cannot be held responsible for any damages that could occur to you or your equipment while following the procedures present on this page. Also, I GIVE ABSOLUTELY NO WARRANTY on the correctness and usability of the informations on this page. Please note, however, that the procedures above have worked in my case without any damages or problems.

Now you cannot say that I did not warn you :)

goto top Up


Trademarks used in this site are the property of their respectives owners.
Copyright © 2002-2017, Raphaël Assénat
Website coded withWebsite coded with vimLast update: October 14, 2016 (Friday)