Bus Pirate: Wii Nunchuck quick guide

wii-overview.ii

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: 0×40 GOT ACK: YES<<<write location (?)
WRITE: 0×00 GOT ACK: YES<<<write 0 to location 0×40 (?)
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: 0×00 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 0×06 BYTES:<<read back 6 bytes
0×78 ACK 0×7A ACK 0×2F ACK 0×7D ACK 0×6E ACK 0×17 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

Tags: , ,

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

    Reply

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

    Reply