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.

Regarding I2C NACK initial behaviour

Other Parts Discussed in Thread: MSP430F5438A

Hi,

  I am finding a strange intial nack sending behaviour on my MSP430F5438a.

The master sequence is START -> Slave address+write -> (Slave  sends ack) -> Register Addr -> (slave sends ack)-> START->Slave Addr+Read -> (Slave sends ack)-> (Slave sends data)-> NACK -> Stop

When I initially send the I2C engine does not send a NACK. After that it sends the NACK correctly. I have repeated the reading in a loop and it never gives a problem except intially.

Code snippet

inline uint8_t accl_single_read_cmd(uint8_t regaddr) {
    char tmpch = 0;

    while(UCB1STAT & (UCBBUSY|UCSCLLOW)) {
        ;
    }

    send_start(ACCL_I2C_WRITE); //Write
    i2c_send(regaddr);
    send_start(ACCL_I2C_READ); //Read
    set_nack(); //Send NACK.
    tmpch = i2c_recv();
    send_stop(); //Send STOP.

    return tmpch;
}

Initial waveform.

Subsequent waveform (Correct behaviour)

What seems to be wrong?

**Attention** This is a public forum