BeagleBoard I2C. Interfacing to the WiiChuck
BEAGLEBOARD
BeagleBoard I2C. Interfacing to the WiiChuck
2012-05-24
By
picoFlamingo

After playing with the GPIO (http://papermint-designs.com/community/node/205) for a while, let's move on through the BeagleBoard Expansion Header. Now it is time for the I2C bus. I2C bus is available through pins 23 (Data) and 24 (Clock).
These signals, as everything else in the BeagleBoard expansion header are 1.8V which, in most of the cases, will require some level conversion. However, for a first quick and easy contact with these signals, we will use a simple serial I2C EEPROM (24C256 - http://www.sparkfun.com/products/525-) which can work with 1.8V.

A nice 24C256 pinout diagram can be found here (http://arduinoideas.blogspot.com/2011/03/24c256-circuit.html), we only need to add a couple of pullup resistors to connect to the Beagle. Place your pullup resistors between the I2C signals (SDA and SCL) and Vcc and then connect SDA and SCL in the device to SDA and SDL in the BeagleBoard.

Two 4.7K resistors worked OK. Actually we are just going to detect the device, no really use it, and, at least for that purpose, it seems that the resistors are not needed.

So this is our basic setup.

24C256 Interface to Beagleboard

All the wires on the right of the images configure the I2C address. In the picture A2 is wired to Vcc (1.8V from the expansion header) and all the other address lines are wired to GND, providing an effective address of 54. If you connect all the address lines to GND, you'll get address 50.

Now we can run ic2detext -r 2 as explained here (http://elinux.org/Interfacing_with_I2C_Devices) getting the following results for the two cases mentioned above (address 50 and 54)

i2cdetect with two different 24C256 I2C addresses

Now that the i2c bus seems to work on the 1.8V rail, it is time to go for something more realistic. We have chose the WiiChuck, because:

  • We have already got one and also a connector adapter (http://www.sparkfun.com/products/9281)
  • This problem has already been solved here (http://www.alfonsomartone.itb.it/mzscbb.html) and here (http://elinux.org/BeagleBoard_Trainer_Nunchuk)
  • And there is plenty of information out there (http://todbot.com/blog/2008/02/18/wiichuck-wii-nunchuck-adapter-available/).

The WiiChuck uses 3.3V signals, so we need to use a Logic level Converter like this (http://www.sparkfun.com/products/8745). Do not forget to check the schematics in the SparkFun page. We will also need a 3.3V rail. For the 3.3V we are using this Voltage regulator (http://www.sparkfun.com/products/526), to get the 3.3V from a USB cable (5V ).

The connection is exactly the same used for the 24C256 I2C EEPROM, but in this case with the level converter in between. It looks a lot more complicated with the the 3.3 "power supply" and the level converter on the picture, but it is really the same thing.

WiiChuck to BeagleBoard Interface. Full Setup

And another picture of the level converter and BeagleBoard expansion header.

WiiChuck to BeagleBoard Interface. Level Converter Detail

Note that for this to work you need to use the Level Converter TXI/TXO pins. Then you should be able to execute any of the test programs here (http://elinux.org/BeagleBoard_Trainer_Nunchuk) or here (http://www.alfonsomartone.itb.it/mzscbb.html) to visualise the data coming from your WiiNunchuck.

Probably we will try to use this as an input device for manipulating 3D objects within picoFlamingo slides... let's see.

CU

The picoFlamingo Team.