This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 I2C no ACK example code



Hi,

I am trying to write code that detects error conditions in the I2C interface when the slave is not responding. Please point me to where I can find the specific example code that the MSP430F552x function as a master I2C and detect the slave who did not generate ACK.

I set the UCTXNACK and expecting an UCNACKIFG interrupt flag and I was expecting that the response would come throught the USCI_B0_ISR vector 4, NACKIFG but nothing happend.

Thanks you in advanced,

Sy

  • Sy Tran said:
    I set the UCTXNACK and expecting an UCNACKIFG interrupt flag

    Settign UCTXNACK causes the USCI in receive mode to send a NACK for the next byte received, or to respond (or rather not respont) to a start condition with a NACK when in slave mode and being addressed.
    It does not cause UCNACKIFG to be set on itself, nor does it cause any NACK on a different peer if it is not appropriate for the current situation (for example, when sending data, you cannot NACK at all - only the receiver can NACK)

    What you can test: in master mode, address a slave that doesn't exist. After the start condition is sent (UCSTT cleared) you will get an interrupt for UCNACKIFG being set, because no slave answered to the request.

    Don't forget to set UCNACKIE or there won't be an interrupt when UCNACKIFG is set.

**Attention** This is a public forum