请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:BQ27621-G1 您好!
访问 Control()函数的 device_type 子函数时遇到问题。 这就是我要做的:
I2C_SendStart();
I2C_WriteByte (0xAA);
I2C_WriteByte (0x00);// Control ()命令的地址
I2C_writeByte (0x01);//也尝试删除此行
I2C_writeByte (0x00);// device_type 函数的地址
I2C_writeByte (0x01);
I2C_SendStop()
I2C_SendStart();
I2C_WriteByte (0xAB);
Data1= I2C_readByte (sendAck = 1);
Data2=I2C_readByte (sendAck = 0);
I2C_SendStop();
我返回的内容是错误的。当我应该得到0x0621时、我得到0xECFF。
有人能解释原因吗?
我还尝试反转 DEVICE_TYPE 的地址顺序(即先发送0x01、然后发送0x00)。