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.

[参考译文] CC1350STK:无法使用传感器控制器访问板载光传感器 OPT3001、I2C 的数据

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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1047202/cc1350stk-unable-to-access-data-of-onboard-light-sensor-opt3001-i2c-using-sensor-controller

器件型号:CC1350STK

你(们)好

我尝试使用传感器控制器从 CC1350STK 读取光传感器数据、但变量 I2C_STATUS 始终显示1、且输出始终为零。 执行代码如下:

SCL = DIO6
SDA = DIO5

SCL 频率= 400kHz
SCL 拉伸超时= 10us

U16值= 0;

//部分写入操作来设置必须从中读取数据的从机寄存器的地址。 从器件地址= 0X45。 左移从机地址= 1000101 << 1 = 0001011 = A。要从中读取数据的从机寄存器地址= 0x00。

i2cStart();

i2cTx (0xA | I2C_OP_WRITE);

i2cTx (0x00);

i2cStop();

fwDelayU (100000、FW_DELAY_RANGE_100_MS);

//如果成功...

if (state.i2cStatus = 0x0000){

//读取寄存器值

i2cRepeatedStart();

i2cTx (0xA | I2C_OP_READ);

i2cRxNack (value);

i2cStop();

output.lux =值;

if (value > 500){

Station.threshold = 1;

fwGenAlertInterrupt();

//安排下一次执行

fwScheduleTask (1);

如果有人能在这方面提供帮助,那将是非常感谢的。

谢谢