Part Number: MSP432P401R
Tool/software: TI-RTOS
Hello,
I am using the mpu for a project and the i2c transfer does not work. The i2c remains locked indefinitely since I use block mode, but with call back mode it does not make the transfer either. I think the mistake is that it doesn't recognize the slave device. The only thing I've checked is that the address is correct (0x68) for the MPU9250.
Any idea what might go wrong?
P.D.: the code:
I2C_Handle i2c;
I2C_Params params;
I2C_Transaction i2cTransaction;
uint8_t txBuffer[1];
uint8_t rxBuffer;
I2C_Handle ret;
I2C_Params_init(¶ms);
// params.transferMode = I2C_MODE_CALLBACK;
params.transferCallbackFxn = NULL;
params.bitRate = I2C_400kHz;
i2c = I2C_open(Board_I2C_TMP, ¶ms);
txBuffer[0] = regAddr;
i2cTransaction.writeBuf = txBuffer;
i2cTransaction.writeCount = 1;
i2cTransaction.readBuf = rxBuffer;
i2cTransaction.readCount = 1;
i2cTransaction.slaveAddress = 0x68;
ret = I2C_transfer(i2c, &i2cTransaction);
if (ret == NULL) {
System_printf("I2C did not tranfer\n");
}
else if (ret){
System_printf("I2C did the transfer\n");
}
System_flush();
I2C_close(i2c);
Thank you very much!!!
