Hello,
I'm using the following code in order to send one byte to a temp. sensor and get back 2 bytes.
But according to the I2C monitor, sometimes, only one byte is received (and not 2).
After sending 1 byte I can not send stop but a "start". This is required by the device.
Can you please check that my code is OK ?
Thanks,
Zvika
I2CMasterSlaveAddrSet(I2C6_BASE, SLAVE_ADDRESS, false);
//Send 0xAA
I2CMasterDataPut(I2C6_BASE, 0xAA);
I2CMasterControl(I2C6_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while(I2CMasterBusy(I2C6_BASE)){};
I2CMasterSlaveAddrSet(I2C6_BASE, SLAVE_ADDRESS, true);
I2CMasterControl(I2C6_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START);
while(I2CMasterBusy(I2C6_BASE)){};
*data=I2CMasterDataGet (I2C6_BASE);
I2CMasterControl(I2C6_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
while(I2CMasterBusy(I2C6_BASE)){};
dummy=I2CMasterDataGet (I2C6_BASE);