To help familiarize myself with I2C and MSP430 microcontrollers I thought it would be fun to connect a Nintendo Wii nunchuck controller to the microcontroller and have it send back data to my PC using the built-in UART.
Setting up the UART was pretty easy, I'm using an MSP430 Launchpad so I took advantage of its USB->serial capabilities. For whatever reason, the Rx and Tx pins are connected in reverse when using the msp430g2553, I had to make little jumpers that swapped those two pins. Anyway, it works great (provided you stay at or below 9600bps) so I'll stop complaining.
My problem is with I2C, I can send the start signal plus the device address and it seems like the nunchuck sends back an ACK but then the bus becomes "frozen" (for lack of a better term). The microcontroller holds SCL low and the nunchuck holds SDA low.
The following is the code I'm using:
#include <msp430.h>
Register | Value | Bits Set | Meaning |
UCB0TXBUF | 0x00 | ||
UCB0RXBUF | 0x00 | ||
UCB0STAT | 0x50 | UCSCLLOW, UCBBUSY | SCL is held low, Bus busy |
UCB0CTL1 | 0xD2 | UCSSEL1, UCSSEL0, UCTR, UCTXSTT | SMCLK, Transmitter, Generate START condition |
UCB0CTL0 | 0x0F | UCMST, UCMODE1, UCMODE0, USYNC | Master mode, I2C mode, Synchronous mode |
IFG2 | 0x0A | UCB0TXIFG | UCB0TXBUF is empty |

That little spike on the data line concerned me, but it seems to come after the 9th clock pulse so I don't think it's problem, right? Here's a closer look at that pulse:
And this is with the nunchuck unplugged:
Am I doing something inherently wrong here? Why would the bus be hanging like that?