I am having trouble checking for the ack/nack after the I2C start condition is sent using an MSP430F5438 as an I2C master. The user's guide states that after the slave device acknowledges that the UCTXSTT bit is cleared in UCBxCTL1, and if a nack is received the UCNACKIE bit is set in UCBxIFG. I'm not seeing either condition occur. And looking at the output on the logic analyzer it looks like the master is only clocking 8 bits, and it should be clocking 9, (7 address bits, r/w bit, plus ack bit). Here is my code (I'm using the latest version [v1.40.00.24] of the MSP430 Driver Library):
USCI_B_I2C_masterSendStart(USCI_B0_BASE); while((USCI_B_I2C_masterIsStartSent(USCI_B0_BASE) == USCI_B_I2C_SENDING_START) && (USCI_B_I2C_getInterruptStatus(USCI_B0_BASE, USCI_B_I2C_NAK_INTERRUPT) == 0)) ;
The code gets stuck in the while loop.
Please help.