Categories

Bus Pirate: Wii Nunchuck quick guide

Posted on Wednesday, August 19th, 2009 in Bus Pirate by Ian

wii-overview.ii

See the latest version in the documentation wiki.

Scorpia shared his experience interfacing a Wii Nunchuck with the Bus Pirate I2C library. He used Seeed Studio’s breakout board that brings all the Nunchuck signals to an easy-to-tap header. Here’s some alternatives to the breakout board.

Bus Pirate Wii Nunchuck breakout
MOSI/SDA D (SDA)
CLOCK/SCL C (SCL)
+3.3volts +
GND – (GND)

Connect the Bus Pirate to the Wii Nunchuck breakout board as shown in the table. The nunchuck is powered from the Bus Pirate’s on-board 3.3volt regulator. The nunchuck has very small value internal pull-up resistors on the I2C bus pins, so the Bus Pirate on-board pull-up resistors aren’t needed.

Open the mode menu (m) in the Bus Pirate terminal and select the software I2C library (4). Enable the Bus Pirate’s power supplies (big ‘W’).

I2C>[0xa4 0x40 0x00]<<<Wii Nunchuck initialize
I2C START CONDITION
WRITE: 0xA4 GOT ACK: YES<<<write address
WRITE: 0x40 GOT ACK: YES<<<write location (?)
WRITE: 0x00 GOT ACK: YES<<<write 0 to location 0x40 (?)
I2C STOP CONDITION
I2C>

Initialize the nunchuck, this only has to be done once. See also this example Arduino code.

I2C>[0xa4 0x00]<<<setup the read pointer
I2C START CONDITION
WRITE: 0xA4 GOT ACK: YES<<<write address
WRITE: 0x00 GOT ACK: YES<<<pointer to 0
I2C STOP CONDITION
I2C>[0xa5 r:6]<<<read nunchuck measurements
I2C START CONDITION
WRITE: 0xA5 GOT ACK: YES<<<read address
BULK READ 0x06 BYTES:<<read back 6 bytes
0x78 ACK 0x7A ACK 0x2F ACK 0x7D ACK 0x6E ACK 0x17 NACK
I2C STOP CONDITION
I2C>

Reading data from the nunchuck takes two steps. First, set the read pointer. Next, read six values to get the measurements, decoding guide here.

wii-connections

Connection to the Wii breakout board. Thanks Scorpia!

wii-nunchuck

Wii Nunchuck image: http://www.flickr.com/photos/ravanderende/ / CC BY-NC-SA 2.0

This entry was posted on Wednesday, August 19th, 2009 at 1:17 pm and is filed under Bus Pirate. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

3 Responses to “Bus Pirate: Wii Nunchuck quick guide”

  1. Rslmanu says:

    Thanks a lot !
    It works fine for me. I have a buspirate v2go, firmware v2.2.
    It works in I2C hardware mode, the speed doesn’t matter (I tried with 100KHz, 400KHz and 1MHz).

  2. Ases says:

    It only works for me in hardware mode, but not in Software mode.

  3. villamany says:

    tested on a fake nintento nunchuck (ebay cheaper) and work fine @50Khz (BP firm v5.9 hard v3.a). Thanks for info!!

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • KH: So Romanians use old ICs too, a bit reminiscent of Dilshan's projects. I'm vaguely disappointed by the liberal use of float data and float calculations....
  • Max: This is of course no "0-30V" supply - the single-supply standard LM723 schematic can't go all the way down to zero, which is why I...
  • KH: A power-off current draw of 4mA for the Sony A6000 is a defect, product recall territory. It hits the camera battery with unacceptable wear and...
  • Olav Storstrøm: Please add 9-pin D-sub RJ45 and RJ12 connectors! Thanks!
  • KH: Hydroponics is like home automation. Every year you have folks who start projects like these and think it will take off and become a big...