MSP430 I2C - a very fundamental problem!!

Hello,

I’m trying to interface a mini cmos camera(C3188A) to a MSP430F169 from I2C bus. However I have some problems. First of all, I have written the code below to initialize I2C bus:

WDTCTL = WDTPW + WDTHOLD;

P3SEL |= 0x0A;

U0CTL |= I2C + SYNC;

U0CTL &= ~I2CEN;

U0CTL |= MST;

I2CTCTL |= I2CSSEL1 + I2CTRX;

I2CNDAT = 0x03;

I2CSA = 0x0003; // Slave Address is 011h

I2CIE = TXRDYIE;

U0CTL |= I2CEN;

_EINT();

My camera’s chip select pins are configured as <011>. I have a question in that point, in application report SLAA208, it says that slave address should be configured as 1010xxx where xxx is the chip select configuration. The bits 1010 are fixed. Is this configuration valid for all 3 chip select slave devices or only for that EEPROM? Because in the user manual it doesn’t mention about such a limitation(the fixed address part, 1010). In the same application report(Slaa208) it also mentions about the usage of I2CSA register. It writes that when the START condition is generated, contents of I2CSA is automatically sent with shifting one bit to the left and placing direction bit to the LSB. So, I don’t need to send the first address byte manually? If so, is this automatically sent address byte counted as one for the I2CNDAT register? Or does it just count the data bytes that we send?

After the initialization procedure I initiate a transfer as below:

I2CTCTL |= I2CSTT + I2CSTP; // send start condition

while((I2CIFG & TXRDYIFG) == 0); //wait for transmit to be ready

I2CDRB = 0x4E;//code[0]; //send one byte

while((I2CIFG & TXRDYIFG) == 0);

I2CDRB = 0x13;//code[1];

while((I2CIFG & TXRDYIFG) == 0); //execution halts here

I2CDRB = 0x21;//code[1];

When execution comes to transmit the third data byte, it halts in the final while loop(regardless of the value of I2CNDAT). It seems the bus never gets ready to transmit. When I check I2CTCTL register, the I2CSTT bit is not cleared after start condition. I2CSTP bit is also not cleared any time. I2CTCTL register remains constant. Moreover after start condition is sent, I2CBUSY bit is set but I2CBB bit never gets set. It seems something is going wrong in my initialization procedure but I couldn’t figure it out. Could anyone help me with that?

Thanks,