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.

[参考译文] CC2640R2F:传感器控制器 I2C 地址错误

Guru**** 2386620 points
Other Parts Discussed in Thread: TMP102
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/769083/cc2640r2f-sensor-controller-i2c-wrong-address

器件型号:CC2640R2F
主题中讨论的其他器件:TMP102

我一直在尝试使用 Launchpad 和 Tmp102传感器、尝试使用传感器控制器检索一些温度、然后通过 BLE 发送这些温度、但我注意到、我必须将 Tmp102的 I2C 地址乘以2才能使连接正常工作。 因此、我不必尝试与地址0x48通信、而是必须与0x90通信。 我的 I2C 代码中是否有问题?

如果有任何帮助,将不胜感激。

InitCode:

// TMP102
U16 i2cAddress 的配置;
for (U16 n = 0;n < 4;n++){
如果(n = 0){
i2cAddress = TMP1_I2C_ADDR*2;
} 如果(n = 1){
i2cAddress = TMP2_I2C_ADDR*2;
} 如果(n = 2){
i2cAddress = TMP3_I2C_ADDR*2;
} 如果(n = 3){
i2cAddress = TMP4_I2C_ADDR*2;
} 否则{
i2cAddress = 0;
}

i2cStart();
i2cTx (I2C_OP_WRITE | i2cAddress);
i2cTx (TMP_REG_CFG);
i2cTx (0x79);
i2cTx (0x20);
i2cStop();

i2cStart();
i2cTx (I2C_OP_WRITE | i2cAddress);
i2cTx (TMP_REG_TMPH);
i2cTx (0x28);
i2cTx (0x00);
i2cStop();

i2cStart();
i2cTx (I2C_OP_WRITE | i2cAddress);
i2cTx (TMP_REG_Tmpl);
i2cTx (0x26);
i2cTx (0x00);
i2cStop();
}//

Comienza la purer ejectucion
fwScheduleTask(1); 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    虽然帮助中不清零、但地址被放置在位位置[7:1]、位0是读取或写入位。 因此、在 Sensor Controller Studio 中使用传感器数据表中的地址时、必须将其向左移动一个位置。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    现在一切都有道理。 谢谢