Other Parts Discussed in Thread: MSP430WARE
I am trying to establish the communication with sgp30 and read co2 & voc value from sensor, but it seems to fail. I am using the i2c library by alex (https://github.com/amykyta3/msp430_modules.I am using this library to do i2c communication with si7020, mpl3115a2 and have no issues in reading the values but seems to fail with sgp30.First i pass the reg_id as 0x2003 for init and then 0x2008 to read measurement. It seems to fail at init.
i2c_package_t i2c_req; i2c_req.slave_addr = slave_addr; i2c_req.addr[0] = reg_id >> 8; //reg_id is 16bit uint i2c_req.addr[1] = reg_id & 0xFF ; i2c_req.addr_len = addr_len; // 2 i2c_req.data_len = destSize; //6 i2c_req.data = dest;// uint8_t meas i2c_req.read = read; // true i2c_in_progress = true; i2c_transfer_start(&i2c_req, i2c_callback); TIMEOUT_HANDLE_INIT(i2c_cmd, 2);
It seems to finish the send_addr, send_restart and assigns next state as read_data ,it fails with I2C_IV == USCI_I2C_UCNACKIFG.
Any suggestions as what is wrong?.