I am unable to read all 9 bytes of the Sensirion SLF3S-4000B. I only get 3 bytes. The device address is 0x08 (i.e. SLF3S4000B_ADDRESS = 0x08). My code to read is as follows.
When i use only one : " while(I2CMasterBusy(I2C7_BASE))" i get no response, that's why i have 2 " while(I2CMasterBusy(I2C7_BASE))"
statements.
My sensor read function is "void slf3s4000b_flowread(uint32_t * RxData)"
Partial Code
*******
uint32_t sensorRxData[9] = {0};
void slf3s4000b_flowread(uint32_t * RxData)
{
uint16_t i;
//
// Modify the data direction to true, so that seeing the address will
// indicate that the I2C Master is initiating a read from the slave.
//
MAP_I2CMasterSlaveAddrSet(I2C7_BASE, SLF3S4000B_ADDRESS, true);
//
// Setup for first read. Use I2C_MASTER_CMD_BURST_RECEIVE_START
// to start a burst mode read. The I2C master continues to own
// the bus at the end of this transaction.
//
MAP_I2CMasterControl(I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START); // Start the I2C transaction
//
while(I2CMasterBusy(I2C7_BASE)); // Wait until transfer done
while(I2CMasterBusy(I2C7_BASE)); // Wait until transfer done
RxData[0] = MAP_I2CMasterDataGet(I2C7_BASE); // Read the first byte data from the slave
//
// Setup for the 2nd to 8th read. Use I2C_MASTER_CMD_BURST_RECEIVE_CONT
// to continue the burst mode read. The I2C master continues to own
// the bus at the end of this transaction.
//
for(i = 1 ; i < 8; i++)
{
MAP_I2CMasterControl(I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_CONT);
while(MAP_I2CMasterBusy(I2C7_BASE)); // Wait until transfer done
while(MAP_I2CMasterBusy(I2C7_BASE)); // Wait until transfer done
RxData[i] = MAP_I2CMasterDataGet(I2C7_BASE); // Read the first byte data from the slave
}
//
// Setup for the final (9th) read. Use I2C_MASTER_CMD_BURST_RECEIVE_FINISH
// to terminate the I2C transaction. At the end of this transaction,
// the STOP bit will be issued and the I2C bus is returned to the
// Idle state.
//
MAP_I2CMasterControl(I2C7_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
while(MAP_I2CMasterBusy(I2C7_BASE)); // Wait until transfer done
while(MAP_I2CMasterBusy(I2C7_BASE)); // Wait until transfer done
RxData[8] = MAP_I2CMasterDataGet(I2C7_BASE); // Read the last byte data from the slave
}
******************
I have included the sensor data format as well as 2 examples of scope screenshots. The RED is SDA and BLUE is SCL.
Thanks
David Nyarko